pub struct StubKeyIdMapper {
pub(crate) map: Arc<BiMap<OffchainPublicKey, HoprKeyIdent>>,
}Expand description
Bidirectional mapping between [HoprKeyIdent] and [OffchainPublicKey].
Extracted from the test helper in transport/path/src/planner.rs.
Fields§
§map: Arc<BiMap<OffchainPublicKey, HoprKeyIdent>>Trait Implementations§
Source§impl Clone for StubKeyIdMapper
impl Clone for StubKeyIdMapper
Source§fn clone(&self) -> StubKeyIdMapper
fn clone(&self) -> StubKeyIdMapper
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 KeyIdMapping<KeyIdent, OffchainPublicKey> for StubKeyIdMapper
impl KeyIdMapping<KeyIdent, OffchainPublicKey> for StubKeyIdMapper
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 Freeze for StubKeyIdMapper
impl RefUnwindSafe for StubKeyIdMapper
impl Send for StubKeyIdMapper
impl Sync for StubKeyIdMapper
impl Unpin for StubKeyIdMapper
impl UnwindSafe for StubKeyIdMapper
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