pub trait Receive: Session {
type ReceivePayload<'a>
where Self: 'a;
// Required method
fn receive<'a>(
&'a mut self
) -> Result<ReceiveOutcome<Self::ReceivePayload<'a>>, Error>;
}
Expand description
A Session
implementation that can receive payloads via polling.
Required Associated Types§
sourcetype ReceivePayload<'a>
where
Self: 'a
type ReceivePayload<'a> where Self: 'a
The type returned by the receive(..)
function.
Required Methods§
sourcefn receive<'a>(
&'a mut self
) -> Result<ReceiveOutcome<Self::ReceivePayload<'a>>, Error>
fn receive<'a>( &'a mut self ) -> Result<ReceiveOutcome<Self::ReceivePayload<'a>>, Error>
Attempt to receive a payload
from the session.
This will return ReceiveOutcome::Payload
when data has been received.
ReceiveOutcome::Buffered
can be used to report that work was completed, but data is not ready.
This means that only [ReceiveOutcome::None
] should be used to indicate to a scheduler that yielding or idling is appropriate.
Object Safety§
This trait is not object safe.