pub enum EffectKind {
Read,
IdempotentWrite,
ReversibleWrite,
IrreversibleWrite,
}Expand description
What re-executing an effect does to the outside world.
The kind decides how much the runtime may retry on its own (see
Capabilities::unknown_plan in agent-effects).
Variants§
Read
No externally visible mutation, e.g. fetching a balance.
IdempotentWrite
Repeating the same request leaves the same end state, e.g.
PUT /users/123.
ReversibleWrite
Changes external state, but a compensating operation exists, e.g. reserving inventory.
IrreversibleWrite
Changes external state and cannot be reliably undone, e.g. sending an email.
Implementations§
Source§impl EffectKind
impl EffectKind
Sourcepub const fn is_naturally_idempotent(self) -> bool
pub const fn is_naturally_idempotent(self) -> bool
Whether executing the same request twice is harmless on its own, without help from the remote system.
Sourcepub fn parse(s: &str) -> Option<EffectKind>
pub fn parse(s: &str) -> Option<EffectKind>
Parses the storage representation produced by Self::as_str.
Trait Implementations§
Source§impl Clone for EffectKind
impl Clone for EffectKind
Source§fn clone(&self) -> EffectKind
fn clone(&self) -> EffectKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EffectKind
Source§impl Debug for EffectKind
impl Debug for EffectKind
Source§impl<'de> Deserialize<'de> for EffectKind
impl<'de> Deserialize<'de> for EffectKind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EffectKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EffectKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EffectKind
Source§impl Hash for EffectKind
impl Hash for EffectKind
Source§impl PartialEq for EffectKind
impl PartialEq for EffectKind
Source§impl Serialize for EffectKind
impl Serialize for EffectKind
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for EffectKind
Auto Trait Implementations§
impl Freeze for EffectKind
impl RefUnwindSafe for EffectKind
impl Send for EffectKind
impl Sync for EffectKind
impl Unpin for EffectKind
impl UnsafeUnpin for EffectKind
impl UnwindSafe for EffectKind
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