pub enum FieldValue {
Int(i64),
Uint(u64),
Float(f64),
String(String),
Array(Vec<i16>),
}Expand description
A decoded field value from a DataFlash log entry.
use ardupilot_binlog::FieldValue;
let v = FieldValue::Float(45.0);
assert_eq!(v.as_f64(), Some(45.0));
assert_eq!(v.to_string(), "45");Variants§
Int(i64)
Integer values (b, B, h, H, i, I, q, M, L)
Uint(u64)
Unsigned 64-bit integer (Q) — separate because u64 can exceed i64 range
Float(f64)
Floating-point values (f, d) and pre-scaled values (c, C, e, E already divided by 100)
String(String)
String values (n, N, Z) — null bytes trimmed
Array(Vec<i16>)
Array of i16 values (a)
Implementations§
Trait Implementations§
Source§impl Clone for FieldValue
impl Clone for FieldValue
Source§fn clone(&self) -> FieldValue
fn clone(&self) -> FieldValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldValue
impl Debug for FieldValue
Source§impl Display for FieldValue
impl Display for FieldValue
Source§impl PartialEq for FieldValue
impl PartialEq for FieldValue
impl StructuralPartialEq for FieldValue
Auto Trait Implementations§
impl Freeze for FieldValue
impl RefUnwindSafe for FieldValue
impl Send for FieldValue
impl Sync for FieldValue
impl Unpin for FieldValue
impl UnsafeUnpin for FieldValue
impl UnwindSafe for FieldValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more