Trait rerun::sdk::ComponentBatch

source ·
pub trait ComponentBatch: LoggableBatch {
    // Required method
    fn descriptor(&self) -> Cow<'_, ComponentDescriptor>;

    // Provided methods
    fn to_arrow_list_array(&self) -> Result<ListArray<i32>, SerializationError> { ... }
    fn with_descriptor(
        &self,
        descriptor: ComponentDescriptor,
    ) -> ComponentBatchCowWithDescriptor<'_>
       where Self: Sized { ... }
    fn name(&self) -> ComponentName { ... }
}
Expand description

A ComponentBatch represents an array’s worth of Component instances.

Required Methods§

source

fn descriptor(&self) -> Cow<'_, ComponentDescriptor>

Returns the complete ComponentDescriptor for this ComponentBatch.

Every component batch is uniquely identified by its ComponentDescriptor.

Provided Methods§

source

fn to_arrow_list_array(&self) -> Result<ListArray<i32>, SerializationError>

Serializes the batch into an Arrow list array with a single component per list.

source

fn with_descriptor( &self, descriptor: ComponentDescriptor, ) -> ComponentBatchCowWithDescriptor<'_>
where Self: Sized,

source

fn name(&self) -> ComponentName

The fully-qualified name of this component batch, e.g. rerun.components.Position2D.

This is a trivial but useful helper for self.descriptor().component_name.

The default implementation already does the right thing. Do not override unless you know what you’re doing. Self::name() must exactly match the value returned by self.descriptor().component_name, or undefined behavior ensues.

Trait Implementations§

source§

impl AsComponents for dyn ComponentBatch

source§

fn as_component_batches(&self) -> Vec<ComponentBatchCowWithDescriptor<'_>>

Exposes the object’s contents as a set of ComponentBatchs. Read more
source§

fn to_arrow2(&self) -> Result<Vec<(Field, Box<dyn Array>)>, SerializationError>

Serializes all non-null Components of this bundle into Arrow arrays. Read more
source§

impl<'a> From<&'a dyn ComponentBatch> for ComponentBatchCow<'a>

source§

fn from(comp_batch: &'a dyn ComponentBatch) -> ComponentBatchCow<'a>

Converts to this type from the input type.

Implementations on Foreign Types§

source§

impl<C> ComponentBatch for &[C]
where C: Component,

source§

impl<C> ComponentBatch for &[Option<C>]
where C: Component,

source§

impl<C> ComponentBatch for Option<C>
where C: Component,

source§

impl<C> ComponentBatch for Vec<Option<C>>
where C: Component,

source§

impl<C> ComponentBatch for Vec<C>
where C: Component,

source§

impl<C, const N: usize> ComponentBatch for &[C; N]
where C: Component,

source§

impl<C, const N: usize> ComponentBatch for &[Option<C>; N]
where C: Component,

source§

impl<C, const N: usize> ComponentBatch for [C; N]
where C: Component,

source§

impl<C, const N: usize> ComponentBatch for [Option<C>; N]
where C: Component,

Implementors§