Trait rerun::external::re_types_core::Loggable

source ·
pub trait Loggable: Sized + Clone + SizeBytes {
    type Name: Display;

    // Required methods
    fn name() -> Self::Name;
    fn arrow_datatype() -> DataType;
    fn to_arrow_opt<'a>(
        data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>
    ) -> Result<Box<dyn Array>, SerializationError>
       where Self: 'a;

    // Provided methods
    fn extended_arrow_datatype() -> DataType { ... }
    fn arrow_field() -> Field { ... }
    fn to_arrow<'a>(
        data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>
    ) -> Result<Box<dyn Array>, SerializationError>
       where Self: 'a { ... }
    fn from_arrow(
        data: &(dyn Array + 'static)
    ) -> Result<Vec<Self>, DeserializationError> { ... }
    fn from_arrow_opt(
        data: &(dyn Array + 'static)
    ) -> Result<Vec<Option<Self>>, DeserializationError> { ... }
}
Expand description

A Loggable represents a single instance in an array of loggable data.

Internally, Arrow, and by extension Rerun, only deal with arrays of data. We refer to individual entries in these arrays as instances.

Datatype and Component are specialization of the Loggable trait that are automatically implemented based on the type used for Loggable::Name.

Implementing the Loggable trait (and by extension Datatype/Component) automatically derives the LoggableBatch implementation (and by extension DatatypeBatch/ComponentBatch), which makes it possible to work with lists’ worth of data in a generic fashion.

Required Associated Types§

Required Methods§

source

fn name() -> Self::Name

The fully-qualified name of this loggable, e.g. rerun.datatypes.Vec2D.

source

fn arrow_datatype() -> DataType

The underlying arrow2::datatypes::DataType, excluding datatype extensions.

source

fn to_arrow_opt<'a>( data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>> ) -> Result<Box<dyn Array>, SerializationError>
where Self: 'a,

Given an iterator of options of owned or reference values to the current Loggable, serializes them into an Arrow array. The Arrow array’s datatype will match Loggable::arrow_field.

When using Rerun’s builtin components & datatypes, this can only fail if the data exceeds the maximum number of entries in an Arrow array (2^31 for standard arrays, 2^63 for large arrays).

Provided Methods§

source

fn extended_arrow_datatype() -> DataType

The underlying arrow2::datatypes::DataType, including datatype extensions.

The default implementation will simply wrap Self::arrow_datatype in an extension called Self::name, which is what you want in most cases.

source

fn arrow_field() -> Field

The underlying arrow2::datatypes::Field, including datatype extensions.

The default implementation will simply wrap Self::extended_arrow_datatype in a arrow2::datatypes::Field, which is what you want in most cases (e.g. because you want to declare the field as nullable).

source

fn to_arrow<'a>( data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>> ) -> Result<Box<dyn Array>, SerializationError>
where Self: 'a,

Given an iterator of owned or reference values to the current Loggable, serializes them into an Arrow array. The Arrow array’s datatype will match Loggable::arrow_field.

When using Rerun’s builtin components & datatypes, this can only fail if the data exceeds the maximum number of entries in an Arrow array (2^31 for standard arrays, 2^63 for large arrays).

source

fn from_arrow( data: &(dyn Array + 'static) ) -> Result<Vec<Self>, DeserializationError>

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

This will never fail if the Arrow array’s datatype matches the one returned by Loggable::arrow_field.

source

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

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

This will never fail if the Arrow array’s datatype matches the one returned by Loggable::arrow_field.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Loggable for MarkerShape

source§

impl Loggable for rerun::datatypes::Transform3D

source§

impl Loggable for Angle

source§

impl Loggable for rerun::Rotation3D

source§

impl Loggable for Scale3D

source§

impl Loggable for TensorBuffer

source§

impl Loggable for VisibleTimeRangeBoundaryKind

source§

impl Loggable for Background3DKind

source§

impl Loggable for ContainerKind

source§

impl Loggable for Corner2D

source§

impl Loggable for AnnotationContext

source§

impl Loggable for Blob

source§

impl Loggable for rerun::components::ClassId

source§

impl Loggable for ClearIsRecursive

source§

impl Loggable for DepthMeter

source§

impl Loggable for DisconnectedSpace

source§

impl Loggable for DrawOrder

source§

impl Loggable for rerun::components::KeypointId

source§

impl Loggable for MarkerSize

source§

impl Loggable for Name

source§

impl Loggable for PinholeProjection

source§

impl Loggable for Range1D

source§

impl Loggable for Resolution

source§

impl Loggable for rerun::components::Rotation3D

source§

impl Loggable for Scalar

source§

impl Loggable for ScalarScattering

source§

impl Loggable for StrokeWidth

source§

impl Loggable for rerun::components::TensorData

source§

impl Loggable for Texcoord2D

source§

impl Loggable for rerun::components::Transform3D

source§

impl Loggable for ViewCoordinates

source§

impl Loggable for VisualizerOverrides

source§

impl Loggable for Bool

source§

impl Loggable for ClassDescriptionMapElem

source§

impl Loggable for rerun::datatypes::ClassId

source§

impl Loggable for rerun::datatypes::EntityPath

source§

impl Loggable for rerun::datatypes::KeypointId

source§

impl Loggable for Mat4x4

source§

impl Loggable for rerun::datatypes::Material

source§

impl Loggable for rerun::datatypes::MeshProperties

source§

impl Loggable for TimeInt

source§

impl Loggable for UInt32

source§

impl Loggable for UInt64

source§

impl Loggable for UVec2D

source§

impl Loggable for UVec3D

source§

impl Loggable for UVec4D

source§

impl Loggable for Utf8

source§

impl Loggable for Uuid

source§

impl Loggable for RowId

source§

impl Loggable for TableId

source§

impl Loggable for AnnotationInfo

source§

impl Loggable for ClassDescription

source§

impl Loggable for Color

source§

impl Loggable for rerun::EntityPath

source§

impl Loggable for Float32

source§

impl Loggable for HalfSizes2D

source§

impl Loggable for HalfSizes3D

source§

impl Loggable for InstanceKey

source§

impl Loggable for KeypointPair

source§

impl Loggable for LineStrip2D

source§

impl Loggable for LineStrip3D

source§

impl Loggable for Mat3x3

source§

impl Loggable for rerun::Material

source§

impl Loggable for MediaType

source§

impl Loggable for rerun::MeshProperties

source§

impl Loggable for OutOfTreeTransform3D

source§

impl Loggable for Position2D

source§

impl Loggable for Position3D

source§

impl Loggable for Quaternion

source§

impl Loggable for Radius

source§

impl Loggable for Rgba32

source§

impl Loggable for RotationAxisAngle

source§

impl Loggable for rerun::TensorData

source§

impl Loggable for TensorDimension

source§

impl Loggable for Text

source§

impl Loggable for TextLogLevel

source§

impl Loggable for TranslationAndMat3x3

source§

impl Loggable for TranslationRotationScale3D

source§

impl Loggable for Vec2D

source§

impl Loggable for Vec3D

source§

impl Loggable for Vec4D

source§

impl Loggable for Vector2D

source§

impl Loggable for Vector3D

source§

impl Loggable for EntityPropertiesComponent

source§

impl Loggable for MyColor

source§

impl Loggable for MyLabel

source§

impl Loggable for MyPoint

source§

impl Loggable for NumInstances

source§

impl Loggable for Tuid

source§

impl Loggable for rerun::external::re_types::blueprint::datatypes::VisibleTimeRange

source§

impl Loggable for VisibleTimeRangeBoundary

source§

impl Loggable for ActiveTab

source§

impl Loggable for AutoLayout

source§

impl Loggable for AutoSpaceViews

source§

impl Loggable for ColumnShare

source§

impl Loggable for GridColumns

source§

impl Loggable for IncludedContent

source§

impl Loggable for IncludedSpaceView

source§

impl Loggable for LockRangeDuringZoom

source§

impl Loggable for PanelExpanded

source§

impl Loggable for QueryExpression

source§

impl Loggable for RootContainer

source§

impl Loggable for RowShare

source§

impl Loggable for SpaceViewClass

source§

impl Loggable for SpaceViewMaximized

source§

impl Loggable for SpaceViewOrigin

source§

impl Loggable for ViewerRecommendationHash

source§

impl Loggable for Visible

source§

impl Loggable for rerun::external::re_viewport::blueprint::components::VisibleTimeRange