Struct futures_channel::mpsc::Sender [−][src]
pub struct Sender<T>(_);
Expand description
The transmission end of a bounded mpsc channel.
This value is created by the channel
function.
Implementations
impl<T> Sender<T>
[src]
impl<T> Sender<T>
[src]pub fn try_send(&mut self, msg: T) -> Result<(), TrySendError<T>>
[src]
pub fn try_send(&mut self, msg: T) -> Result<(), TrySendError<T>>
[src]Attempts to send a message on this Sender
, returning the message
if there was an error.
pub fn start_send(&mut self, msg: T) -> Result<(), SendError>
[src]
pub fn start_send(&mut self, msg: T) -> Result<(), SendError>
[src]Send a message on the channel.
This function should only be called after
poll_ready
has reported that the channel is
ready to receive a message.
pub fn poll_ready(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), SendError>>
[src]
pub fn poll_ready(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(), SendError>>
[src]Polls the channel to determine if there is guaranteed capacity to send at least one item without waiting.
Return value
This method returns:
Poll::Ready(Ok(_))
if there is sufficient capacity;Poll::Pending
if the channel may not have capacity, in which case the current task is queued to be notified once capacity is available;Poll::Ready(Err(SendError))
if the receiver has been dropped.
pub fn is_closed(&self) -> bool
[src]
pub fn is_closed(&self) -> bool
[src]Returns whether this channel is closed without needing a context.
pub fn close_channel(&mut self)
[src]
pub fn close_channel(&mut self)
[src]Closes this channel from the sender side, preventing any new messages.
pub fn disconnect(&mut self)
[src]
pub fn disconnect(&mut self)
[src]Disconnects this sender from the channel, closing it if there are no more senders left.
pub fn same_receiver(&self, other: &Self) -> bool
[src]
pub fn same_receiver(&self, other: &Self) -> bool
[src]Returns whether the senders send to the same receiver.
pub fn is_connected_to(&self, receiver: &Receiver<T>) -> bool
[src]
pub fn is_connected_to(&self, receiver: &Receiver<T>) -> bool
[src]Returns whether the sender send to this receiver.
pub fn hash_receiver<H>(&self, hasher: &mut H) where
H: Hasher,
[src]
pub fn hash_receiver<H>(&self, hasher: &mut H) where
H: Hasher,
[src]Hashes the receiver into the provided hasher
Trait Implementations
impl<T> Sink<T> for Sender<T>
[src]
impl<T> Sink<T> for Sender<T>
[src]fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
[src]
fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Self::Error>>
[src]Attempts to prepare the Sink
to receive a value. Read more
fn start_send(self: Pin<&mut Self>, msg: T) -> Result<(), Self::Error>
[src]
fn start_send(self: Pin<&mut Self>, msg: T) -> Result<(), Self::Error>
[src]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
Auto Trait Implementations
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T> where
T: Send,
T: Send,
impl<T> Sync for Sender<T> where
T: Send,
T: Send,
impl<T> Unpin for Sender<T>
impl<T> !UnwindSafe for Sender<T>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more