pub struct Tuid { /* private fields */ }Implementations§
Source§impl Tuid
impl Tuid
Sourcepub fn heap_size_bytes(&self) -> u64
pub fn heap_size_bytes(&self) -> u64
Returns the total size of self on the heap, in bytes.
NOTE: This crate cannot depend on re_types_core, therefore the actual implementation of
SizeBytes for Tuid lives in re_types_core and calls this method.
Source§impl Tuid
impl Tuid
Sourcepub fn from_nanos_and_inc(time_ns: u64, inc: u64) -> Self
pub fn from_nanos_and_inc(time_ns: u64, inc: u64) -> Self
Construct a Tuid from the upper and lower halves of a u128-bit.
The first should be nano-seconds since epoch.
pub fn from_u128(id: u128) -> Self
pub fn as_u128(&self) -> u128
Sourcepub fn nanoseconds_since_epoch(&self) -> u64
pub fn nanoseconds_since_epoch(&self) -> u64
Approximate nanoseconds since unix epoch.
The upper 64 bits of the Tuid.
Sourcepub fn incremented_by(&self, n: u64) -> Self
pub fn incremented_by(&self, n: u64) -> Self
Returns the n-next logical Tuid.
This is equivalent to calling Tuid::next n times.
Wraps the monotonically increasing back to zero on overflow.
Beware: wrong usage can easily lead to conflicts.
Prefer Tuid::new when unsure.
Sourcepub fn short_string(&self) -> String
pub fn short_string(&self) -> String
A shortened string representation of the Tuid.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tuid
impl<'de> Deserialize<'de> for Tuid
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 Tuid
impl Ord for Tuid
Source§impl PartialOrd for Tuid
impl PartialOrd for Tuid
impl Copy for Tuid
impl Eq for Tuid
impl StructuralPartialEq for Tuid
Auto Trait Implementations§
impl Freeze for Tuid
impl RefUnwindSafe for Tuid
impl Send for Tuid
impl Sync for Tuid
impl Unpin for Tuid
impl UnwindSafe for Tuid
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