pub struct SendSink<'a, 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<'a, T> SendSink<'a, T>
impl<'a, T> SendSink<'a, 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_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
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
.
Trait Implementations§
source§impl<'a, T> Sink<T> for SendSink<'a, T>
impl<'a, T> Sink<T> for SendSink<'a, 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<'a, T> Freeze for SendSink<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for SendSink<'a, T>
impl<'a, T> Send for SendSink<'a, T>where
T: Send,
impl<'a, T> Sync for SendSink<'a, T>
impl<'a, T> Unpin for SendSink<'a, T>
impl<'a, T> !UnwindSafe for SendSink<'a, T>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)