pub struct HoprKeyMapper<B> {
pub(crate) id_to_key: Cache<HoprKeyIdent, Option<OffchainPublicKey>, RandomState>,
pub(crate) key_to_id: Cache<OffchainPublicKey, Option<HoprKeyIdent>, RandomState>,
pub(crate) backend: Arc<B>,
}Fields§
§id_to_key: Cache<HoprKeyIdent, Option<OffchainPublicKey>, RandomState>§key_to_id: Cache<OffchainPublicKey, Option<HoprKeyIdent>, RandomState>§backend: Arc<B>Trait Implementations§
Source§impl<B> Clone for HoprKeyMapper<B>
impl<B> Clone for HoprKeyMapper<B>
Source§impl<B> KeyIdMapping<KeyIdent, OffchainPublicKey> for HoprKeyMapper<B>
impl<B> KeyIdMapping<KeyIdent, OffchainPublicKey> for HoprKeyMapper<B>
Source§fn map_key_to_id(&self, key: &OffchainPublicKey) -> Option<HoprKeyIdent>
fn map_key_to_id(&self, key: &OffchainPublicKey) -> Option<HoprKeyIdent>
Maps public key to its unique identifier.
Source§fn map_id_to_public(&self, id: &HoprKeyIdent) -> Option<OffchainPublicKey>
fn map_id_to_public(&self, id: &HoprKeyIdent) -> Option<OffchainPublicKey>
Maps public key identifier to the actual public key.
§fn map_keys_to_ids(&self, keys: &[K]) -> Vec<Option<Id>>
fn map_keys_to_ids(&self, keys: &[K]) -> Vec<Option<Id>>
Convenience method to map a slice of public keys to IDs.
§fn map_ids_to_keys(&self, ids: &[Id]) -> Vec<Option<K>>
fn map_ids_to_keys(&self, ids: &[Id]) -> Vec<Option<K>>
Convenience method to map a slice of IDs to public keys.
Auto Trait Implementations§
impl<B> Freeze for HoprKeyMapper<B>
impl<B> !RefUnwindSafe for HoprKeyMapper<B>
impl<B> Send for HoprKeyMapper<B>
impl<B> Sync for HoprKeyMapper<B>
impl<B> Unpin for HoprKeyMapper<B>
impl<B> !UnwindSafe for HoprKeyMapper<B>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more