This is the minimal API surface needed to be provided by a user to log a custom thing.
class AsComponents(Protocol):
"""Describes interface for interpreting an object as a collection of Rerun Components."""
def as_component_batches(self) -> Iterable[ComponentBatchLike]:
"""
Returns an iterable of `ComponentBatchLike` objects.
Each object in the iterable must adhere to the `ComponentBatchLike`
interface. All of the batches should have the same length, or length 1
if the component is a splat, or 0 if the component is being cleared.
"""
def log(
entity_path: str,
entity: AsComponents | Iterable[ComponentBatchLike],
timeless: bool = False,
recording: RecordingStream | None = None,
) -> None:
pub trait AsComponents
#[inline]
fn as_component_batches(&self) -> Vec<MaybeOwnedComponentBatch<'_>> {
vec![]
}
This is the minimal API surface needed to be provided by a user to log a custom thing.
In python:
In rust: