re_sdk::external::re_tuid

Struct Tuid

Source
#[repr(C, align(1))]
pub struct Tuid { pub(crate) time_nanos: [u8; 8], pub(crate) inc: [u8; 8], }
Expand description

TUID: Time-based Unique Identifier.

Time-ordered globally unique 128-bit identifiers.

The raw bytes of the Tuid sorts in time order as the Tuid itself, and the Tuid is byte-aligned so you can just transmute between Tuid and raw bytes.

Fields§

§time_nanos: [u8; 8]§inc: [u8; 8]

Implementations§

Source§

impl Tuid

Source

pub const ARROW_EXTENSION_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.

Source§

impl Tuid

Source

pub const ZERO: Tuid

All zeroes.

Source

pub const MAX: Tuid

All ones.

Source

pub fn new() -> Tuid

Create a new unique Tuid based on the current time.

Source

pub fn from_nanos_and_inc(time_nanos: 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.

Source

pub fn from_u128(id: u128) -> Tuid

Source

pub fn as_u128(&self) -> u128

Source

pub fn from_bytes(bytes: [u8; 16]) -> Tuid

Source

pub fn as_bytes(&self) -> [u8; 16]

Returns most significant byte first (big endian).

Source

pub fn nanos_since_epoch(&self) -> u64

Approximate nanoseconds since unix epoch.

The upper 64 bits of the Tuid.

Source

pub fn inc(&self) -> u64

The increment part of the Tuid.

The lower 64 bits of the Tuid.

Source

pub fn next(&self) -> Tuid

Returns the next logical Tuid.

Wraps the monotonically increasing back to zero on overflow.

Beware: wrong usage can easily lead to conflicts. Prefer Tuid::new when unsure.

Source

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.

Source

pub fn short_string(&self) -> String

A shortened string representation of the Tuid.

Trait Implementations§

Source§

impl Clone for Tuid

Source§

fn clone(&self) -> Tuid

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tuid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Tuid

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Tuid, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Tuid

Formats the Tuid as a hex string.

The format uses upper case for the first 16 hex digits, and lower case for the last 16 hex digits. This is to make it easily distinguished from other hex strings.

Example: 182342300C5F8C327a7b4a6e5a379ac4

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<Tuid> for EntryId

Source§

fn from(id: Tuid) -> EntryId

Converts to this type from the input type.
Source§

impl FromStr for Tuid

Source§

type Err = ParseIntError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Tuid, <Tuid as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for Tuid

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Loggable for Tuid

Source§

fn arrow_datatype() -> DataType

The underlying arrow::datatypes::DataType, excluding datatype extensions.
Source§

fn to_arrow_opt<'a>( _data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Tuid>>>>, ) -> Result<Arc<dyn Array>, SerializationError>
where Tuid: 'a,

Given an iterator of options of owned or reference values to the current Loggable, serializes them into an Arrow array. Read more
Source§

fn to_arrow<'a>( iter: impl IntoIterator<Item = impl Into<Cow<'a, Tuid>>>, ) -> Result<Arc<dyn Array>, SerializationError>
where Tuid: 'a,

Given an iterator of owned or reference values to the current Loggable, serializes them into an Arrow array. Read more
Source§

fn from_arrow(array: &dyn Array) -> Result<Vec<Tuid>, DeserializationError>

Given an Arrow array, deserializes it into a collection of Loggables.
Source§

fn arrow_empty() -> Arc<dyn Array>

Source§

fn from_arrow_opt( data: &dyn Array, ) -> Result<Vec<Option<Self>>, DeserializationError>

Given an Arrow array, deserializes it into a collection of optional Loggables.
Source§

fn verify_arrow_array(data: &dyn Array) -> Result<(), DeserializationError>

Verifies that the given Arrow array can be deserialized into a collection of Selfs. Read more
Source§

impl Ord for Tuid

Source§

fn cmp(&self, other: &Tuid) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Tuid

Source§

fn eq(&self, other: &Tuid) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Tuid

Source§

fn partial_cmp(&self, other: &Tuid) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Tuid

Source§

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
Source§

impl SizeBytes for Tuid

Source§

fn heap_size_bytes(&self) -> u64

Returns how many bytes self uses on the heap. Read more
Source§

fn total_size_bytes(&self) -> u64

Returns the total size of self in bytes, accounting for both stack and heap space.
Source§

fn stack_size_bytes(&self) -> u64

Returns the total size of self on the stack, in bytes. Read more
Source§

fn is_pod() -> bool

Is Self just plain old data? Read more
Source§

impl TryFrom<Tuid> for Tuid

Source§

type Error = TypeConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Tuid) -> Result<Tuid, <Tuid as TryFrom<Tuid>>::Error>

Performs the conversion.
Source§

impl Zeroable for Tuid

§

fn zeroed() -> Self

Source§

impl AnyBitPattern for Tuid

Source§

impl Copy for Tuid

Source§

impl Eq for Tuid

Source§

impl NoUninit for Tuid

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LoggableBatch for L
where L: Clone + Loggable,

Source§

fn to_arrow(&self) -> Result<Arc<dyn Array>, SerializationError>

Serializes the batch into an Arrow array.
Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> To for T
where T: ?Sized,

§

fn to<T>(self) -> T
where Self: Into<T>,

Converts to T by calling Into<T>::into.
§

fn try_to<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

Source§

impl<N> NodeTrait for N
where N: Copy + Ord + Hash,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + Serialize + for<'a> Deserialize<'a> + Send + Sync,

§

impl<T> Ungil for T
where T: Send,