ActorContext

Struct ActorContext 

Source
pub struct ActorContext<A, MUT = NoopRawMutex, const QUEUE_SIZE: usize = 1>
where A: Actor + 'static, MUT: RawMutex + 'static,
{ /* private fields */ }
Expand description

A context for an actor, providing signal and message queue. The QUEUE_SIZE parameter is a const generic parameter, and controls how many messages an Actor can handle.

Implementations§

Source§

impl<A, MUT, const QUEUE_SIZE: usize> ActorContext<A, MUT, QUEUE_SIZE>
where A: Actor, MUT: RawMutex,

Source

pub const fn new() -> Self

Source

pub async fn mount(&'static self, actor: A) -> !

Mount the underlying actor and initialize the channel.

Source

pub fn dyn_address(&'static self) -> DynamicAddress<A::Message>

Source

pub fn address(&'static self) -> Address<A::Message, MUT, QUEUE_SIZE>

Trait Implementations§

Source§

impl<A, MUT, const QUEUE_SIZE: usize> Default for ActorContext<A, MUT, QUEUE_SIZE>
where A: Actor, MUT: RawMutex,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<A, MUT, const QUEUE_SIZE: usize> Sync for ActorContext<A, MUT, QUEUE_SIZE>
where A: Actor, MUT: RawMutex,

Auto Trait Implementations§

§

impl<A, MUT = NoopRawMutex, const QUEUE_SIZE: usize = 1> !Freeze for ActorContext<A, MUT, QUEUE_SIZE>

§

impl<A, MUT = NoopRawMutex, const QUEUE_SIZE: usize = 1> !RefUnwindSafe for ActorContext<A, MUT, QUEUE_SIZE>

§

impl<A, MUT, const QUEUE_SIZE: usize> Send for ActorContext<A, MUT, QUEUE_SIZE>
where MUT: Send, <A as Actor>::Message: Send,

§

impl<A, MUT, const QUEUE_SIZE: usize> Unpin for ActorContext<A, MUT, QUEUE_SIZE>
where MUT: Unpin, A: Unpin, <A as Actor>::Message: Unpin,

§

impl<A, MUT, const QUEUE_SIZE: usize> UnwindSafe for ActorContext<A, MUT, QUEUE_SIZE>
where MUT: UnwindSafe, A: UnwindSafe, <A as Actor>::Message: UnwindSafe,

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.