ChannelShared

Struct ChannelShared 

Source
pub struct ChannelShared<T> { /* private fields */ }

Implementations§

Source§

impl<T> ChannelShared<T>

Source

pub fn len(&self) -> usize

The number of messages in the channel.

Source

pub fn capacity(&self) -> Option<usize>

The capacity of the channel. Returns None for unbounded channels.

Source

pub fn is_empty(&self) -> bool

Returns true if the channel is empty.

Source

pub fn is_full(&self) -> bool

Returns true if the channel is full.

Source

pub fn is_disconnected(&self) -> bool

Returns true if all senders or receivers have been dropped.

Source

pub fn get_tx_count(&self) -> usize

Returns the number of senders for the channel.

Source

pub fn get_rx_count(&self) -> usize

Returns the number of receivers for the channel.

Source

pub fn get_wakers_count(&self) -> (usize, usize)

Returns the number of wakers for senders and receivers. For debugging purposes.

Trait Implementations§

Source§

impl<T> AsRef<ChannelShared<T>> for AsyncRx<T>

Source§

fn as_ref(&self) -> &ChannelShared<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> AsRef<ChannelShared<T>> for AsyncTx<T>

Source§

fn as_ref(&self) -> &ChannelShared<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> AsRef<ChannelShared<T>> for MAsyncRx<T>

Source§

fn as_ref(&self) -> &ChannelShared<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> AsRef<ChannelShared<T>> for MAsyncTx<T>

Source§

fn as_ref(&self) -> &ChannelShared<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> AsRef<ChannelShared<T>> for MRx<T>

Source§

fn as_ref(&self) -> &ChannelShared<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> AsRef<ChannelShared<T>> for MTx<T>

Source§

fn as_ref(&self) -> &ChannelShared<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> AsRef<ChannelShared<T>> for Rx<T>

Source§

fn as_ref(&self) -> &ChannelShared<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> AsRef<ChannelShared<T>> for Tx<T>

Source§

fn as_ref(&self) -> &ChannelShared<T>

Converts this type into a shared reference of the (usually inferred) input type.

Auto Trait Implementations§

§

impl<T> !Freeze for ChannelShared<T>

§

impl<T> !RefUnwindSafe for ChannelShared<T>

§

impl<T> Send for ChannelShared<T>
where T: Send,

§

impl<T> Sync for ChannelShared<T>
where T: Send,

§

impl<T> Unpin for ChannelShared<T>
where T: Unpin,

§

impl<T> !UnwindSafe for ChannelShared<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.