pub struct InitializedActor<A: Actor> {
    pub address: Addr<A>,
    pub actor: A,
    /* private fields */
}
Available on crate feature worker only.
Expand description

Initialized actor. Mainly used to take address before starting it.

Fields§

§address: Addr<A>

Address of actor

§actor: A

Worker itself

Implementations§

Constructor.

Examples found in repository?
src/worker/mod.rs (line 377)
375
376
377
378
    fn preinit(self) -> InitializedActor<Self> {
        let mailbox_capacity = self.mailbox_capacity();
        InitializedActor::new(self, mailbox_capacity)
    }

Start Actor

Examples found in repository?
src/worker/mod.rs (line 390)
389
390
391
    async fn start(self) -> Addr<Self> {
        self.preinit().start().await
    }
More examples
Hide additional examples
src/worker/deadlock.rs (line 188)
185
186
187
188
189
190
static DEADLOCK_ACTOR: Lazy<Addr<DeadlockActor>> = Lazy::new(|| {
    let actor = DeadlockActor::preinit_default();
    let address = actor.address.clone();
    let _result = task::spawn(actor.start());
    address
});

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more