#![doc = document_features::document_features!()]
pub trait AsComponents {
fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>>;
#[inline]
fn num_instances(&self) -> usize {
self.as_component_batches()
.into_iter()
.map(|comp_batch| comp_batch.as_ref().num_instances())
.max()
.unwrap_or(0)
}
#[inline]
fn to_arrow(
&self,
) -> SerializationResult<Vec<(::arrow2::datatypes::Field, Box<dyn ::arrow2::array::Array>)>>
{
self.as_component_batches()
.into_iter()
.map(|comp_batch| {
comp_batch
.as_ref()
.to_arrow()
.map(|array| (comp_batch.as_ref().arrow_field(), array))
.with_context(comp_batch.as_ref().name())
})
.collect()
}
}
mod archetype;
mod loggable;
mod loggable_batch;
mod result;
mod size_bytes;
mod tuid;
pub use self::archetype::{
Archetype, ArchetypeName, GenericIndicatorComponent, NamedIndicatorComponent,
};
pub use self::loggable::{
Component, ComponentName, ComponentNameSet, Datatype, DatatypeName, Loggable,
};
pub use self::loggable_batch::{
ComponentBatch, DatatypeBatch, LoggableBatch, MaybeOwnedComponentBatch,
};
pub use self::result::{
DeserializationError, DeserializationResult, ResultExt, SerializationError,
SerializationResult, _Backtrace,
};
pub use self::size_bytes::SizeBytes;
pub mod archetypes;
pub mod components;
pub mod datatypes;
mod arrow_buffer;
mod arrow_string;
pub use self::arrow_buffer::ArrowBuffer;
pub use self::arrow_string::ArrowString;
#[path = "macros.rs"]
mod _macros;
pub mod macros {
pub use super::impl_into_cow;
}
pub mod external {
pub use anyhow;
pub use arrow2;
pub use re_tuid;
}