pub struct ChunkId(pub(crate) Tuid);
Expand description
A unique ID for a crate::Chunk
.
Chunk
s are the atomic unit of ingestion, transport, storage, events and GC in Rerun.
Internally, a crate::Chunk
is made up of rows, which are themselves uniquely identified by
their RowId
.
There is no relationship whatsoever between a ChunkId
and the RowId
s within that chunk.
§Uniqueness
ChunkId
are assumed unique within a single Recording.
The chunk store will treat two chunks with the same ChunkId
as the same, and only keep one
of them (which one is kept is an arbitrary and unstable implementation detail).
This makes it easy to build and maintain secondary indices around RowId
s with few to no
extraneous state tracking.
§Garbage collection
Garbage collection is handled at the chunk level by first ordering the chunks based on the minimum
RowId
present in each of them.
Garbage collection therefore happens (roughly) in the logger’s wall-clock order.
This has very important implications when inserting data far into the past or into the future:
think carefully about your RowId
s in these cases.
Tuple Fields§
§0: Tuid
Implementations§
source§impl ChunkId
impl ChunkId
pub const ZERO: ChunkId = _
pub const MAX: ChunkId = _
sourcepub fn next(&self) -> ChunkId
pub fn next(&self) -> ChunkId
Returns the next logical ChunkId
.
Beware: wrong usage can easily lead to conflicts.
Prefer ChunkId::new
when unsure.
sourcepub fn incremented_by(&self, n: u64) -> ChunkId
pub fn incremented_by(&self, n: u64) -> ChunkId
Returns the n
-next logical ChunkId
.
This is equivalent to calling ChunkId::next
n
times.
Wraps the monotonically increasing back to zero on overflow.
Beware: wrong usage can easily lead to conflicts.
Prefer ChunkId::new
when unsure.
sourcepub fn nanoseconds_since_epoch(&self) -> u64
pub fn nanoseconds_since_epoch(&self) -> u64
When the ChunkId
was created, in nanoseconds since unix epoch.
pub fn from_u128(id: u128) -> ChunkId
pub fn as_u128(&self) -> u128
Methods from Deref<Target = 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.
pub const ZERO: Tuid = _
pub const MAX: 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 ChunkId
impl<'de> Deserialize<'de> for ChunkId
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ChunkId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ChunkId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Loggable for ChunkId
impl Loggable for ChunkId
type Name = ComponentName
source§fn name() -> <ChunkId as Loggable>::Name
fn name() -> <ChunkId as Loggable>::Name
rerun.datatypes.Vec2D
.source§fn arrow_datatype() -> DataType
fn arrow_datatype() -> DataType
arrow2::datatypes::DataType
, excluding datatype extensions.source§fn to_arrow_opt<'a>(
values: impl IntoIterator<Item = Option<impl Into<Cow<'a, ChunkId>>>>
) -> Result<Box<dyn Array>, SerializationError>where
ChunkId: 'a,
fn to_arrow_opt<'a>(
values: impl IntoIterator<Item = Option<impl Into<Cow<'a, ChunkId>>>>
) -> Result<Box<dyn Array>, SerializationError>where
ChunkId: 'a,
source§fn to_arrow<'a>(
values: impl IntoIterator<Item = impl Into<Cow<'a, ChunkId>>>
) -> Result<Box<dyn Array>, SerializationError>
fn to_arrow<'a>( values: impl IntoIterator<Item = impl Into<Cow<'a, ChunkId>>> ) -> Result<Box<dyn Array>, SerializationError>
source§fn from_arrow(
array: &(dyn Array + 'static)
) -> Result<Vec<ChunkId>, DeserializationError>
fn from_arrow( array: &(dyn Array + 'static) ) -> Result<Vec<ChunkId>, DeserializationError>
Loggable
s.source§fn from_arrow_opt(
data: &(dyn Array + 'static)
) -> Result<Vec<Option<Self>>, DeserializationError>
fn from_arrow_opt( data: &(dyn Array + 'static) ) -> Result<Vec<Option<Self>>, DeserializationError>
Loggable
s.source§impl Ord for ChunkId
impl Ord for ChunkId
source§impl PartialEq for ChunkId
impl PartialEq for ChunkId
source§impl PartialOrd for ChunkId
impl PartialOrd for ChunkId
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 ChunkId
impl Serialize for ChunkId
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 ChunkId
impl SizeBytes for ChunkId
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 ChunkId
impl Eq for ChunkId
impl StructuralPartialEq for ChunkId
Auto Trait Implementations§
impl Freeze for ChunkId
impl RefUnwindSafe for ChunkId
impl Send for ChunkId
impl Sync for ChunkId
impl Unpin for ChunkId
impl UnwindSafe for ChunkId
Blanket Implementations§
source§impl<C> AsComponents for Cwhere
C: Component,
impl<C> AsComponents for Cwhere
C: Component,
source§fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>
ComponentBatch
s. Read moresource§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
source§impl<C> ComponentBatch for Cwhere
C: Component,
impl<C> ComponentBatch for Cwhere
C: Component,
source§fn to_arrow_list_array(&self) -> Result<ListArray<i32>, SerializationError>
fn to_arrow_list_array(&self) -> Result<ListArray<i32>, SerializationError>
§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
§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 more