pub struct ULogData { /* private fields */ }
Expand description
Container for a single data row
Implementations
sourceimpl ULogData
impl ULogData
pub fn new(data: Vec<u8>, formats: Vec<String>) -> Self
sourcepub fn items(&self) -> Vec<String>
pub fn items(&self) -> Vec<String>
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);
sourcepub fn iter(&self) -> ULogDataIter<'_> ⓘ
pub fn iter(&self) -> ULogDataIter<'_> ⓘ
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
Auto Trait Implementations
impl RefUnwindSafe for ULogData
impl Send for ULogData
impl Sync for ULogData
impl Unpin for ULogData
impl UnwindSafe for ULogData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more