pub struct Spawn<'a, A, F>{ /* private fields */ }Expand description
A configurable actor spawn operation.
Returned by Cluster::spawn.
Implementations§
Source§impl<'a, A, F> Spawn<'a, A, F>
impl<'a, A, F> Spawn<'a, A, F>
Sourcepub fn with_name(self, name: impl Into<Cow<'static, str>>) -> Self
pub fn with_name(self, name: impl Into<Cow<'static, str>>) -> Self
Registers the actor under name after startup succeeds.
Sourcepub fn with_capacity(self, capacity: NonZeroUsize) -> Self
pub fn with_capacity(self, capacity: NonZeroUsize) -> Self
Sets the actor’s bounded mailbox capacity.
Sourcepub fn with_supervisor<S>(self, supervisor: &Mailbox<S>) -> Selfwhere
S: Handler<SupervisionEvent<A>>,
pub fn with_supervisor<S>(self, supervisor: &Mailbox<S>) -> Selfwhere
S: Handler<SupervisionEvent<A>>,
Sends actor lifecycle events to supervisor.
Trait Implementations§
Source§impl<A, F> IntoFuture for Spawn<'_, A, F>
impl<A, F> IntoFuture for Spawn<'_, A, F>
Source§type IntoFuture = SpawnFuture<A>
type IntoFuture = SpawnFuture<A>
Which kind of future are we turning this into?
Source§type Output = Result<(Mailbox<A>, ActorHandle<<A as Actor>::Error>), SpawnError<<A as Actor>::Error>>
type Output = Result<(Mailbox<A>, ActorHandle<<A as Actor>::Error>), SpawnError<<A as Actor>::Error>>
The output that the future will produce on completion.
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'a, A, F> !RefUnwindSafe for Spawn<'a, A, F>
impl<'a, A, F> !UnwindSafe for Spawn<'a, A, F>
impl<'a, A, F> Freeze for Spawn<'a, A, F>
impl<'a, A, F> Send for Spawn<'a, A, F>
impl<'a, A, F> Sync for Spawn<'a, A, F>
impl<'a, A, F> Unpin for Spawn<'a, A, F>
impl<'a, A, F> UnsafeUnpin for Spawn<'a, A, F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more