pub struct Id { /* private fields */ }Expand description
The Id is an identifier for an entity or part of an entity
Implementations§
Source§impl Id
impl Id
Sourcepub fn hex_to_buf<'a>(&self, buf: &'a mut [u8]) -> &'a mut str
pub fn hex_to_buf<'a>(&self, buf: &'a mut [u8]) -> &'a mut str
Write ourselves to the out in hexadecimal notation, returning the
hex-string ready for display.
§Panics
If the buffer isn’t big enough to hold twice as many bytes as stored (32
- 2).
Sourcepub fn shorten(&self) -> IdPrefix
pub fn shorten(&self) -> IdPrefix
Shorten an Id to the required length, so that it stays unique, but
is still short enough for human consumption.
Sourcepub fn combine_with(self, other: Id) -> CombinedId
pub fn combine_with(self, other: Id) -> CombinedId
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Id
impl Ord for Id
Source§impl PartialOrd for Id
impl PartialOrd for Id
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.