Skip to main content

IdentityFlow

Struct IdentityFlow 

Source
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

Source

pub fn new(namespace: IdNamespace) -> Self

Source

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.

Source

pub fn namespace(&self) -> IdNamespace

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn lookup_source( &self, source: &SourceIdentity, role: IdentityRole, ) -> Option<IdentityHandle>

Source

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.

Source

pub fn lookup_emitted(&self, emitted_id: &str) -> Option<IdentityHandle>

Source

pub fn lookup_emitted_as( &self, role: IdentityRole, emitted_id: &str, ) -> Option<IdentityHandle>

Source

pub fn lookup_client_id(&self, client_id: &str) -> Option<IdentityHandle>

Source

pub fn lookup_native( &self, source: &SourceIdentity, role: IdentityRole, ) -> Option<IdentityHandle>

Trait Implementations§

Source§

impl Clone for IdentityFlow

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IdentityFlow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ResourceSend for T
where T: Send + ?Sized,

Source§

impl<T> ResourceSync for T
where T: Sync + ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.