Skip to content

Provide Archetype::as_data_cells #3414

@teh-cmc

Description

@teh-cmc

Sometimes you want to go straight from an archetype into a bunch of datacells.
Loading a non RRD file into the viewer is a common example:

  1. Wrap the file's bytes into an archetype
  2. Convert the archetype into cells
  3. Ship the cells to the viewer

It's basically this:

trait Archetype {
// [...]

    fn as_data_cells(&self) -> SerializationResult<Vec<DataCell>> {
        self.as_component_batches()
            .into_iter()
            .map(|comp_batch| {
                let comp_batch = comp_batch.as_ref();
                Ok(DataCell::from_arrow(
                    comp_batch.name(),
                    comp_batch.try_to_arrow()?,
                ))
            })
            .collect();
    }

// [...]
}

but this requires a dependency of re_log_types::DataCell, which is circular.

DataCell gotta move.

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdk-rustRust logging API

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions