doc.rust-lang.org
pub struct Sender<T>
The sending-half of Rust's asynchronous channel type.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct SendError<T>
An error returned from the Sender::send or SyncSender::send function on channels.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub enum RecvTimeoutError
This enumeration is the list of possible errors that made recv_timeout unable to return data when called. This can occur with both a channel and a sync_channel.
enum
std
Stable since 1.12.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct RecvError
An error returned from the recv function on a Receiver.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_recv(&self) -> Result<T, TryRecvError>
Attempts to return a pending value on this receiver without blocking.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_iter(&self) -> TryIter<'_, T>
Returns an iterator that will attempt to yield all pending values. It will return None if there are no more pending values or if the channel has hung up. The iterator will never panic! or block the user by waiting for values.
method
std
Stable since 1.15.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError>
Attempts to wait for a value on this receiver, returning an error if the corresponding channel has hung up, or if it waits more than timeout.
method
std
Stable since 1.12.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn recv(&self) -> Result<T, RecvError>
Attempts to wait for a value on this receiver, returning an error if the corresponding channel has hung up.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn iter(&self) -> Iter<'_, T>
Returns an iterator that will block waiting for messages, but never panic!. It will return None when the channel has hung up.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Receiver<T>
The receiving half of Rust's channel (or sync_channel) type. This half can only be owned by one thread.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Iter<'a, T>
An iterator over messages on a Receiver, created by iter.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct IntoIter<T>
An owning iterator over messages on a Receiver, created by into_iter.
struct
std
Stable since 1.1.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod mpsc
Multi-producer, single-consumer FIFO queue communication primitives.
module
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(f: F) -> LazyLock<T, F>
Creates a new lazy value with the given initializing function.
associated_function
std
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_mut(this: &mut LazyLock<T, F>) -> Option<&mut T>
Returns a mutable reference to the value if initialized. Otherwise (if uninitialized or poisoned), returns None.
associated_function
std
Stable since 1.94.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get(this: &LazyLock<T, F>) -> Option<&T>
Returns a reference to the value if initialized. Otherwise (if uninitialized or poisoned), returns None.
associated_function
std
Stable since 1.94.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn force_mut(this: &mut LazyLock<T, F>) -> &mut T
Forces the evaluation of this lazy value and returns a mutable reference to the result.
associated_function
std
Stable since 1.94.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn force(this: &LazyLock<T, F>) -> &T
Forces the evaluation of this lazy value and returns a reference to result. This is equivalent to the Deref impl, but is explicit.
associated_function
std
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct LazyLock<T, F>
A value which is initialized on the first access.
struct
std
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_leader(&self) -> bool
Returns true if this thread is the "leader thread" for the call to Barrier::wait().
method
std
Stable since 1.0.0
Version 1.100.0-nightly