Type Alias TcpFramedSink

Source
pub type TcpFramedSink<T> = Sender<(T, SocketAddr)>;
Expand description

A framed TCP Sink (sending).

Aliased Type§

struct TcpFramedSink<T> { /* private fields */ }

Implementations

Source§

impl<T> Sender<T>

Source

pub async fn send(&self, item: T) -> Result<(), SendError<T>>

Asynchronously sends value to the receiver.

Source

pub fn try_send(&self, item: T) -> Result<(), TrySendError<T>>

Tries to send the value to the receiver without blocking.

Returns an error if the destination is closed or if the buffer is at capacity.

TrySendError::Full will never be returned if this is an unbounded channel.

Source

pub fn close_this_sender(&mut self)

Close this sender. No more messages can be sent from this sender.

Note that this only closes the channel from the view-point of this sender. The channel remains open until all senders have gone away, or until the Receiver closes the channel.

Source

pub fn is_closed(&self) -> bool

If this sender or the corresponding Receiver is closed.

Trait Implementations

Source§

impl<T> Clone for Sender<T>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Drop for Sender<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> Sink<T> for Sender<T>

Source§

type Error = TrySendError<Option<T>>

The type of value produced by the sink when an error occurs.
Source§

fn poll_ready( self: Pin<&mut Self>, ctx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Attempts to prepare the Sink to receive a value. Read more
Source§

fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), Self::Error>

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more
Source§

fn poll_flush( self: Pin<&mut Self>, _ctx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output from this sink. Read more
Source§

fn poll_close( self: Pin<&mut Self>, ctx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output and close this sink, if necessary. Read more