pub struct Tuid {
pub(crate) time_ns: u64,
pub(crate) inc: u64,
}
Fields§
§time_ns: u64
§inc: u64
Implementations§
source§impl Tuid
impl Tuid
sourcepub const NAME: &'static str = "rerun.datatypes.TUID"
pub const NAME: &'static str = "rerun.datatypes.TUID"
We give an actual name to Tuid
, and inject that name into the Arrow datatype extensions,
as a hack so that we can compactly format them when printing Arrow data to the terminal.
Check out re_format_arrow
for context.
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) -> Tuid
pub fn from_nanos_and_inc(time_ns: u64, inc: u64) -> Tuid
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) -> Tuid
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) -> Tuid
pub fn incremented_by(&self, n: u64) -> Tuid
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<Tuid, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Tuid, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Loggable for Tuid
impl Loggable for Tuid
source§fn arrow2_datatype() -> DataType
fn arrow2_datatype() -> DataType
arrow2::datatypes::DataType
, excluding datatype extensions.source§fn to_arrow2_opt<'a>(
_data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Tuid>>>>,
) -> Result<Box<dyn Array>, SerializationError>where
Tuid: 'a,
fn to_arrow2_opt<'a>(
_data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Tuid>>>>,
) -> Result<Box<dyn Array>, SerializationError>where
Tuid: 'a,
source§fn to_arrow2<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Tuid>>>,
) -> Result<Box<dyn Array>, SerializationError>where
Tuid: 'a,
fn to_arrow2<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Tuid>>>,
) -> Result<Box<dyn Array>, SerializationError>where
Tuid: 'a,
source§fn from_arrow2(
array: &(dyn Array + 'static),
) -> Result<Vec<Tuid>, DeserializationError>
fn from_arrow2( array: &(dyn Array + 'static), ) -> Result<Vec<Tuid>, DeserializationError>
Loggable
s.source§fn arrow_datatype() -> DataType
fn arrow_datatype() -> DataType
arrow::datatypes::DataType
, excluding datatype extensions.source§fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>,
) -> Result<Arc<dyn Array>, SerializationError>where
Self: 'a,
fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>,
) -> Result<Arc<dyn Array>, SerializationError>where
Self: 'a,
source§fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>,
) -> Result<Arc<dyn Array>, SerializationError>where
Self: 'a,
fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>,
) -> Result<Arc<dyn Array>, SerializationError>where
Self: 'a,
source§fn from_arrow(data: &dyn Array) -> Result<Vec<Self>, DeserializationError>
fn from_arrow(data: &dyn Array) -> Result<Vec<Self>, DeserializationError>
Loggable
s.source§fn from_arrow_opt(
data: &dyn Array,
) -> Result<Vec<Option<Self>>, DeserializationError>
fn from_arrow_opt( data: &dyn Array, ) -> Result<Vec<Option<Self>>, DeserializationError>
Loggable
s.source§fn from_arrow2_opt(
data: &(dyn Array + 'static),
) -> Result<Vec<Option<Self>>, DeserializationError>
fn from_arrow2_opt( data: &(dyn Array + 'static), ) -> Result<Vec<Option<Self>>, DeserializationError>
Loggable
s.source§impl Ord for Tuid
impl Ord for Tuid
source§impl PartialEq for Tuid
impl PartialEq for Tuid
source§impl PartialOrd for Tuid
impl PartialOrd for Tuid
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Tuid
impl Serialize for Tuid
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,
source§impl SizeBytes for Tuid
impl SizeBytes for Tuid
source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
self
on the heap, in bytes.source§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self
in bytes, accounting for both stack and heap space.source§fn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
self
on the stack, in bytes. Read moreimpl 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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> ⓘ
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> ⓘ
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request