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]
impl<T> Sender<T>
pub fn send(&self, val: T)
[src]
pub fn send(&self, val: T)
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]
impl<T: Debug> Debug for Sender<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Clone for Sender<T>
[src]
impl<T> Clone for Sender<T>
fn clone(&self) -> Sender<T>
[src]
fn clone(&self) -> Sender<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> Drop for Sender<T>
[src]
impl<T> Drop for Sender<T>
impl<T> Hash for Sender<T>
[src]
impl<T> Hash for Sender<T>
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T> PartialEq for Sender<T>
[src]
impl<T> PartialEq for Sender<T>
fn eq(&self, other: &Sender<T>) -> bool
[src]
fn eq(&self, other: &Sender<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T> Eq for Sender<T>
[src]
impl<T> Eq for Sender<T>