pub struct IdentityStateStore<S> { /* private fields */ }Expand description
Adapter-neutral persistence helper over the protocol’s scoped CAS store.
Implementations§
Source§impl<S> IdentityStateStore<S>
impl<S> IdentityStateStore<S>
Source§impl<S: StateStore> IdentityStateStore<S>
impl<S: StateStore> IdentityStateStore<S>
Sourcepub async fn read(
&self,
scope: &S::Scope,
key: &str,
) -> Result<IdentityStateSnapshot, IdentityError>
pub async fn read( &self, scope: &S::Scope, key: &str, ) -> Result<IdentityStateSnapshot, IdentityError>
scope must bind tenant, upstream and principal; keys must also bind
the conversation/invocation. A wire dialect is not an upstream identity.
Sourcepub async fn save(
&self,
scope: &S::Scope,
key: &str,
expected: Option<Version>,
record: &IdentityStateRecord,
expires_at: Option<SystemTime>,
) -> Result<Version, IdentityError>
pub async fn save( &self, scope: &S::Scope, key: &str, expected: Option<Version>, record: &IdentityStateRecord, expires_at: Option<SystemTime>, ) -> Result<Version, IdentityError>
Save a record with compare-and-exchange. expected = None creates a
fresh scope key; callers should perform this before exposing an alias.
Sourcepub async fn update_late(
&self,
scope: &S::Scope,
key: &str,
expected: Version,
facts: LateIdentityFacts,
) -> Result<IdentityStateSnapshot, IdentityError>
pub async fn update_late( &self, scope: &S::Scope, key: &str, expected: Version, facts: LateIdentityFacts, ) -> Result<IdentityStateSnapshot, IdentityError>
CAS update for source ids/signatures that arrive after an alias was emitted. Existing aliases remain untouched in the record.
Auto Trait Implementations§
impl<S> Freeze for IdentityStateStore<S>where
S: Freeze,
impl<S> RefUnwindSafe for IdentityStateStore<S>where
S: RefUnwindSafe,
impl<S> Send for IdentityStateStore<S>where
S: Send,
impl<S> Sync for IdentityStateStore<S>where
S: Sync,
impl<S> Unpin for IdentityStateStore<S>where
S: Unpin,
impl<S> UnsafeUnpin for IdentityStateStore<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for IdentityStateStore<S>where
S: UnwindSafe,
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