Struct tiny_actor::channel::Channel
source · [−]pub struct Channel<M> { /* private fields */ }Expand description
Contains all data that should be shared between Addresses, Inboxes and the Child.
Implementations
sourceimpl<M> Channel<M>
impl<M> Channel<M>
sourceimpl<M> Channel<M>
impl<M> Channel<M>
pub fn send(&self, msg: M) -> Snd<'_, M>ⓘNotable traits for Snd<'a, M>impl<'a, M> Future for Snd<'a, M> type Output = Result<(), SendError<M>>;
pub fn send_now(&self, msg: M) -> Result<(), TrySendError<M>>
pub fn try_send(&self, msg: M) -> Result<(), TrySendError<M>>
pub fn send_blocking(&self, msg: M) -> Result<(), SendError<M>>
Trait Implementations
sourceimpl<M: Send + 'static> AnyChannel for Channel<M>
impl<M: Send + 'static> AnyChannel for Channel<M>
sourceimpl<M> DynChannel for Channel<M>
impl<M> DynChannel for Channel<M>
sourcefn close(&self) -> bool
fn close(&self) -> bool
Close the channel. Returns true if the channel was not closed before this.
Otherwise, this returns false.
Notifies
- if
true-> all send_listeners & recv_listeners
sourcefn halt_some(&self, n: u32)
fn halt_some(&self, n: u32)
Halt n inboxes associated with this channel. If n >= #inboxes, all inboxes
will be halted. This might leave halt-count > inbox-count, however that’s not
a problem. If n > i32::MAX, n = i32::MAX.
Notifies
nrecv-listeners
sourcefn inbox_count(&self) -> usize
fn inbox_count(&self) -> usize
Returns the amount of inboxes this channel has.
sourcefn address_count(&self) -> usize
fn address_count(&self) -> usize
Returns the amount of addresses this channel has.
sourcefn has_exited(&self) -> bool
fn has_exited(&self) -> bool
Whether all inboxes linked to this channel have exited.
sourcefn add_address(&self) -> usize
fn add_address(&self) -> usize
Add an Address to the channel, incrementing address-count by 1. Afterwards, a new Address may be created from this channel.
Returns the previous inbox-count
sourcefn remove_address(&self) -> usize
fn remove_address(&self) -> usize
sourcefn is_bounded(&self) -> bool
fn is_bounded(&self) -> bool
Whether the channel is bounded.
fn get_exit_listener(&self) -> EventListener
fn halt(&self)
Auto Trait Implementations
impl<M> RefUnwindSafe for Channel<M>
impl<M> Send for Channel<M> where
M: Send,
impl<M> Sync for Channel<M> where
M: Send,
impl<M> Unpin for Channel<M> where
M: Unpin,
impl<M> UnwindSafe for Channel<M>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more