pub struct Channel<M> { /* private fields */ }
Expand description

Contains all data that should be shared between Addresses, Inboxes and the Child.

Implementations

This will attempt to receive a message from the Inbox. If there is no message, this will return None.

Wait until there is a message in the Inbox.

Trait Implementations

Formats the value using the given formatter. Read more

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

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
  • n recv-listeners

Returns the amount of inboxes this channel has.

Returns the amount of messages currently in the channel.

Returns the amount of addresses this channel has.

Whether the queue asscociated to the channel has been closed.

Capacity of the inbox.

Whether all inboxes linked to this channel have exited.

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

Remove an Address from the channel, decrementing address-count by 1. This should be called from the destructor of the Address.

Notifies
  • prev-address-count == 1 -> all send_listeners & recv_listeners
Panics
  • prev-address-count == 0

Get the actor_id.

Whether the channel is bounded.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.