Struct rerun::external::re_chunk_store::Chunk

source ·
pub struct Chunk {
    pub(crate) id: ChunkId,
    pub(crate) entity_path: EntityPath,
    pub(crate) heap_size_bytes: AtomicU64,
    pub(crate) is_sorted: bool,
    pub(crate) row_ids: StructArray,
    pub(crate) timelines: BTreeMap<Timeline, TimeColumn>,
    pub(crate) components: BTreeMap<ComponentName, ListArray<i32>>,
}
Expand description

Dense arrow-based storage of N rows of multi-component multi-temporal data for a specific entity.

This is our core datastructure for logging, storing, querying and transporting data around.

The chunk as a whole is always ascendingly sorted by RowId before it gets manipulated in any way. Its time columns might or might not be ascendingly sorted, depending on how the data was logged.

This is the in-memory representation of a chunk, optimized for efficient manipulation of the data within. For transport, see crate::TransportChunk instead.

Fields§

§id: ChunkId§entity_path: EntityPath§heap_size_bytes: AtomicU64§is_sorted: bool§row_ids: StructArray§timelines: BTreeMap<Timeline, TimeColumn>§components: BTreeMap<ComponentName, ListArray<i32>>

Implementations§

source§

impl Chunk

source

pub fn builder(entity_path: EntityPath) -> ChunkBuilder

Initializes a new ChunkBuilder.

source

pub fn builder_with_id(id: ChunkId, entity_path: EntityPath) -> ChunkBuilder

Initializes a new ChunkBuilder.

The final Chunk will have the specified id.

source§

impl Chunk

source

pub fn with_id(self, id: ChunkId) -> Chunk

Returns a version of us with a new ChunkId.

Reminder:

  • The returned Chunk will re-use the exact same RowIds as self.
  • Duplicated RowIds in the ChunkStore is undefined behavior.
source

pub fn are_similar(lhs: &Chunk, rhs: &Chunk) -> bool

Returns true is two Chunks are similar, although not byte-for-byte equal.

In particular, this ignores chunks and row IDs, as well as temporal timestamps.

Useful for tests.

source

pub fn are_equal_ignoring_extension_types(&self, other: &Chunk) -> bool

Check for equality while ignoring possible Extension type information

This is necessary because arrow2 loses the Extension datatype when deserializing back from the arrow_schema::DataType representation.

In theory we could fix this, but as we’re moving away from arrow2 anyways it’s unlikely worth the effort.

source§

impl Chunk

source

pub fn clone_as(&self, id: ChunkId, first_row_id: RowId) -> Chunk

Clones the chunk and assign new IDs to the resulting chunk and its rows.

first_row_id will become the RowId of the first row in the duplicated chunk. Each row after that will be monotonically increasing.

source

pub fn into_static(self) -> Chunk

Clones the chunk into a new chunk without any time data.

source

pub fn zeroed(self) -> Chunk

Clones the chunk into a new chunk where all RowIds are RowId::ZERO.

source

pub fn time_range_per_component( &self ) -> BTreeMap<Timeline, BTreeMap<ComponentName, ResolvedTimeRange>>

Computes the time range covered by each individual component column on each timeline.

This is different from the time range covered by the Chunk as a whole because component columns are potentially sparse.

This is crucial for indexing and queries to work properly.

source

pub fn num_events_cumulative(&self) -> u64

The cumulative number of events in this chunk.

I.e. how many component batches (“cells”) were logged in total?

source

pub fn num_events_cumulative_per_unique_time( &self, timeline: &Timeline ) -> Vec<(TimeInt, u64)>

The cumulative number of events in this chunk for each unique timestamp.

I.e. how many component batches (“cells”) were logged in total at each timestamp?

Keep in mind that a timestamp can appear multiple times in a Chunk. This method will do a sum accumulation to account for these cases (i.e. every timestamp in the returned vector is guaranteed to be unique).

source

pub fn num_events_for_component( &self, component_name: ComponentName ) -> Option<u64>

The number of events in this chunk for the specified component.

I.e. how many component batches (“cells”) were logged in total for this component?

source

pub fn row_id_range_per_component( &self ) -> BTreeMap<ComponentName, (RowId, RowId)>

Computes the RowId range covered by each individual component column on each timeline.

