pub struct Effects { /* private fields */ }
Expand description
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§
Source§impl Effects
impl Effects
Sourcepub fn send<M: Message>(&mut self, address: Address, message: M)
pub fn send<M: Message>(&mut self, address: Address, message: M)
Sends a message to the stateful function identified by the address.
Sourcepub fn send_after<M: Message>(
&mut self,
address: Address,
delay: Duration,
message: M,
)
pub fn send_after<M: Message>( &mut self, address: Address, delay: Duration, message: M, )
Sends a message to the stateful function identified by the address after a delay.
Sourcepub fn egress<M: Message>(&mut self, identifier: EgressIdentifier, message: M)
pub fn egress<M: Message>(&mut self, identifier: EgressIdentifier, message: M)
Sends a message to the egress identifier by the EgressIdentifier
.
Sourcepub fn delete_state(&mut self, name: &str)
pub fn delete_state(&mut self, name: &str)
Deletes the state kept under the given name.
Sourcepub fn update_state<T: Message>(&mut self, name: &str, value: &T)
pub fn update_state<T: Message>(&mut self, name: &str, value: &T)
Updates the state stored under the given name to the given value.
Trait Implementations§
Source§impl KafkaEgress for Effects
impl KafkaEgress for Effects
Source§fn kafka_egress<M: Message>(
&mut self,
identifier: EgressIdentifier,
topic: &str,
message: M,
)
fn kafka_egress<M: Message>( &mut self, identifier: EgressIdentifier, topic: &str, message: M, )
Sends the given message to the Kafka topic
topic
via the egress specified using the
EgressIdentifier
.Source§fn kafka_keyed_egress<M: Message>(
&mut self,
identifier: EgressIdentifier,
topic: &str,
key: &str,
message: M,
)
fn kafka_keyed_egress<M: Message>( &mut self, identifier: EgressIdentifier, topic: &str, key: &str, message: M, )
Sends the given message to the Kafka topic
topic
via the egress specified using the
EgressIdentifier
. Read moreAuto Trait Implementations§
impl Freeze for Effects
impl RefUnwindSafe for Effects
impl Send for Effects
impl Sync for Effects
impl Unpin for Effects
impl UnwindSafe for Effects
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more