what are the concrete reader and writer types (i.e. struct-like) so that they can be used in a function call? I know they are impl tokio::io::AsyncRead + tokio::io::AsyncWrite but trying to use them in a function call they're referred to as still opaque. Thanks.
I'm guessing you are using tokio::io::split. In that case the types are tokio::io::ReadHalf<T> and tokio::io::WriteHalf<T>, where T is the type of your stream.
And how do I find type T of my stream? Going up my call chain:
...
let mut endpoint = Endpoint::new(socket_name.clone());
let mut incoming = endpoint.incoming()
.expect(&format!("failed to open new socket: {}", &socket_name));
while let Some(result) = incoming.next().await
{
match result {
Ok(stream) => {
let (mut reader, mut writer) = split(stream);
...
If it complains about Unpin, then just add tokio::pin!(reader, writer); to the start of your serve function, or if moved into a tokio::spawn, add the macro inside the spawn, or add + Unpin to the generics.