pub struct MemoryIdentityProvider { /* private fields */ }Expand description
An IdentityProvider that generates a random ephemeral identity on creation.
Useful for tests, examples, and consumers that don’t need persistent identity. The keypair lives only in memory and is lost when the provider is dropped.
use ap_client::MemoryIdentityProvider;
let identity = MemoryIdentityProvider::new();To wrap an existing keypair:
use ap_client::MemoryIdentityProvider;
use ap_proxy_protocol::IdentityKeyPair;
let keypair = IdentityKeyPair::generate();
let identity = MemoryIdentityProvider::from_keypair(keypair);Implementations§
Source§impl MemoryIdentityProvider
impl MemoryIdentityProvider
Sourcepub fn from_keypair(keypair: IdentityKeyPair) -> Self
pub fn from_keypair(keypair: IdentityKeyPair) -> Self
Wrap an existing keypair as an ephemeral identity provider.
Trait Implementations§
Source§impl Clone for MemoryIdentityProvider
impl Clone for MemoryIdentityProvider
Source§fn clone(&self) -> MemoryIdentityProvider
fn clone(&self) -> MemoryIdentityProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MemoryIdentityProvider
impl Default for MemoryIdentityProvider
Source§impl IdentityProvider for MemoryIdentityProvider
impl IdentityProvider for MemoryIdentityProvider
Source§fn identity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = IdentityKeyPair> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn identity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = IdentityKeyPair> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the identity keypair
Source§fn fingerprint<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = IdentityFingerprint> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fingerprint<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = IdentityFingerprint> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the fingerprint of this identity
Auto Trait Implementations§
impl Freeze for MemoryIdentityProvider
impl RefUnwindSafe for MemoryIdentityProvider
impl Send for MemoryIdentityProvider
impl Sync for MemoryIdentityProvider
impl Unpin for MemoryIdentityProvider
impl UnsafeUnpin for MemoryIdentityProvider
impl UnwindSafe for MemoryIdentityProvider
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