pub struct EffectKey {
pub name: EffectName,
pub key: LogicalKey,
}Expand description
The unique identity of a logical effect: (name, logical key).
Stores enforce that at most one record exists per EffectKey.
Fields§
§name: EffectNameThe effect type.
key: LogicalKeyThe logical occurrence.
Implementations§
Source§impl EffectKey
impl EffectKey
Sourcepub const fn new(name: EffectName, key: LogicalKey) -> EffectKey
pub const fn new(name: EffectName, key: LogicalKey) -> EffectKey
Pairs a name with a logical key.
Sourcepub fn idempotency_key(&self) -> IdempotencyKey
pub fn idempotency_key(&self) -> IdempotencyKey
The idempotency key to forward to remote systems.
Derived deterministically (a version 5 UUID) from the name and logical key, so every attempt of the same logical effect sends the same value, even if its record is lost and recreated.
Sourcepub fn compensation_idempotency_key(&self) -> IdempotencyKey
pub fn compensation_idempotency_key(&self) -> IdempotencyKey
The idempotency key for undoing the effect, distinct from
Self::idempotency_key so a remote system never confuses the undo
with a replay of the original request. Stable across compensation
attempts, which is what makes re-running a compensation safe.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EffectKey
impl<'de> Deserialize<'de> for EffectKey
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EffectKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EffectKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EffectKey
Source§impl Ord for EffectKey
impl Ord for EffectKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for EffectKey
impl PartialOrd for EffectKey
Source§impl Serialize for EffectKey
impl Serialize for EffectKey
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 EffectKey
Auto Trait Implementations§
impl Freeze for EffectKey
impl RefUnwindSafe for EffectKey
impl Send for EffectKey
impl Sync for EffectKey
impl Unpin for EffectKey
impl UnsafeUnpin for EffectKey
impl UnwindSafe for EffectKey
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