Function re_query::query_archetype

source ·
pub fn query_archetype<A: Archetype>(
    store: &DataStore,
    query: &LatestAtQuery,
    ent_path: &EntityPath
) -> Result<ArchetypeView<A>>
Expand description

Retrieve an ArchetypeView from the DataStore, as well as the associated data time of its most recent component.

If you expect only one instance (e.g. for mono-components like Transform Tensor] and have no additional components you can use DataStore::query_latest_component instead.


let ent_path = "point";
let query = LatestAtQuery::new(Timeline::new_sequence("frame_nr"), 123.into());

let arch_view = re_query::query_archetype::<MyPoints>(
  &store,
  &query,
  &ent_path.into(),
)
.unwrap();

//println!("{arch_view:?}");

Outputs:

┌────────────────────┬───────────────┬─────────────────┐
│ InstanceKey        ┆ MyPoint       ┆ MyColor         │
│ ---                ┆ ---           ┆ ---             │
│ u64                ┆ struct[2]     ┆ u32             │
╞════════════════════╪═══════════════╪═════════════════╡
│ 42                 ┆ {1.0,2.0}     ┆ null            │
│ 96                 ┆ {3.0,4.0}     ┆ 4278190080      │
└────────────────────┴───────────────┴─────────────────┘