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>

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> Clone for Sender<T>

fn clone(&self) -> Sender<T>

fn clone_from(&mut self, source: &Self)

impl<T> Drop for Sender<T>

fn drop(&mut self)

impl<T> Hash for Sender<T>

fn hash<H: Hasher>(&self, state: &mut H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl<T> PartialEq for Sender<T>

fn eq(&self, other: &Sender<T>) -> bool

fn ne(&self, other: &Rhs) -> bool

impl<T> Eq for Sender<T>

Derived Implementations

impl<T: Debug> Debug for Sender<T>

fn fmt(&self, __arg_0: &mut Formatter) -> Result