Struct chan::Sender
[−]
[src]
pub struct Sender<T>(_);
The sending half of a channel.
Senders can be cloned any number of times and sent to other threads.
Senders also implement Sync, which means they can be shared among threads
without cloning if the channels can be proven to outlive the execution
of the threads.
When all sending halves of a channel are dropped, the channel is closed
automatically. When a channel is closed, no new values can be sent on the
channel. Also, all receive operations either return any values left in the
buffer or return immediately with None.
Methods
impl<T> Sender<T>[src]
pub fn send(&self, val: T)[src]
Send a value on this channel.
If this is an asnychronous channel, send never blocks.
If this is a synchronous channel, send only blocks when the buffer
is full.
If this is a rendezvous channel, send blocks until a corresponding
recv retrieves val.
Values are guaranteed to be received in the same order that they are sent.
This operation will never panic! but it can deadlock.
Trait Implementations
impl<T: Debug> Debug for Sender<T>[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<T> Clone for Sender<T>[src]
fn clone(&self) -> Sender<T>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<T> Drop for Sender<T>[src]
impl<T> Hash for Sender<T>[src]
fn hash<H: Hasher>(&self, state: &mut H)[src]
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl<T> PartialEq for Sender<T>[src]
fn eq(&self, other: &Sender<T>) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.