[−][src]Struct crossbeam_channel::Sender
The sending side of a channel.
Examples
use std::thread; use crossbeam_channel::unbounded; let (s1, r) = unbounded(); let s2 = s1.clone(); thread::spawn(move || s1.send(1).unwrap()); thread::spawn(move || s2.send(2).unwrap()); let msg1 = r.recv().unwrap(); let msg2 = r.recv().unwrap(); assert_eq!(msg1 + msg2, 3);
Methods
impl<T> Sender<T>
[src][−]
pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>>
[src][+]
pub fn send(&self, msg: T) -> Result<(), SendError<T>>
[src][+]
pub fn send_timeout(
&self,
msg: T,
timeout: Duration
) -> Result<(), SendTimeoutError<T>>
[src][+]
&self,
msg: T,
timeout: Duration
) -> Result<(), SendTimeoutError<T>>
pub fn is_empty(&self) -> bool
[src][+]
pub fn is_full(&self) -> bool
[src][+]
pub fn len(&self) -> usize
[src][+]
pub fn capacity(&self) -> Option<usize>
[src][+]
Trait Implementations
impl<T: Send> Sync for Sender<T>
[src]
impl<T> Clone for Sender<T>
[src][+]
impl<T: Send> Send for Sender<T>
[src]
impl<T> Drop for Sender<T>
[src][+]
impl<T> Debug for Sender<T>
[src][+]
impl<T> UnwindSafe for Sender<T>
[src]
impl<T> RefUnwindSafe for Sender<T>
[src]
Blanket Implementations
impl<T> From for T
[src][+]
impl<T, U> Into for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T> Borrow for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,