pub trait ProtocolRead: AsyncRead + Unpin {
// Provided method
fn recv_message(&mut self) -> impl Future<Output = Res<ProtocolMessage>> { ... }
}Expand description
Length-delimited receiving of protocol frames over any async reader.
Provided Methods§
Sourcefn recv_message(&mut self) -> impl Future<Output = Res<ProtocolMessage>>
fn recv_message(&mut self) -> impl Future<Output = Res<ProtocolMessage>>
Reads one u32-length-prefixed frame and decodes it.
§Errors
Returns an error on EOF / read failure, a length prefix beyond Constant::MAX_FRAME_SIZE,
or a body that does not decode.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".