This is different from the RowId range covered by the Chunk as a whole because component columns are potentially sparse.

This is crucial for indexing and queries to work properly.

source§

impl Chunk

source

pub fn new( id: ChunkId, entity_path: EntityPath, is_sorted: Option<bool>, row_ids: StructArray, timelines: BTreeMap<Timeline, TimeColumn>, components: BTreeMap<ComponentName, ListArray<i32>> ) -> Result<Chunk, ChunkError>

Creates a new Chunk.

This will fail if the passed in data is malformed in any way – see Self::sanity_check for details.

Iff you know for sure whether the data is already appropriately sorted or not, specify is_sorted. When left unspecified (None), it will be computed in O(n) time.

For a row-oriented constructor, see Self::builder.

source

pub fn from_native_row_ids( id: ChunkId, entity_path: EntityPath, is_sorted: Option<bool>, row_ids: &[RowId], timelines: BTreeMap<Timeline, TimeColumn>, components: BTreeMap<ComponentName, ListArray<i32>> ) -> Result<Chunk, ChunkError>

Creates a new Chunk.

This will fail if the passed in data is malformed in any way – see Self::sanity_check for details.

Iff you know for sure whether the data is already appropriately sorted or not, specify is_sorted. When left unspecified (None), it will be computed in O(n) time.

For a row-oriented constructor, see Self::builder.

source

pub fn from_auto_row_ids( id: ChunkId, entity_path: EntityPath, timelines: BTreeMap<Timeline, TimeColumn>, components: BTreeMap<ComponentName, ListArray<i32>> ) -> Result<Chunk, ChunkError>

Creates a new Chunk.

This will fail if the passed in data is malformed in any way – see Self::sanity_check for details.

The data is assumed to be sorted in RowId-order. Sequential RowIds will be generated for each row in the chunk.

source

pub fn new_static( id: ChunkId, entity_path: EntityPath, is_sorted: Option<bool>, row_ids: StructArray, components: BTreeMap<ComponentName, ListArray<i32>> ) -> Result<Chunk, ChunkError>

Simple helper for Self::new for static data.

For a row-oriented constructor, see Self::builder.

source

pub fn empty(id: ChunkId, entity_path: EntityPath) -> Chunk

source

pub fn add_component( &mut self, component_name: ComponentName, list_array: ListArray<i32> ) -> Result<(), ChunkError>

Unconditionally inserts an ArrowListArray as a component column.

Removes and replaces the column if it already exists.

This will fail if the end result is malformed in any way – see Self::sanity_check.

source

pub fn add_timeline( &mut self, chunk_timeline: TimeColumn ) -> Result<(), ChunkError>

Unconditionally inserts a TimeColumn.

Removes and replaces the column if it already exists.

This will fail if the end result is malformed in any way – see Self::sanity_check.

source§

impl Chunk

source

pub fn id(&self) -> ChunkId

source

pub fn entity_path(&self) -> &EntityPath

source

pub fn num_columns(&self) -> usize

How many columns in total? Includes control, time, and component columns.

source

pub fn num_controls(&self) -> usize

source

pub fn num_timelines(&self) -> usize

source

pub fn num_components(&self) -> usize

source

