pub struct SendSink<T>(/* private fields */);Expand description
A sink that allows sending values into a channel.
Can be created via Sender::sink or Sender::into_sink.
Implementations§
Source§impl<T> SendSink<T>
impl<T> SendSink<T>
Sourcepub fn sender(&self) -> &Sender<T>
pub fn sender(&self) -> &Sender<T>
Returns a clone of a sending half of the channel of this sink.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
See Sender::is_closed.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
See Sender::is_empty.
Sourcepub fn is_full(&self) -> bool
pub fn is_full(&self) -> bool
See Sender::is_full.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
See Sender::len.
Sourcepub fn capacity(&self) -> Option<usize>
pub fn capacity(&self) -> Option<usize>
See Sender::capacity.
Sourcepub fn same_channel(&self, other: &Self) -> bool
pub fn same_channel(&self, other: &Self) -> bool
Returns whether the SendSinks are belong to the same channel.
Trait Implementations§
Source§impl<T> Sink<T> for SendSink<T>
impl<T> Sink<T> for SendSink<T>
Source§fn poll_ready(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, _cx: &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 moreAuto Trait Implementations§
impl<T> Freeze for SendSink<T>where
T: Freeze,
impl<T> RefUnwindSafe for SendSink<T>where
T: RefUnwindSafe,
impl<T> Send for SendSink<T>where
T: Send,
impl<T> Sync for SendSink<T>
impl<T> Unpin for SendSink<T>
impl<T> UnwindSafe for SendSink<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more