[][src]Struct maxim::actors::ActorBuilder

pub struct ActorBuilder {
    pub name: Option<String>,
    pub channel_size: Option<u16>,
    // some fields omitted
}

A builder that can be used to create and spawn an actor. To get a builder, the user would ask the actor system to create one using system.spawn() and then to spawn the actor by means of the the with method on the builder. See ActorSystem::spawn for more information.

Fields

name: Option<String>

The optional name of the actor which defaults to None meaning the actor will be unnamed.

channel_size: Option<u16>

The size of the message channel for the actor which defaults to None; meaning the default for the actor system will be used for the message channel.

Methods

impl ActorBuilder[src]

pub fn with<F, S, R>(self, state: S, processor: F) -> Result<Aid, SystemError> where
    S: Send + Sync + 'static,
    R: Future<Output = ActorResult<S>> + Send + 'static,
    F: Processor<S, R> + 'static, 
[src]

Completes the spawning of the the actor configured with this builder on the system, consuming the builder in the process and using the provided state and handler. See ActorSystem::spawn for more information and examples.

pub fn name(self, name: impl Into<String>) -> Self[src]

Set the name of the actor to the given string.

pub fn channel_size(self, size: u16) -> Self[src]

Set the size of the channel to the given value instead of the default for the actor system that the actor is spawned on. Note that passing a value less than 1 will cause a panic and there would be little reason to do so anyway.

Trait Implementations

impl Clone for ActorBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,