pub struct BlockId<T: Copy + Hash + Eq> { /* private fields */ }Expand description
Represents a specific, deterministic two-way mapping between u64 values and opaque IDs.
For BlockId<char>, additional functionality is provided for mapping between u64s and
Strings.
Implementations§
Source§impl<T: Copy + Hash + Eq> BlockId<T>
impl<T: Copy + Hash + Eq> BlockId<T>
Source§impl BlockId<char>
For the special case of BlockId<char>, helper encoders/decoders that use strings
rather than vectors are provided.
impl BlockId<char>
For the special case of BlockId<char>, helper encoders/decoders that use strings
rather than vectors are provided.
Sourcepub fn encode_string(&self, v: u64) -> Option<String>
pub fn encode_string(&self, v: u64) -> Option<String>
Encode a u64 into an opaque string.
Sourcepub fn decode_string(&self, v: &str) -> Option<u64>
pub fn decode_string(&self, v: &str) -> Option<u64>
Decode a u64 from an opaque string.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for BlockId<T>
impl<T> RefUnwindSafe for BlockId<T>where
T: RefUnwindSafe,
impl<T> Send for BlockId<T>where
T: Send,
impl<T> Sync for BlockId<T>where
T: Sync,
impl<T> Unpin for BlockId<T>where
T: Unpin,
impl<T> UnwindSafe for BlockId<T>where
T: UnwindSafe,
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