pub struct StructValue {
pub fields: IndexMap<String, Value>,
}Fields§
§fields: IndexMap<String, Value>Implementations§
Source§impl StructValue
impl StructValue
pub fn new() -> Self
Sourcepub fn insert(&mut self, name: impl Into<String>, value: Value) -> Option<Value>
pub fn insert(&mut self, name: impl Into<String>, value: Value) -> Option<Value>
Insert a field, preserving insertion order when the name is new.
Sourcepub fn remove(&mut self, name: &str) -> Option<Value>
pub fn remove(&mut self, name: &str) -> Option<Value>
Remove a field while preserving the relative order of remaining fields.
Sourcepub fn field_names(&self) -> impl Iterator<Item = &String>
pub fn field_names(&self) -> impl Iterator<Item = &String>
Returns an iterator over field names in their stored order.
Trait Implementations§
Source§impl Clone for StructValue
impl Clone for StructValue
Source§fn clone(&self) -> StructValue
fn clone(&self) -> StructValue
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 StructValue
impl Debug for StructValue
Source§impl Default for StructValue
impl Default for StructValue
Source§impl PartialEq for StructValue
impl PartialEq for StructValue
impl StructuralPartialEq for StructValue
Auto Trait Implementations§
impl Freeze for StructValue
impl RefUnwindSafe for StructValue
impl Send for StructValue
impl Sync for StructValue
impl Unpin for StructValue
impl UnwindSafe for StructValue
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