Skip to main content

Loggable

Trait Loggable 

Source
pub trait Loggable:
    Sized
    + 'static
    + Send
    + Sync
    + Clone
    + SizeBytes {
    // Required methods
    fn arrow_datatype() -> DataType;
    fn to_arrow_opt<'a>(
        data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>,
    ) -> Result<Arc<dyn Array>, SerializationError>
       where Self: 'a;

    // Provided methods
    fn arrow_empty() -> Arc<dyn Array>  { ... }
    fn to_arrow<'a>(
        data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>,
    ) -> Result<Arc<dyn Array>, SerializationError>
       where Self: 'a { ... }
    fn from_arrow(data: &dyn Array) -> Result<Vec<Self>, DeserializationError> { ... }
    fn from_arrow_opt(
        data: &dyn Array,
    ) -> Result<Vec<Option<Self>>, DeserializationError> { ... }
    fn verify_arrow_array(data: &dyn Array) -> Result<(), 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.

A Loggable has no semantics (such as a name, for example): it’s just data. If you want to encode semantics, then you’re looking for a Component, which extends Loggable.

Implementing the Loggable trait automatically derives the ComponentBatch implementation, which makes it possible to work with lists’ worth of data in a generic fashion.

Required Methods§

Source

fn arrow_datatype() -> DataType

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

Source

fn to_arrow_opt<'a>( data: impl IntoIterator<Item = Option<impl Into<Cow<'a, Self>>>>, ) -> Result<Arc<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 arrow_empty() -> Arc<dyn Array>

Source

fn to_arrow<'a>( data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>, ) -> Result<Arc<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) -> Result<Vec<Self>, DeserializationError>

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

Source

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

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

Source

fn verify_arrow_array(data: &dyn Array) -> Result<(), DeserializationError>

Verifies that the given Arrow array can be deserialized into a collection of Selfs.

Calls Self::from_arrow and returns an error if it fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Loggable for BackgroundKind

Source§

impl Loggable for ContainerKind

Source§

impl Loggable for Corner2D

Source§

impl Loggable for Eye3DKind

Source§

impl Loggable for LinkAxis

Source§

impl Loggable for LoopMode

Source§

impl Loggable for MapProvider

Source§

impl Loggable for PanelState

Source§

impl Loggable for PlayState

Source§

impl Loggable for ViewFit

Source§

impl Loggable for TextLogColumnKind

Source§

impl Loggable for ComponentSourceKind

Source§

impl Loggable for AggregationPolicy

Source§

impl Loggable for Colormap

Source§

impl Loggable for GraphType

Source§

impl Loggable for InterpolationMode

Source§

impl Loggable for MagnificationFilter

Source§

impl Loggable for MarkerShape

Source§

impl Loggable for MeshFaceRendering

Source§

impl Loggable for VideoCodec

Source§

impl Loggable for TimeRangeBoundary

Source§

impl Loggable for ChannelDatatype

Source§

impl Loggable for ColorModel

Source§

impl Loggable for FillMode

Source§

impl Loggable for PixelFormat

Source§

impl Loggable for TensorBuffer

Source§

impl Loggable for TransformRelation

Source§

impl Loggable for ColumnOrder

Source§

impl Loggable for ComponentColumnSelector

Source§

impl Loggable for FilterByRange

Source§

impl Loggable for FilterIsNotNull

Source§

impl Loggable for SelectedColumns

Source§

impl Loggable for TensorDimensionIndexSlider

Source§

impl Loggable for TextLogColumn

Source§

impl Loggable for TimelineColumn

Source§

impl Loggable for VisualizerComponentMapping

Source§

impl Loggable for AnnotationContext

Source§

impl Loggable for ChannelMessageCounts

Source§

impl Loggable for GeoLineString

Source§

impl Loggable for KeyValuePairs

Source§

impl Loggable for AbsoluteTimeRange

Source§

impl Loggable for Blob

Source§

impl Loggable for Bool

Source§

impl Loggable for ChannelCountPair

Source§

impl Loggable for ClassDescriptionMapElem

Source§

impl Loggable for ClassId

Source§

impl Loggable for DVec2D

Source§

impl Loggable for rerun::datatypes::EntityPath

Source§

impl Loggable for Float64

Source§

impl Loggable for ImageFormat

Source§

impl Loggable for KeypointId

Source§

impl Loggable for Mat4x4

Source§

impl Loggable for Plane3D

Source§

impl Loggable for Range1D

Source§

impl Loggable for Range2D

Source§

impl Loggable for TensorDimensionIndexSelection

Source§

impl Loggable for TensorDimensionSelection

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 UVec2D

Source§

impl Loggable for UVec3D

Source§

impl Loggable for UVec4D

Source§

impl Loggable for Utf8

Source§

impl Loggable for Utf8Pair

Source§

impl Loggable for Uuid

Source§

impl Loggable for VideoTimestamp

Source§

impl Loggable for ViewCoordinates

Source§

impl Loggable for VisibleTimeRange

Source§

impl Loggable for MyColor

Source§

impl Loggable for MyIndex

Source§

impl Loggable for MyLabel

Source§

impl Loggable for MyPoint64

Source§

impl Loggable for MyPoint

Source§

impl Loggable for Tuid

Source§

impl Loggable for ChunkId

Source§

impl Loggable for RowId

Source§

impl Loggable for Angle

Source§

impl Loggable for AnnotationInfo

Source§

impl Loggable for ClassDescription

Source§

impl Loggable for rerun::EntityPath

Source§

impl Loggable for Float32

Source§

impl Loggable for KeypointPair

Source§

impl Loggable for LineStrip2D

Source§

impl Loggable for LineStrip3D

Source§

impl Loggable for Mat3x3

Source§

impl Loggable for Quaternion

Source§

impl Loggable for Rgba32

Source§

impl Loggable for RotationAxisAngle

Source§

impl Loggable for TensorData

Source§

impl Loggable for Vec2D

Source§

impl Loggable for Vec3D

Source§

impl Loggable for Vec4D

Source§

impl<T> Loggable for T