Trait fizyr_rpc::transport::TransportReadHalf
source · pub trait TransportReadHalf: Send + Unpin {
type Body: Body;
// Required method
fn poll_read_msg(
self: Pin<&mut Self>,
context: &mut Context<'_>
) -> Poll<Result<Message<Self::Body>, TransportError>>;
// Provided method
fn read_msg(&mut self) -> ReadMsg<'_, Self> ⓘ
where Self: Unpin { ... }
}
Expand description
Trait for the read half of a transport type.
Required Associated Types§
Required Methods§
sourcefn poll_read_msg(
self: Pin<&mut Self>,
context: &mut Context<'_>
) -> Poll<Result<Message<Self::Body>, TransportError>>
fn poll_read_msg( self: Pin<&mut Self>, context: &mut Context<'_> ) -> Poll<Result<Message<Self::Body>, TransportError>>
Try to read a message from the transport without blocking.
This function may read partial messages into an internal buffer.
If the function returns Poll::Pending
,
the current task is scheduled to wake when more data is available.
Provided Methods§
Object Safety§
This trait is not object safe.