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
Boolvalue. - bytes_
at - One
Binaryvalue. - check_
row - Checks that
rowis addressable in a column oflenrows. - child
- A named child of the struct behind
column. - f32_at
- One
Float32value. - f64_at
- One
Float64value. - 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
Utf8value. - structure
- The struct array behind a column, or a named error.
- timestamp_
at - One
Timestamp(ns)value, in nanoseconds.