Trait BincodeReceive

Source
pub trait BincodeReceive: Unpin + Sized {
    // Required method
    fn pull(&mut self) -> impl Future<Output = Res<ProtocolMessageGuard>>;
}
Expand description

A trait for receiving protocol messages over a stream.

This impl is designed to ensure that the pull method can only be used to receive ProtocolMessage messages. This restriction provides type safety and ensures proper message decryption and protocol handling for incoming data.

Required Methods§

Source

fn pull(&mut self) -> impl Future<Output = Res<ProtocolMessageGuard>>

Pulls a message from the stream.

Since are reading here, we just return the concrete type, though it stands to reason that we could just constrain this with a Guard of a type Result: BorrowDecode.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§