pub struct Spawn<'a, A, F>{ /* private fields */ }Available on crate feature
actor only.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>>) -> Spawn<'a, A, F>
pub fn with_name(self, name: impl Into<Cow<'static, str>>) -> Spawn<'a, A, F>
Registers the actor under name after startup succeeds.
Sourcepub fn with_capacity(self, capacity: NonZero<usize>) -> Spawn<'a, A, F>
pub fn with_capacity(self, capacity: NonZero<usize>) -> Spawn<'a, A, F>
Sets the actor’s bounded mailbox capacity.
Sourcepub fn with_supervisor<S>(self, supervisor: &Mailbox<S>) -> Spawn<'a, A, F>where
S: Handler<SupervisionEvent<A>>,
pub fn with_supervisor<S>(self, supervisor: &Mailbox<S>) -> Spawn<'a, A, F>where
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) -> <Spawn<'_, A, F> as IntoFuture>::IntoFuture
fn into_future(self) -> <Spawn<'_, A, F> as IntoFuture>::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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more