pub struct Id(pub u64);
Tuple Fields§
§0: u64
Implementations§
source§impl Id
impl Id
sourcepub fn to_bytearray(self) -> [u8; 8]
pub fn to_bytearray(self) -> [u8; 8]
Convert to a byte array. Useful for indexedlog range query.
sourcepub fn to_prefixed_bytearray(self, prefix: u8) -> [u8; 9]
pub fn to_prefixed_bytearray(self, prefix: u8) -> [u8; 9]
Similar to to_bytearray
, but insert a prefix
at the head.
Useful for segment queries where level
is the prefix
.
pub const MAX: Id = Group::ALL[Group::COUNT - 1].max_id()
pub const MIN: Id = Group::ALL[0].min_id()
Trait Implementations§
source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Id, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Id, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl NotFoundError for Id
impl NotFoundError for Id
source§impl Ord for Id
impl Ord for Id
source§impl PartialOrd<Id> for Id
impl PartialOrd<Id> for Id
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Id
impl Serialize for Id
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Id
impl Eq for Id
impl StructuralEq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.