pub struct Fields(pub Vec<(&'static str, Value)>);Expand description
Named values in serialization order.
Tuple Fields§
§0: Vec<(&'static str, Value)>Implementations§
Source§impl Fields
impl Fields
Sourcepub fn at(&self, path: &str) -> Option<&Value>
pub fn at(&self, path: &str) -> Option<&Value>
A field inside nested blocks: path is "block.field".
Sourcepub fn set(&mut self, path: &str, value: Value) -> bool
pub fn set(&mut self, path: &str, value: Value) -> bool
Replace the value at path, keeping its kind (an I32 stays an I32, a Bool that
holds a raw byte takes the new truth value as 0 or 1 only if it changed). Returns whether
the field exists.
Sourcepub fn set_i32(&mut self, path: &str, v: i32) -> bool
pub fn set_i32(&mut self, path: &str, v: i32) -> bool
Set an i32 field inside nested blocks ("block.field"). Returns whether it exists.
Sourcepub fn set_f32(&mut self, path: &str, v: f32) -> bool
pub fn set_f32(&mut self, path: &str, v: f32) -> bool
Set an f32 field inside nested blocks. Returns whether it exists.
Sourcepub fn set_time(&mut self, path: &str, v: i64) -> bool
pub fn set_time(&mut self, path: &str, v: i64) -> bool
Set a time field (microseconds) inside nested blocks. Returns whether it exists.
Trait Implementations§
impl StructuralPartialEq for Fields
Auto Trait Implementations§
impl Freeze for Fields
impl RefUnwindSafe for Fields
impl Send for Fields
impl Sync for Fields
impl Unpin for Fields
impl UnsafeUnpin for Fields
impl UnwindSafe for Fields
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