Type Alias dfir_rs::util::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