pub struct IdentityStore { /* private fields */ }Expand description
Finds or creates identities. Everything is kept in the vault.
Implementations§
Source§impl IdentityStore
impl IdentityStore
pub fn new(vault: Arc<dyn KeyVault>) -> Self
pub fn vault(&self) -> &dyn KeyVault
Sourcepub fn resolve(
&self,
session_id: &str,
tier: BackendKind,
server_ref: &str,
) -> Result<SessionIdentity>
pub fn resolve( &self, session_id: &str, tier: BackendKind, server_ref: &str, ) -> Result<SessionIdentity>
The identity of session_id for tier on server_ref: loaded when it exists (and then it
must match tier and server), generated (new key pair, kept in the vault) when it does not.
pub fn save(&self, id: &SessionIdentity) -> Result<()>
Sourcepub fn bind_local(&self, id: &mut SessionIdentity, local_id: &str) -> Result<()>
pub fn bind_local(&self, id: &mut SessionIdentity, local_id: &str) -> Result<()>
Links the session to its tier-1 session id. One session has one local id and one local id belongs to one session; a second, different link is an error (never a quiet overwrite).
Sourcepub fn adopt_nick(&self, id: &mut SessionIdentity, nick: &str) -> Result<()>
pub fn adopt_nick(&self, id: &mut SessionIdentity, nick: &str) -> Result<()>
Records the nick the operator assigned. It is frozen after the first call: a different nick for the same identity is an error, the only way to another nick is a new identity.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for IdentityStore
impl !UnwindSafe for IdentityStore
impl Freeze for IdentityStore
impl Send for IdentityStore
impl Sync for IdentityStore
impl Unpin for IdentityStore
impl UnsafeUnpin for IdentityStore
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