pub struct VersionStamp(/* private fields */);
Expand description
Versionstamp is a 10-byte array used to identify a specific version of a key. The first 8 bytes are significant (the u64), and the remaining 2 bytes are not significant, but used for extra precision. To convert to and from this module, see the conv module in this same directory.
You’re going to want these 65536 131072 196608 262144 327680 393216
Implementations§
Source§impl VersionStamp
impl VersionStamp
pub const ZERO: VersionStamp
pub const fn from_u64(v: u64) -> Self
pub const fn from_u64_u16(v: u64, v2: u16) -> Self
pub const fn try_from_u128(v: u128) -> Result<Self, VersionStampError>
Sourcepub const fn into_u64_u16(self) -> (u64, u16)
pub const fn into_u64_u16(self) -> (u64, u16)
Convert the VersionStamp into a u64 ignoring the 2 normally zero bytes.
Sourcepub const fn into_u64_lossy(self) -> u64
pub const fn into_u64_lossy(self) -> u64
Convert the VersionStamp into a u64 ignoring the 2 normally zero bytes.
pub const fn try_into_u64(self) -> Result<u64, VersionStampError>
pub const fn into_u128(self) -> u128
pub const fn as_bytes(self) -> [u8; 10]
pub const fn from_bytes(bytes: [u8; 10]) -> Self
pub const fn from_slice(slice: &[u8]) -> Result<Self, VersionStampError>
pub fn next(self) -> Option<Self>
Sourcepub fn iter(self) -> VersionStampIter ⓘ
pub fn iter(self) -> VersionStampIter ⓘ
Returns an iterator of version stamps starting with the current version stamp.
Trait Implementations§
Source§impl Clone for VersionStamp
impl Clone for VersionStamp
Source§fn clone(&self) -> VersionStamp
fn clone(&self) -> VersionStamp
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 Debug for VersionStamp
impl Debug for VersionStamp
Source§impl Default for VersionStamp
impl Default for VersionStamp
Source§impl<'de> Deserialize<'de> for VersionStamp
impl<'de> Deserialize<'de> for VersionStamp
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 Hash for VersionStamp
impl Hash for VersionStamp
Source§impl PartialEq for VersionStamp
impl PartialEq for VersionStamp
Source§impl PartialOrd for VersionStamp
impl PartialOrd for VersionStamp
Source§impl Revisioned for VersionStamp
impl Revisioned for VersionStamp
Source§impl Serialize for VersionStamp
impl Serialize for VersionStamp
impl Copy for VersionStamp
impl Eq for VersionStamp
impl StructuralPartialEq for VersionStamp
Auto Trait Implementations§
impl Freeze for VersionStamp
impl RefUnwindSafe for VersionStamp
impl Send for VersionStamp
impl Sync for VersionStamp
impl Unpin for VersionStamp
impl UnwindSafe for VersionStamp
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> Equivalent<K> for Q
impl<Q, K> Equivalent<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.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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more