Type Alias TcpFramedStream

Source
pub type TcpFramedStream<Codec: Decoder> = Receiver<Result<(<Codec as Decoder>::Item, SocketAddr), <Codec as Decoder>::Error>>;
Expand description

A framed TCP Stream (receiving).

Aliased Type§

struct TcpFramedStream<Codec: Decoder> { /* private fields */ }

Implementations

Source§

impl<T> Receiver<T>

Source

pub async fn recv(&mut self) -> Option<T>

Receive a value asynchronously.

Source

pub fn poll_recv(&mut self, ctx: &Context<'_>) -> Poll<Option<T>>

Poll for a value. NOTE: takes &mut self to prevent multiple concurrent receives.

Source

pub fn close(&mut self)

Closes this receiving end, not allowing more values to be sent while still allowing already-sent values to be consumed.

Trait Implementations

Source§

impl<T> Drop for Receiver<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> Stream for Receiver<T>

Source§

type Item = T

Values yielded by the stream.
Source§

fn poll_next( self: Pin<&mut Self>, ctx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more