pub struct InvalidationSaga {
pub unit_id: String,
pub targets: Vec<InvalidationTarget>,
/* private fields */
}Expand description
Cross-partition best-effort invalidation fan-out unit.
Fields§
§unit_id: StringStable outbox unit id.
targets: Vec<InvalidationTarget>Fan-out targets.
Implementations§
Source§impl InvalidationSaga
impl InvalidationSaga
Sourcepub fn new(unit_id: impl Into<String>, targets: Vec<InvalidationTarget>) -> Self
pub fn new(unit_id: impl Into<String>, targets: Vec<InvalidationTarget>) -> Self
Create a saga.
Sourcepub fn dispatch_target(&mut self, target: &InvalidationTarget) -> bool
pub fn dispatch_target(&mut self, target: &InvalidationTarget) -> bool
Dispatch one target idempotently. Returns true only for the first effect.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Return whether every target has been applied.
Sourcepub fn idempotency_key(&self, target: &InvalidationTarget) -> String
pub fn idempotency_key(&self, target: &InvalidationTarget) -> String
Return the stable idempotency key for a target.
Trait Implementations§
Source§impl Clone for InvalidationSaga
impl Clone for InvalidationSaga
Source§fn clone(&self) -> InvalidationSaga
fn clone(&self) -> InvalidationSaga
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 moreSource§impl Debug for InvalidationSaga
impl Debug for InvalidationSaga
Source§impl<'de> Deserialize<'de> for InvalidationSaga
impl<'de> Deserialize<'de> for InvalidationSaga
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for InvalidationSaga
Source§impl PartialEq for InvalidationSaga
impl PartialEq for InvalidationSaga
Source§fn eq(&self, other: &InvalidationSaga) -> bool
fn eq(&self, other: &InvalidationSaga) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for InvalidationSaga
impl Serialize for InvalidationSaga
impl StructuralPartialEq for InvalidationSaga
Auto Trait Implementations§
impl Freeze for InvalidationSaga
impl RefUnwindSafe for InvalidationSaga
impl Send for InvalidationSaga
impl Sync for InvalidationSaga
impl Unpin for InvalidationSaga
impl UnsafeUnpin for InvalidationSaga
impl UnwindSafe for InvalidationSaga
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.