Struct tonari_actor::SpawnBuilder[][src]

#[must_use = "You must call .spawn() or .block_on() to run this actor"]pub struct SpawnBuilder<'a, A: Actor, F: FnOnce() -> A> { /* fields omitted */ }

A builder for specifying how to spawn an Actor. You can specify your own Addr for the Actor, the capacity of the Actor’s inbox, and you can specify whether to spawn the Actor into its own thread or block on the current calling thread.

Implementations

impl<'a, A: 'static + Actor, F: FnOnce() -> A> SpawnBuilder<'a, A, F>[src]

pub fn with_capacity(self, capacity: usize) -> Self[src]

Specify a capacity for the actor’s receiving channel.

pub fn with_addr(self, addr: Addr<A>) -> Self[src]

Specify an existing Addr to use with this Actor.

pub fn run_and_block(self) -> Result<(), ActorError>[src]

Run this Actor on the current calling thread. This is a blocking call. This function will exit when the Actor has stopped.

impl<'a, A: 'static + Actor, F: FnOnce() -> A + Send + 'static> SpawnBuilder<'a, A, F>[src]

pub fn spawn(self) -> Result<Addr<A>, ActorError>[src]

Spawn this Actor into a new thread managed by the System.

Auto Trait Implementations

impl<'a, A, F> !RefUnwindSafe for SpawnBuilder<'a, A, F>

impl<'a, A, F> Send for SpawnBuilder<'a, A, F> where
    F: Send

impl<'a, A, F> Sync for SpawnBuilder<'a, A, F> where
    F: Sync

impl<'a, A, F> Unpin for SpawnBuilder<'a, A, F> where
    F: Unpin,
    <A as Actor>::Message: Unpin

impl<'a, A, F> !UnwindSafe for SpawnBuilder<'a, A, F>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.