pub struct PeerCryptoMap<const N: usize> { /* private fields */ }Expand description
Fixed-capacity map of per-peer secure transport state.
Implementations§
Source§impl<const N: usize> PeerCryptoMap<N>
impl<const N: usize> PeerCryptoMap<N>
Sourcepub fn get(&self, id: &PeerId) -> Option<&PeerCryptoState>
pub fn get(&self, id: &PeerId) -> Option<&PeerCryptoState>
Borrow one peer state.
Sourcepub fn get_mut(&mut self, id: &PeerId) -> Option<&mut PeerCryptoState>
pub fn get_mut(&mut self, id: &PeerId) -> Option<&mut PeerCryptoState>
Mutably borrow one peer state.
Sourcepub fn insert(
&mut self,
id: PeerId,
state: PeerCryptoState,
) -> Result<Option<PeerCryptoState>, CapacityError>
pub fn insert( &mut self, id: PeerId, state: PeerCryptoState, ) -> Result<Option<PeerCryptoState>, CapacityError>
Insert or replace state for a peer.
Sourcepub fn remove(&mut self, id: &PeerId) -> Option<PeerCryptoState>
pub fn remove(&mut self, id: &PeerId) -> Option<PeerCryptoState>
Remove state for a peer.
Trait Implementations§
Source§impl<const N: usize> Clone for PeerCryptoMap<N>
impl<const N: usize> Clone for PeerCryptoMap<N>
Source§fn clone(&self) -> PeerCryptoMap<N>
fn clone(&self) -> PeerCryptoMap<N>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<const N: usize> Freeze for PeerCryptoMap<N>
impl<const N: usize> RefUnwindSafe for PeerCryptoMap<N>
impl<const N: usize> Send for PeerCryptoMap<N>
impl<const N: usize> Sync for PeerCryptoMap<N>
impl<const N: usize> Unpin for PeerCryptoMap<N>
impl<const N: usize> UnwindSafe for PeerCryptoMap<N>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)