pub fn num_rows(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn row_ids_array(&self) -> &StructArray

source

pub fn row_ids_raw(&self) -> (&PrimitiveArray<u64>, &PrimitiveArray<u64>)

Returns the RowIds in their raw-est form: a tuple of (times, counters) arrays.

source

pub fn row_ids(&self) -> impl Iterator<Item = RowId>

All the RowId in this chunk.

This could be in any order if this chunk is unsorted.

source

pub fn component_row_ids( &self, component_name: &ComponentName ) -> impl Iterator<Item = RowId>

Returns an iterator over the RowIds of a Chunk, for a given component.

This is different than Self::row_ids: it will only yield RowIds for rows at which there is data for the specified component_name.

source

pub fn row_id_range(&self) -> Option<(RowId, RowId)>

Returns the RowId-range covered by this Chunk.

None if the chunk is_empty.

This is O(1) if the chunk is sorted, O(n) otherwise.

source

pub fn is_static(&self) -> bool

source

pub fn timelines(&self) -> &BTreeMap<Timeline, TimeColumn>

source

pub fn component_names(&self) -> impl Iterator<Item = ComponentName>

source

pub fn components(&self) -> &BTreeMap<ComponentName, ListArray<i32>>

source

pub fn timepoint_max(&self) -> TimePoint

Computes the maximum value for each and every timeline present across this entire chunk, and returns the corresponding TimePoint.

source§

impl Chunk

source

pub fn sanity_check(&self) -> Result<(), ChunkError>

Returns an error if the Chunk’s invariants are not upheld.

Costly checks are only run in debug builds.

source§

impl Chunk

source

pub fn component_batch_raw( &self, component_name: &ComponentName, row_index: usize ) -> Option<Result<Box<dyn Array>, ChunkError>>

Returns the raw data for the specified component.

Returns an error if the row index is out of bounds.

source

pub fn component_batch<C>( &self, row_index: usize ) -> Option<Result<Vec<C>, ChunkError>>
where C: Component,

Returns the deserialized data for the specified component.

Returns an error if the data cannot be deserialized, or if the row index is out of bounds.

source

pub fn component_instance_raw( &self, component_name: &ComponentName, row_index: usize, instance_index: usize ) -> Option<Result<Box<dyn Array>, ChunkError>>

Returns the raw data for the specified component at the given instance index.

Returns an error if either the row index or instance index are out of bounds.

source

pub fn component_instance<C>( &self, row_index: usize, instance_index: usize ) -> Option<Result<C, ChunkError>>
where C: Component,

Returns the component data of the specified instance.

Returns an error if the data cannot be deserialized, or if either the row index or instance index are out of bounds.

source

pub fn component_mono_raw( &self, component_name: &ComponentName, row_index: usize ) -> Option<Result<Box<dyn Array>, ChunkError>>

Returns the raw data for the specified component, assuming a mono-batch.

Returns an error if either the row index is out of bounds, or the underlying batch is not of unit length.

source

pub fn component_mono<C>( &self, row_index: usize ) -> Option<Result<C, ChunkError>>
where C: Component,

Returns the deserialized data for the specified component, assuming a mono-batch.

Returns an error if the data cannot be deserialized, or if either the row index is out of bounds, or the underlying batch is not of unit length.

source§

impl Chunk

source

pub fn to_unit(self: &Arc<Chunk>) -> Option<UnitChunkShared>

Turns the chunk into a UnitChunkShared, if possible.

source

pub fn into_unit(self) -> Option<UnitChunkShared>

Turns the chunk into a UnitChunkShared, if possible.

source§

impl Chunk

source

pub fn iter_indices( &self, timeline: &Timeline ) -> impl Iterator<Item = (TimeInt, RowId)>

Returns an iterator over the indices ((TimeInt, RowId)) of a Chunk, for a given timeline.

If the chunk is static, timeline will be ignored.

See also:

source

pub fn iter_component_indices( &self, timeline: &Timeline, component_name: &ComponentName ) -> impl Iterator<Item = (TimeInt, RowId)>

Returns an iterator over the indices ((TimeInt, RowId)) of a Chunk, for a given timeline and component.

If the chunk is static, timeline will be ignored.

This is different than Self::iter_indices in that it will only yield indices for rows at which there is data for the specified component_name.

See also Self::iter_indices.

source

pub fn iter_timepoints(&self) -> impl Iterator<Item = TimePoint>

Returns an iterator over the TimePoints of a Chunk.

See also:

source

pub fn iter_component_timepoints( &self, component_name: &ComponentName ) -> impl Iterator<Item = TimePoint>

Returns an iterator over the TimePoints of a Chunk, for a given component.

This is different than Self::iter_timepoints in that it will only yield timepoints for rows at which there is data for the specified component_name.

See also Self::iter_timepoints.

source

pub fn iter_component_offsets( &self, component_name: &ComponentName ) -> impl Iterator<Item = (usize, usize)>

Returns an iterator over the offsets ((offset, len)) of a Chunk, for a given component.

I.e. each (offset, len) pair describes the position of a component batch in the underlying arrow array of values.

source

pub fn iter_component_arrays( &self, component_name: &ComponentName ) -> impl Iterator<Item = Box<dyn Array>>

source

pub fn iter_primitive<T>( &self, component_name: &ComponentName ) -> impl Iterator<Item = &[T]>
where T: NativeType,

Returns an iterator over the raw primitive values of a Chunk, for a given component.

This is a very fast path: the entire column will be downcasted at once, and then every component batch will be a slice reference into that global slice. Use this when working with simple arrow datatypes and performance matters (e.g. scalars, points, etc).

See also:

source

pub fn iter_primitive_array<const N: usize, T>( &self, component_name: &ComponentName ) -> impl Iterator<Item = &[[T; N]]>
where T: NativeType, [T; N]: Pod,

Returns an iterator over the raw primitive arrays of a Chunk, for a given component.

This is a very fast path: the entire column will be downcasted at once, and then every component batch will be a slice reference into that global slice. Use this when working with simple arrow datatypes and performance matters (e.g. scalars, points, etc).

See also:

source

pub fn iter_primitive_array_list<const N: usize, T>( &self, component_name: &ComponentName ) -> impl Iterator<Item = Vec<&[[T; N]]>>
where T: NativeType, [T; N]: Pod,

Returns an iterator over the raw list of primitive arrays of a Chunk, for a given component.

This is a very fast path: the entire column will be downcasted at once, and then every component batch will be a slice reference into that global slice. Use this when working with simple arrow datatypes and performance matters (e.g. strips, etc).

See also:

source

pub fn iter_string( &self, component_name: &ComponentName ) -> impl Iterator<Item = Vec<ArrowString>>

Returns an iterator over the raw strings of a Chunk, for a given component.

This is a very fast path: the entire column will be downcasted at once, and then every component batch will be a slice reference into that global slice. Use this when working with simple arrow datatypes and performance matters (e.g. labels, etc).

See also:

source

pub fn iter_buffer<T>( &self, component_name: &ComponentName ) -> impl Iterator<Item = Vec<ArrowBuffer<T>>>
where T: NativeType,

Returns an iterator over the raw buffers of a Chunk, for a given component.

This is a very fast path: the entire column will be downcasted at once, and then every component batch will be a slice reference into that global slice. Use this when working with simple arrow datatypes and performance matters (e.g. blobs, etc).

See also:

source§

impl Chunk

source

pub fn iter_indices_owned( self: Arc<Chunk>, timeline: &Timeline ) -> impl Iterator<Item = (TimeInt, RowId)>

Returns an iterator over the indices ((TimeInt, RowId)) of a Chunk, for a given timeline.

If the chunk is static, timeline will be ignored.

The returned iterator outlives self, thus it can be passed around freely. The tradeoff is that self must be an Arc.

See also Self::iter_indices.

source§

impl Chunk

source

pub fn iter_component<C>( &self ) -> ChunkComponentIter<C, impl Iterator<Item = (usize, usize)>>
where C: Component,

Returns an iterator over the deserialized batches of a Chunk, for a given component.

This is a dedicated fast path: the entire column will be downcasted and deserialized at once, and then every component batch will be a slice reference into that global slice. Use this when working with complex arrow datatypes and performance matters (e.g. ranging through enum types across many timestamps).

See also:

source§

impl Chunk

source

pub fn latest_at( &self, query: &LatestAtQuery, component_name: ComponentName ) -> Chunk

Runs a LatestAtQuery filter on a Chunk.

This behaves as a row-based filter: the result is a new Chunk that is vertically sliced to only contain the row relevant for the specified query.

The resulting Chunk is guaranteed to contain all the same columns has the queried chunk: there is no horizontal slicing going on.

An empty Chunk (i.e. 0 rows, but N columns) is returned if the query yields nothing.

Because the resulting chunk doesn’t discard any column information, you can find extra relevant information by inspecting the data, for examples timestamps on other timelines. See Self::timeline_sliced and Self::component_sliced if you do want to filter this extra data.

source§

impl Chunk

source

pub fn concatenated(&self, rhs: &Chunk) -> Result<Chunk, ChunkError>

Concatenates two Chunks into a new one.

The order of the arguments matter: self‘s contents will precede rhs’ contents in the returned Chunk.

This will return an error if the chunks are not concatenable.

source

pub fn overlaps_on_row_id(&self, rhs: &Chunk) -> bool

Returns true if self and rhs overlap on their RowId range.

source

pub fn overlaps_on_time(&self, rhs: &Chunk) -> bool

Returns true if self and rhs overlap on any of their time range(s).

This does not imply that they share the same exact set of timelines.

source

pub fn same_entity_paths(&self, rhs: &Chunk) -> bool

Returns true if both chunks share the same entity path.

source

pub fn same_timelines(&self, rhs: &Chunk) -> bool

Returns true if both chunks contains the same set of timelines.

source

pub fn same_datatypes(&self, rhs: &Chunk) -> bool

Returns true if both chunks share the same datatypes for the components that they have in common.

source

pub fn concatenable(&self, rhs: &Chunk) -> bool

Returns true if two chunks are concatenable.

To be concatenable, two chunks must:

  • Share the same entity path.
  • Share the same exact set of timelines.
  • Use the same datatypes for the components they have in common.
source§

impl Chunk

source

pub fn range(&self, query: &RangeQuery, component_name: ComponentName) -> Chunk

Runs a RangeQuery filter on a Chunk.

This behaves as a row-based filter: the result is a new Chunk that is vertically sliced, sorted and filtered in order to only contain the row(s) relevant for the specified query.

The resulting Chunk is guaranteed to contain all the same columns has the queried chunk: there is no horizontal slicing going on.

An empty Chunk (i.e. 0 rows, but N columns) is returned if the query yields nothing.

Because the resulting chunk doesn’t discard any column information, you can find extra relevant information by inspecting the data, for examples timestamps on other timelines. See Self::timeline_sliced and Self::component_sliced if you do want to filter this extra data.

source§

impl Chunk

source

pub fn is_sorted(&self) -> bool

Is the chunk currently ascendingly sorted by crate::RowId?

This is O(1) (cached).

See also Self::is_sorted_uncached.

source

pub fn is_time_sorted(&self) -> bool

Is the chunk ascendingly sorted by time, for all of its timelines?

This is O(1) (cached).

source

pub fn is_timeline_sorted(&self, timeline: &Timeline) -> bool

Is the chunk ascendingly sorted by time, for a specific timeline?

This is O(1) (cached).

See also Self::is_timeline_sorted_uncached.

source

pub fn sort_if_unsorted(&mut self)

Sort the chunk, if needed.

The underlying arrow data will be copied and shuffled in memory in order to make it contiguous.

source

pub fn sorted_by_timeline_if_unsorted(&self, timeline: &Timeline) -> Chunk

Returns a new Chunk that is sorted by (<timeline>, RowId).

The underlying arrow data will be copied and shuffled in memory in order to make it contiguous.

This is a no-op if the underlying timeline is already sorted appropriately (happy path).

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn shuffle_random(&mut self, seed: u64)

Randomly shuffles the chunk using the given seed.

The underlying arrow data will be copied and shuffled in memory in order to make it contiguous.

source§

impl Chunk

source

pub fn cell( &self, row_id: RowId, component_name: &ComponentName ) -> Option<Box<dyn Array>>

Returns the cell corresponding to the specified RowId for a given ComponentName.

This is O(log(n)) if self.is_sorted(), and O(n) otherwise.

Reminder: duplicated RowIds results in undefined behavior.

source

pub fn row_sliced(&self, index: usize, len: usize) -> Chunk

Slices the Chunk vertically.

The result is a new Chunk with the same columns and (potentially) less rows.

This cannot fail nor panic: index and len will be capped so that they cannot run out of bounds. This can result in an empty Chunk being returned if the slice is completely OOB.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn timeline_sliced(&self, timeline: Timeline) -> Chunk

Slices the Chunk horizontally by keeping only the selected timeline.

The result is a new Chunk with the same rows and (at-most) one timeline column. All non-timeline columns will be kept as-is.

If timeline is not found within the Chunk, the end result will be the same as the current chunk but without any timeline column.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn component_sliced(&self, component_name: ComponentName) -> Chunk

Slices the Chunk horizontally by keeping only the selected component_name.

The result is a new Chunk with the same rows and (at-most) one component column. All non-component columns will be kept as-is.

If component_name is not found within the Chunk, the end result will be the same as the current chunk but without any component column.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn timelines_sliced( &self, timelines_to_keep: &HashSet<Timeline, BuildHasherDefault<NoHashHasher<Timeline>>> ) -> Chunk

Slices the Chunk horizontally by keeping only the selected timelines.

The result is a new Chunk with the same rows and (at-most) the selected timeline columns. All non-timeline columns will be kept as-is.

If none of the selected timelines exist in the Chunk, the end result will be the same as the current chunk but without any timeline column.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn components_sliced( &self, component_names: &HashSet<ComponentName, BuildHasherDefault<NoHashHasher<ComponentName>>> ) -> Chunk

Slices the Chunk horizontally by keeping only the selected component_names.

The result is a new Chunk with the same rows and (at-most) the selected component columns. All non-component columns will be kept as-is.

If none of the component_names exist in the Chunk, the end result will be the same as the current chunk but without any component column.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn densified(&self, component_name_pov: ComponentName) -> Chunk

Densifies the Chunk vertically based on the component_name column.

Densifying here means dropping all rows where the associated value in the component_name column is null.

The result is a new Chunk where the component_name column is guaranteed to be dense.

If component_name doesn’t exist in this Chunk, or if it is already dense, this method is a no-op.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn emptied(&self) -> Chunk

Empties the Chunk vertically.

The result is a new Chunk with the same columns but zero rows.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn components_removed(self) -> Chunk

Removes all component columns from the Chunk.

The result is a new Chunk with the same number of rows and the same index columns, but no components.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn deduped_latest_on_index(&self, index: &Timeline) -> Chunk

Removes duplicate rows from sections of consecutive identical indices.

  • If the Chunk is sorted on that index, the remaining values in the index column will be unique.
  • If the Chunk has been densified on a specific column, the resulting chunk will effectively contain the latest value of that column for each given index value.

If this is a temporal chunk and timeline isn’t present in it, this method is a no-op.

This does not obey RowId-ordering semantics (or any other kind of semantics for that matter) – it merely respects how the chunk is currently laid out: no more, no less. Sort the chunk according to the semantics you’re looking for before calling this method.

source

pub fn filtered(&self, filter: &BooleanArray) -> Option<Chunk>

Applies a filter kernel to the Chunk as a whole.

Returns None if the length of the filter does not match the number of rows in the chunk.

In release builds, filters are allowed to have null entries (they will be interpreted as false). In debug builds, null entries will panic.

Note: a filter kernel copies the data in order to make the resulting arrays contiguous in memory.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source

pub fn taken<O>(&self, indices: &PrimitiveArray<O>) -> Chunk
where O: Index,

Applies a take kernel to the Chunk as a whole.

In release builds, indices are allowed to have null entries (they will be taken as nulls). In debug builds, null entries will panic.

Note: a take kernel copies the data in order to make the resulting arrays contiguous in memory.

Takes care of up- and down-casting the data back and forth on behalf of the caller.

WARNING: the returned chunk has the same old crate::ChunkId! Change it with Self::with_id.

source§

impl Chunk

source

pub fn to_transport(&self) -> Result<TransportChunk, ChunkError>

Prepare the Chunk for transport.

It is probably a good idea to sort the chunk first.

source

pub fn from_transport(transport: &TransportChunk) -> Result<Chunk, ChunkError>

source§

impl Chunk

Trait Implementations§

source§

impl Clone for Chunk

source§

fn clone(&self) -> Chunk

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 Chunk

source§

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

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

impl Display for Chunk

source§

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

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

impl PartialEq for Chunk

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl SizeBytes for Chunk

source§

fn heap_size_bytes(&self) -> u64

Returns the total size of self on the heap, in bytes.
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

Auto Trait Implementations§

§

impl !Freeze for Chunk

§

impl !RefUnwindSafe for Chunk

§

impl Send for Chunk

§

impl Sync for Chunk

§

impl Unpin for Chunk

§

impl !UnwindSafe for Chunk

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.
source§

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

source§

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

Casts the value.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

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 + Sync + Send>

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

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

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

§

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,

§

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
§

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

§

fn to_smolstr(&self) -> SmolStr

source§

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

source§

default 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>,

§

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

§

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<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

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> Ungil for T
where T: Send,

§

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

§

impl<T> WasmNotSendSync for T

§

impl<T> WasmNotSync for T
where T: Sync,