Struct tonari_actor::SpawnBuilder [−][src]
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,
F: Send,
impl<'a, A, F> Sync for SpawnBuilder<'a, A, F> where
F: Sync,
F: Sync,
impl<'a, A, F> Unpin for SpawnBuilder<'a, A, F> where
F: Unpin,
<A as Actor>::Message: Unpin,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,