pub struct IdentityFlow { /* private fields */ }Expand description
Flow-local identity map. It must be created for each invocation; it does not contain process-global state or random number generation.
Implementations§
Source§impl IdentityFlow
impl IdentityFlow
pub fn new(namespace: IdNamespace) -> Self
Sourcepub fn handles(&self) -> impl Iterator<Item = IdentityHandle> + '_
pub fn handles(&self) -> impl Iterator<Item = IdentityHandle> + '_
Current associations, including source IDs learned after first emission. Iterator order is unspecified; persistence callers must sort their keys.
pub fn namespace(&self) -> IdNamespace
Sourcepub fn resolve_or_allocate(
&mut self,
role: IdentityRole,
source: SourceIdentity,
target: &TargetIdPolicy,
) -> Result<IdentityHandle, IdentityError>
pub fn resolve_or_allocate( &mut self, role: IdentityRole, source: SourceIdentity, target: &TargetIdPolicy, ) -> Result<IdentityHandle, IdentityError>
Resolve an identity whose semantic role is unchanged across the edge.
Sourcepub fn resolve_as(
&mut self,
source_role: IdentityRole,
role: IdentityRole,
source: SourceIdentity,
target: &TargetIdPolicy,
) -> Result<IdentityHandle, IdentityError>
pub fn resolve_as( &mut self, source_role: IdentityRole, role: IdentityRole, source: SourceIdentity, target: &TargetIdPolicy, ) -> Result<IdentityHandle, IdentityError>
Re-identify across semantic roles. A call id is not reused as an output item id even when both destinations accept arbitrary string identifiers.
Sourcepub fn resolve_legacy_chat_call(
&mut self,
source: SourceIdentity,
target: &TargetIdPolicy,
) -> Result<IdentityHandle, IdentityError>
pub fn resolve_legacy_chat_call( &mut self, source: SourceIdentity, target: &TargetIdPolicy, ) -> Result<IdentityHandle, IdentityError>
Resolve a legacy Chat function_call. It has no ID, and its client
alias says so, so a later turn to a Chat upstream sends it back in the
legacy form rather than as a modern call.
Sourcepub fn resolve_or_allocate_avoiding(
&mut self,
role: IdentityRole,
source: SourceIdentity,
target: &TargetIdPolicy,
avoid: &BTreeSet<String>,
) -> Result<IdentityHandle, IdentityError>
pub fn resolve_or_allocate_avoiding( &mut self, role: IdentityRole, source: SourceIdentity, target: &TargetIdPolicy, avoid: &BTreeSet<String>, ) -> Result<IdentityHandle, IdentityError>
Like Self::resolve_or_allocate, but a new identity never takes an
ID in avoid: one another call of the same client response owns.
Sourcepub fn attach_source(
&mut self,
handle: &IdentityHandle,
source_id: impl Into<String>,
) -> Result<IdentityHandle, IdentityError>
pub fn attach_source( &mut self, handle: &IdentityHandle, source_id: impl Into<String>, ) -> Result<IdentityHandle, IdentityError>
Attach a source id that arrived after the emitted alias was sent. The returned alias is always the original immutable alias.
pub fn lookup_source( &self, source: &SourceIdentity, role: IdentityRole, ) -> Option<IdentityHandle>
Sourcepub fn lookup_logical(
&self,
role: IdentityRole,
dialect: &DialectId,
logical_index: u64,
) -> Option<IdentityHandle>
pub fn lookup_logical( &self, role: IdentityRole, dialect: &DialectId, logical_index: u64, ) -> Option<IdentityHandle>
Look up an entry when a stream event has no source id yet.