pub struct Object(pub HashMap<String, Value>);Expand description
Represents a simple object that can be used to store key-value pairs.
Tuple Fields§
§0: HashMap<String, Value>Implementations§
source§impl Object
impl Object
sourcepub fn set<T: Into<String>, V: Into<Value>>(
&mut self,
key: T,
value: V,
) -> Option<Value>
pub fn set<T: Into<String>, V: Into<Value>>( &mut self, key: T, value: V, ) -> Option<Value>
Sets the value for the given key.
If the object didn’t have this key present, None is returned.
If the object did have this key present, the value is updated, and the
old value is returned. The key should be a string and the value should
be convertible to a Value.
Trait Implementations§
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)