Struct actix_rt::Arbiter[][src]

pub struct Arbiter { /* fields omitted */ }
Expand description

Arbiters provide an asynchronous execution environment for actors, functions and futures. When an Arbiter is created, it spawns a new OS thread, and hosts an event loop. Some Arbiter functions execute on the current thread.

Implementations

Returns the current thread’s arbiter’s address. If no Arbiter is present, then this function will panic!

Check if current arbiter is running.

Stop arbiter from continuing it’s event loop.

Spawn new thread and run event loop in spawned thread. Returns address of newly created arbiter.

Spawn a future on the current thread. This does not create a new Arbiter or Arbiter address, it is simply a helper for spawning futures on the current thread.

Executes a future on the current thread. This does not create a new Arbiter or Arbiter address, it is simply a helper for executing futures on the current thread.

Send a future to the Arbiter’s thread, and spawn it.

Send a function to the Arbiter’s thread, and execute it. Any result from the function is discarded.

Send a function to the Arbiter’s thread. This function will be executed asynchronously. A future is created, and when resolved will contain the result of the function sent to the Arbiters thread.

Set item to arbiter storage

Check if arbiter storage contains item

Get a reference to a type previously inserted on this arbiter’s storage.

Panics is item is not inserted

Get a mutable reference to a type previously inserted on this arbiter’s storage.

Panics is item is not inserted

Wait for the event loop to stop by joining the underlying thread (if have Some).

Returns a future that will be completed once all currently spawned futures have completed.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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.