Trait rerun::sdk::AsComponents

source ·
pub trait AsComponents {
    // Required method
    fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>;

    // Provided method
    fn to_arrow(
        &self
    ) -> Result<Vec<(Field, Box<dyn Array>)>, SerializationError> { ... }
}
Expand description

Describes the interface for interpreting an object as a bundle of Components.

§Custom bundles

While, in most cases, component bundles are code generated from our IDL definitions, it is possible to manually extend existing bundles, or even implement fully custom ones.

All AsComponents methods are optional to implement, with the exception of AsComponents::as_component_batches, which describes how the bundle can be interpreted as a set of ComponentBatches: arrays of components that are ready to be serialized.

Have a look at our Custom Data Loader example to learn more about handwritten bundles.

Required Methods§

source

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

Exposes the object’s contents as a set of ComponentBatchs.

This is the main mechanism for easily extending builtin archetypes or even writing fully custom ones. Have a look at our Custom Data Loader example to learn more about extending archetypes.

Provided Methods§

source

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

Serializes all non-null Components of this bundle into Arrow arrays.

The default implementation will simply serialize the result of Self::as_component_batches as-is, which is what you want in 99.9% of cases.

Implementors§

source§

impl AsComponents for Background

source§

impl AsComponents for DataframeQuery

source§

impl AsComponents for MapBackground

source§

impl AsComponents for MapZoom

source§

impl AsComponents for PlotLegend

source§

impl AsComponents for ScalarAxis

source§

impl AsComponents for SpaceViewBlueprint

source§

impl AsComponents for SpaceViewContents

source§

impl AsComponents for TensorScalarMapping

source§

impl AsComponents for TensorSliceSelection

source§

impl AsComponents for TensorViewFit

source§

impl AsComponents for VisibleTimeRanges

source§

impl AsComponents for VisualBounds2D

source§

impl AsComponents for AffixFuzzer1

source§

impl AsComponents for AffixFuzzer2

source§

impl AsComponents for AffixFuzzer3

source§

impl AsComponents for AffixFuzzer4

source§

impl AsComponents for ContainerBlueprint

source§

impl AsComponents for PanelBlueprint

source§

impl AsComponents for ViewportBlueprint

source§

impl AsComponents for AnnotationContext

source§

impl AsComponents for Arrows2D

source§

impl AsComponents for Arrows3D

source§

impl AsComponents for Asset3D

source§

impl AsComponents for AssetVideo

source§

impl AsComponents for BarChart

source§

impl AsComponents for Boxes2D

source§

impl AsComponents for Boxes3D

source§

impl AsComponents for Capsules3D

source§

impl AsComponents for Clear

source§

impl AsComponents for DepthImage

source§

impl AsComponents for DisconnectedSpace

source§

impl AsComponents for Ellipsoids3D

source§

impl AsComponents for EncodedImage

source§

impl AsComponents for GeoLineStrings

source§

impl AsComponents for GeoPoints

source§

impl AsComponents for Image

source§

impl AsComponents for InstancePoses3D

source§

impl AsComponents for LineStrips2D

source§

impl AsComponents for LineStrips3D

source§

impl AsComponents for Mesh3D

source§

impl AsComponents for Pinhole

source§

impl AsComponents for Points2D

source§

impl AsComponents for Points3D

source§

impl AsComponents for Scalar

source§

impl AsComponents for SegmentationImage

source§

impl AsComponents for SeriesLine

source§

impl AsComponents for SeriesPoint

source§

impl AsComponents for Tensor

source§

impl AsComponents for TextDocument

source§

impl AsComponents for TextLog

source§

impl AsComponents for Transform3D

source§

impl AsComponents for VideoFrameReference

source§

impl AsComponents for ViewCoordinates

source§

impl<C> AsComponents for C
where C: Component,