-
Notifications
You must be signed in to change notification settings - Fork 405
/
Copy pathany_values.rs
41 lines (32 loc) · 1.2 KB
/
any_values.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Log arbitrary data.
use std::sync::Arc;
use rerun::external::arrow;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rec = rerun::RecordingStreamBuilder::new("rerun_example_any_values").spawn()?;
let confidences = rerun::SerializedComponentBatch::new(
Arc::new(arrow::array::Float64Array::from(vec![1.2, 3.4, 5.6])),
rerun::ComponentDescriptor::new("confidence"),
);
let description = rerun::SerializedComponentBatch::new(
Arc::new(arrow::array::StringArray::from(vec!["Bla bla bla…"])),
rerun::ComponentDescriptor::new("description"),
);
// URIs will become clickable links
let homepage = rerun::SerializedComponentBatch::new(
Arc::new(arrow::array::StringArray::from(vec![
"https://www.rerun.io",
])),
rerun::ComponentDescriptor::new("homepage"),
);
let repository = rerun::SerializedComponentBatch::new(
Arc::new(arrow::array::StringArray::from(vec![
"https://github.com/rerun-io/rerun",
])),
rerun::ComponentDescriptor::new("repository"),
);
rec.log(
"any_values",
&[confidences, description, homepage, repository],
)?;
Ok(())
}