Struct px4_ulog::models::data::ULogData

source ·
pub struct ULogData { /* private fields */ }
Expand description

Container for a single data row

Implementations

Get the unformatted data for this item

Get the data formatting for this item

Get the list of field names in this item

Examples
use std::fs::File;
use px4_ulog::parser::dataset::*;
let filename = format!(
    "{}/tests/fixtures/6ba1abc7-b433-4029-b8f5-3b2bb12d3b6c.ulg",
    env!("CARGO_MANIFEST_DIR")
);

let mut log_file = File::open(&filename).unwrap();
let items = log_file.get_dataset("vehicle_gps_position")
    .unwrap()
    .next()
    .unwrap()
    .items();
assert_eq!(items[0], "timestamp");
assert_eq!(items[1], "time_utc_usec");
assert_eq!(items.len(), 23);

Get an iterator for data fields

The iterator value will be a tuple of (&str, DataType) where the first item will be the field name and the second the value.

Examples
use std::fs::File;
use px4_ulog::parser::dataset::*;
let filename = format!(
    "{}/tests/fixtures/6ba1abc7-b433-4029-b8f5-3b2bb12d3b6c.ulg",
    env!("CARGO_MANIFEST_DIR")
);

let mut log_file = File::open(&filename).unwrap();
let mut dataset = log_file.get_dataset("vehicle_gps_position").unwrap();
let first_data = dataset.next().unwrap();
assert_eq!(first_data.iter().count(), 23);

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.