pub struct RandomConnectionIdGenerator { /* private fields */ }
Expand description
Generates purely random connection IDs of a specified length
Random CIDs can be smaller than those produced by HashedConnectionIdGenerator
, but cannot be
usefully validate
d.
Implementations§
Trait Implementations§
Source§impl Clone for RandomConnectionIdGenerator
impl Clone for RandomConnectionIdGenerator
Source§fn clone(&self) -> RandomConnectionIdGenerator
fn clone(&self) -> RandomConnectionIdGenerator
Returns a copy 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 ConnectionIdGenerator for RandomConnectionIdGenerator
impl ConnectionIdGenerator for RandomConnectionIdGenerator
Source§fn generate_cid(&mut self) -> ConnectionId
fn generate_cid(&mut self) -> ConnectionId
Generates a new CID Read more
Source§fn cid_lifetime(&self) -> Option<Duration>
fn cid_lifetime(&self) -> Option<Duration>
Returns the lifetime of generated Connection IDs Read more
Source§fn validate(&self, _cid: &ConnectionId) -> Result<(), InvalidCid>
fn validate(&self, _cid: &ConnectionId) -> Result<(), InvalidCid>
Quickly determine whether
cid
could have been generated by this generator Read moreSource§impl Debug for RandomConnectionIdGenerator
impl Debug for RandomConnectionIdGenerator
impl Copy for RandomConnectionIdGenerator
Auto Trait Implementations§
impl Freeze for RandomConnectionIdGenerator
impl RefUnwindSafe for RandomConnectionIdGenerator
impl Send for RandomConnectionIdGenerator
impl Sync for RandomConnectionIdGenerator
impl Unpin for RandomConnectionIdGenerator
impl UnwindSafe for RandomConnectionIdGenerator
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)