Outcome

Enum Outcome 

Source
#[non_exhaustive]
pub enum Outcome<T> { Unicast(T), GentleUnicast(T), Multicast(Vec<T>), GentleMulticast(Vec<T>), Broadcast, Discard, Default, }
Expand description

Specifies which actors will get a message.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unicast(T)

Routes a message to an actor with the specified key. If there is no active or restarting actor for this key, it will be started.

§

GentleUnicast(T)

Routes a message to an actor with the specified key. If there is no active or restarting actor for this key, the message will be discarded, no actors are started.

§

Multicast(Vec<T>)

Routes a message to all actors with specified keys. If there is no active or restarting actors for these keys, they will be started.

§

GentleMulticast(Vec<T>)

Routes a message to all actors with specified keys. If there is no active or restarting actors for these keys, the message will be descarded, no actors are started.

§

Broadcast

Routes a message to all active actors.

§

Discard

Discards a message. If a message is discarded by everyone, the sending side gets an error.

§

Default

Acts as Broadcast for system messages and Discard otherwise.

Implementations§

Source§

impl<T> Outcome<T>

Source

pub fn map<U>(self, f: impl FnMut(T) -> U) -> Outcome<U>

Transforms Unicast and Multicast variants.

Source

pub fn or(self, outcome: Outcome<T>) -> Self

Replaces the Default variant with the provided one.

Trait Implementations§

Source§

impl<T: Debug> Debug for Outcome<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Outcome<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Outcome<T>
where T: RefUnwindSafe,

§

impl<T> Send for Outcome<T>
where T: Send,

§

impl<T> Sync for Outcome<T>
where T: Sync,

§

impl<T> Unpin for Outcome<T>
where T: Unpin,

§

impl<T> UnwindSafe for Outcome<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more