Skip to main content

Module read

Module read 

Source
Expand description

Column accessors shared by every AstrsMessage implementation.

The mirror of build: four shapes to read back, plus the bounds and type checks that turn “this payload is not what the port promised” into a named error rather than a wrong number.

Every accessor here is total and checked. A payload arrives from another process — possibly an older build, possibly a type: any port, possibly a ROS 2 bridge — so a decoder that indexed without checking would be reading whatever the sender happened to send.

§Examples

use astrs_node_api::message::{build, read};

let column = build::structure(vec![("x", build::primitive::<f64>(&[2.5]))])?;
let row = read::structure(&column)?;
assert_eq!(read::f64_at(read::field(row, "x")?, 0)?, 2.5);
assert!(read::field(row, "missing").is_err());

Functions§

bool_at
One Bool value.
bytes_at
One Binary value.
check_row
Checks that row is addressable in a column of len rows.
child
A named child of the struct behind column.
f32_at
One Float32 value.
f64_at
One Float64 value.
field
One named child column of a struct.
fixed_list
The fixed-size list array behind a column.
fixed_tuple_at
The values of one FixedSizeList<T, width> row, copied out.
fixed_tuple_list_at
The flattened values of one List<FixedSizeList<T, width>> entry, plus the tuple width actually found.
list
The list array behind a column.
list_window
The nested child column and the (offset, length) window of one list row.
primitive_at
One value of a primitive column.
primitive_list_at
The primitive values of one list entry, copied out.
str_at
One Utf8 value.
structure
The struct array behind a column, or a named error.
timestamp_at
One Timestamp(ns) value, in nanoseconds.