[−][src]Struct statefun::Effects
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]
&mut self,
address: Address,
delay: Duration,
message: M
)
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]
fn kafka_egress<M: Message>(
&mut self,
identifier: EgressIdentifier,
topic: &str,
message: M
)
[src]
&mut self,
identifier: EgressIdentifier,
topic: &str,
message: M
)
fn kafka_keyed_egress<M: Message>(
&mut self,
identifier: EgressIdentifier,
topic: &str,
key: &str,
message: M
)
[src]
&mut self,
identifier: EgressIdentifier,
topic: &str,
key: &str,
message: M
)
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,