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]

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]

Formats the value using the given formatter. Read more

impl<T> Clone for Sender<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> Drop for Sender<T>
[src]

Executes the destructor for this type. Read more

impl<T> Hash for Sender<T>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T> PartialEq for Sender<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T> Eq for Sender<T>
[src]

Auto Trait Implementations

impl<T> Send for Sender<T> where
    T: Send

impl<T> Sync for Sender<T> where
    T: Send