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>
impl<T> Sender<T>
sourcepub async fn send(&self, item: T) -> Result<(), SendError<T>>
pub async fn send(&self, item: T) -> Result<(), SendError<T>>
Asynchronously sends value to the receiver.
sourcepub fn try_send(&self, item: T) -> Result<(), TrySendError<T>>
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.
sourcepub fn close_this_sender(&mut self)
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.
Trait Implementations
source§impl<T> Sink<T> for Sender<T>
impl<T> Sink<T> for Sender<T>
source§type Error = TrySendError<Option<T>>
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>>
fn poll_ready( self: Pin<&mut Self>, ctx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
Sink
to receive a value. Read moresource§fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), Self::Error>
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