Trait re_types::Loggable

source ·
pub trait Loggable: Sized + 'static + Send + Sync + 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 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.

Component is a specialization of the Loggable trait where Loggable::Name == ComponentName.

Implementing the Loggable trait (and by extension Component) automatically derives the LoggableBatch implementation (and by extension 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.

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

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.

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Loggable for MyColor

§

type Name = ComponentName

source§

fn name() -> <MyColor as Loggable>::Name

source§

fn arrow_datatype() -> DataType

source§

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

source§

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

source§

impl Loggable for MyIndex

§

type Name = ComponentName

source§

fn name() -> <MyIndex as Loggable>::Name

source§

fn arrow_datatype() -> DataType

source§

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

source§

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

source§

impl Loggable for MyLabel

§

type Name = ComponentName

source§

fn name() -> <MyLabel as Loggable>::Name

source§

fn arrow_datatype() -> DataType

source§

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

source§

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

source§

impl Loggable for MyPoint64

§

type Name = ComponentName

source§

fn name() -> <MyPoint64 as Loggable>::Name

source§

fn arrow_datatype() -> DataType

source§

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

source§

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

source§

impl Loggable for MyPoint

§

type Name = ComponentName

source§

fn name() -> <MyPoint as Loggable>::Name

source§

fn arrow_datatype() -> DataType

source§

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

source§

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

source§

impl Loggable for EntityPath

§

type Name = ComponentName

source§

fn name() -> <EntityPath as Loggable>::Name

source§

fn arrow_datatype() -> DataType

source§

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

source§

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

source§

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

source§

impl Loggable for Tuid

§

type Name = ComponentName

source§

fn name() -> <Tuid as Loggable>::Name

source§

fn arrow_datatype() -> DataType

source§

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

source§

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

source§

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

Implementors§

source§

impl Loggable for BackgroundKind

source§

impl Loggable for Corner2D

source§

impl Loggable for MapProvider

source§

impl Loggable for PanelState

source§

impl Loggable for ViewFit

source§

impl Loggable for AggregationPolicy

source§

impl Loggable for Colormap

source§

impl Loggable for FillMode

source§

impl Loggable for MagnificationFilter

source§

impl Loggable for MarkerShape

source§

impl Loggable for TransformRelation

source§

impl Loggable for ChannelDatatype

source§

impl Loggable for ColorModel

source§

impl Loggable for PixelFormat

source§

impl Loggable for TensorBuffer

source§

impl Loggable for TimeRangeBoundary

source§

impl Loggable for re_types::testing::datatypes::affix_fuzzer3::AffixFuzzer3

source§

impl Loggable for re_types::testing::datatypes::affix_fuzzer4::AffixFuzzer4

source§

impl Loggable for EnumTest

source§

impl Loggable for ValuedEnum

source§

impl Loggable for ActiveTab

source§

impl Loggable for ApplyLatestAt

source§

impl Loggable for ColumnShare

source§

impl Loggable for re_types::blueprint::components::component_column_selector::ComponentColumnSelector

source§

impl Loggable for re_types::blueprint::components::filter_by_range::FilterByRange

source§

impl Loggable for re_types::blueprint::components::filter_is_not_null::FilterIsNotNull

source§

impl Loggable for IncludedContent

source§

impl Loggable for Interactive

source§

impl Loggable for LockRangeDuringZoom

source§

impl Loggable for QueryExpression

source§

impl Loggable for RowShare

source§

impl Loggable for re_types::blueprint::components::selected_columns::SelectedColumns

source§

impl Loggable for SpaceViewClass

source§

impl Loggable for SpaceViewOrigin

source§

impl Loggable for re_types::blueprint::components::tensor_dimension_index_slider::TensorDimensionIndexSlider

source§

impl Loggable for TimelineName

source§

impl Loggable for ViewerRecommendationHash

source§

impl Loggable for Visible

source§

impl Loggable for re_types::blueprint::components::visible_time_range::VisibleTimeRange

source§

impl Loggable for VisualBounds2D

source§

impl Loggable for ZoomLevel

source§

impl Loggable for re_types::blueprint::datatypes::component_column_selector::ComponentColumnSelector

source§

impl Loggable for re_types::blueprint::datatypes::filter_by_range::FilterByRange

source§

impl Loggable for re_types::blueprint::datatypes::filter_is_not_null::FilterIsNotNull

source§

impl Loggable for re_types::blueprint::datatypes::selected_columns::SelectedColumns

source§

impl Loggable for re_types::blueprint::datatypes::tensor_dimension_index_slider::TensorDimensionIndexSlider

source§

impl Loggable for AlbedoFactor

source§

impl Loggable for AnnotationContext

source§

impl Loggable for AxisLength

source§

impl Loggable for re_types::components::_components::blob::Blob

source§

impl Loggable for re_types::components::_components::class_id::ClassId

source§

impl Loggable for Color

source§

impl Loggable for DepthMeter

source§

impl Loggable for DisconnectedSpace

source§

impl Loggable for DrawOrder

source§

impl Loggable for re_types::components::_components::entity_path::EntityPath

source§

impl Loggable for FillRatio

source§

impl Loggable for GammaCorrection

source§

impl Loggable for GeoLineString

source§

impl Loggable for HalfSize2D

source§

impl Loggable for HalfSize3D

source§

impl Loggable for ImageBuffer

source§

impl Loggable for re_types::components::_components::image_format::ImageFormat

source§

impl Loggable for ImagePlaneDistance

source§

impl Loggable for re_types::components::_components::keypoint_id::KeypointId

source§

impl Loggable for LatLon

source§

impl Loggable for Length

source§

impl Loggable for LineStrip2D

source§

impl Loggable for LineStrip3D

source§

impl Loggable for MarkerSize

source§

impl Loggable for MediaType

source§

impl Loggable for Name

source§

impl Loggable for Opacity

source§

impl Loggable for PinholeProjection

source§

impl Loggable for PoseRotationAxisAngle

source§

impl Loggable for PoseRotationQuat

source§

impl Loggable for PoseScale3D

source§

impl Loggable for PoseTransformMat3x3

source§

impl Loggable for PoseTranslation3D

source§

impl Loggable for Position2D

source§

impl Loggable for Position3D

source§

impl Loggable for Radius

source§

impl Loggable for re_types::components::_components::range1d::Range1D

source§

impl Loggable for Resolution

source§

impl Loggable for re_types::components::_components::rotation_axis_angle::RotationAxisAngle

source§

impl Loggable for RotationQuat

source§

impl Loggable for Scalar

source§

impl Loggable for Scale3D

source§

impl Loggable for ShowLabels

source§

impl Loggable for StrokeWidth

source§

impl Loggable for re_types::components::_components::tensor_data::TensorData

source§

impl Loggable for re_types::components::_components::tensor_dimension_index_selection::TensorDimensionIndexSelection

source§

impl Loggable for TensorHeightDimension

source§

impl Loggable for TensorWidthDimension

source§

impl Loggable for Texcoord2D

source§

impl Loggable for Text

source§

impl Loggable for TextLogLevel

source§

impl Loggable for TransformMat3x3

source§

impl Loggable for Translation3D

source§

impl Loggable for TriangleIndices

source§

impl Loggable for ValueRange

source§

impl Loggable for Vector2D

source§

impl Loggable for Vector3D

source§

impl Loggable for re_types::components::_components::video_timestamp::VideoTimestamp

source§

impl Loggable for re_types::components::_components::view_coordinates::ViewCoordinates

source§

impl Loggable for ClearIsRecursive

source§

impl Loggable for Angle

source§

impl Loggable for AnnotationInfo

source§

impl Loggable for re_types::datatypes::_datatypes::blob::Blob

source§

impl Loggable for ClassDescription

source§

impl Loggable for ClassDescriptionMapElem

source§

impl Loggable for re_types::datatypes::_datatypes::class_id::ClassId

source§

impl Loggable for DVec2D

source§

impl Loggable for re_types::datatypes::_datatypes::image_format::ImageFormat

source§

impl Loggable for re_types::datatypes::_datatypes::keypoint_id::KeypointId

source§

impl Loggable for KeypointPair

source§

impl Loggable for Mat3x3

source§

impl Loggable for Mat4x4

source§

impl Loggable for Quaternion

source§

impl Loggable for re_types::datatypes::_datatypes::range1d::Range1D

source§

impl Loggable for Range2D

source§

impl Loggable for Rgba32

source§

impl Loggable for re_types::datatypes::_datatypes::rotation_axis_angle::RotationAxisAngle

source§

impl Loggable for re_types::datatypes::_datatypes::tensor_data::TensorData

source§

impl Loggable for TensorDimension

source§

impl Loggable for re_types::datatypes::_datatypes::tensor_dimension_index_selection::TensorDimensionIndexSelection

source§

impl Loggable for TensorDimensionSelection

source§

impl Loggable for Uuid

source§

impl Loggable for UVec2D

source§

impl Loggable for UVec3D

source§

impl Loggable for UVec4D

source§

impl Loggable for Vec2D

source§

impl Loggable for Vec3D

source§

impl Loggable for Vec4D

source§

impl Loggable for re_types::datatypes::_datatypes::video_timestamp::VideoTimestamp

source§

impl Loggable for re_types::datatypes::_datatypes::view_coordinates::ViewCoordinates

source§

impl Loggable for Bool

source§

impl Loggable for re_types::datatypes::EntityPath

source§

impl Loggable for Float32

source§

impl Loggable for Float64

source§

impl Loggable for TimeInt

source§

impl Loggable for TimeRange

source§

impl Loggable for UInt16

source§

impl Loggable for UInt32

source§

impl Loggable for UInt64

source§

impl Loggable for Utf8

source§

impl Loggable for re_types::datatypes::VisibleTimeRange

source§

impl Loggable for re_types::testing::components::affix_fuzzer1::AffixFuzzer1

source§

impl Loggable for re_types::testing::components::affix_fuzzer2::AffixFuzzer2

source§

impl Loggable for re_types::testing::components::affix_fuzzer3::AffixFuzzer3

source§

impl Loggable for re_types::testing::components::affix_fuzzer4::AffixFuzzer4

source§

impl Loggable for re_types::testing::components::affix_fuzzer5::AffixFuzzer5

source§

impl Loggable for AffixFuzzer6

source§

impl Loggable for AffixFuzzer7

source§

impl Loggable for AffixFuzzer8

source§

impl Loggable for AffixFuzzer9

source§

impl Loggable for AffixFuzzer10

source§

impl Loggable for AffixFuzzer11

source§

impl Loggable for AffixFuzzer12

source§

impl Loggable for AffixFuzzer13

source§

impl Loggable for AffixFuzzer14

source§

impl Loggable for AffixFuzzer15

source§

impl Loggable for AffixFuzzer16

source§

impl Loggable for AffixFuzzer17

source§

impl Loggable for AffixFuzzer18

source§

impl Loggable for AffixFuzzer19

source§

impl Loggable for re_types::testing::components::affix_fuzzer20::AffixFuzzer20

source§

impl Loggable for re_types::testing::components::affix_fuzzer21::AffixFuzzer21

source§

impl Loggable for re_types::testing::components::affix_fuzzer22::AffixFuzzer22

source§

impl Loggable for AffixFuzzer23

source§

impl Loggable for re_types::testing::datatypes::affix_fuzzer1::AffixFuzzer1

source§

impl Loggable for re_types::testing::datatypes::affix_fuzzer2::AffixFuzzer2

source§

impl Loggable for re_types::testing::datatypes::affix_fuzzer5::AffixFuzzer5

source§

impl Loggable for re_types::testing::datatypes::affix_fuzzer20::AffixFuzzer20

source§

impl Loggable for re_types::testing::datatypes::affix_fuzzer21::AffixFuzzer21

source§

impl Loggable for re_types::testing::datatypes::affix_fuzzer22::AffixFuzzer22

source§

impl Loggable for FlattenedScalar

source§

impl Loggable for MultiEnum

source§

impl Loggable for PrimitiveComponent

source§

impl Loggable for StringComponent