[][src]Struct statefun::Effects

pub struct Effects { /* fields omitted */ }

Effects (or side effects) of a stateful function invocation.

This can be used to:

  • send messages ourselves or other stateful functions
  • send messages to an egress
  • update the state of this stateful function, which will be available on future invocations

Implementations

impl Effects[src]

pub fn new() -> Effects[src]

Creates a new empty Effects.

pub fn send<M: Message>(&mut self, address: Address, message: M)[src]

Sends a message to the stateful function identified by the address.

pub fn send_after<M: Message>(
    &mut self,
    address: Address,
    delay: Duration,
    message: M
)
[src]

Sends a message to the stateful function identified by the address after a delay.

pub fn egress<M: Message>(&mut self, identifier: EgressIdentifier, message: M)[src]

Sends a message to the egress identifier by the EgressIdentifier.

pub fn delete_state(&mut self, name: &str)[src]

Deletes the state kept under the given name.

pub fn update_state<T: Message>(&mut self, name: &str, value: &T)[src]

Updates the state stored under the given name to the given value.

Trait Implementations

impl Debug for Effects[src]

impl Default for Effects[src]

impl KafkaEgress for Effects[src]

Auto Trait Implementations

impl RefUnwindSafe for Effects

impl Send for Effects

impl Sync for Effects

impl Unpin for Effects

impl UnwindSafe for Effects

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> From<T> for T[src]

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

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.