pub struct PlainObject(pub Vec<(Key, Plain)>);Expand description
object with ordered keys
Tuple Fields§
§0: Vec<(Key, Plain)>Implementations§
Source§impl PlainObject
impl PlainObject
pub fn new() -> Self
pub fn get(&self, key: &str) -> Option<&Plain>
pub fn get_mut(&mut self, key: &str) -> Option<&mut Plain>
Sourcepub fn set(&mut self, key: impl Into<Key>, value: impl Into<Plain>)
pub fn set(&mut self, key: impl Into<Key>, value: impl Into<Plain>)
set a key (replaced in place when it exists, appended otherwise)
pub fn remove(&mut self, key: &str) -> Option<Plain>
pub fn has(&self, key: &str) -> bool
pub fn keys(&self) -> impl Iterator<Item = &str>
Trait Implementations§
Source§impl Clone for PlainObject
impl Clone for PlainObject
Source§impl Debug for PlainObject
impl Debug for PlainObject
Source§impl Default for PlainObject
impl Default for PlainObject
Source§impl From<PlainObject> for Plain
impl From<PlainObject> for Plain
Source§fn from(o: PlainObject) -> Self
fn from(o: PlainObject) -> Self
Converts to this type from the input type.
Source§impl PartialEq for PlainObject
impl PartialEq for PlainObject
impl StructuralPartialEq for PlainObject
Auto Trait Implementations§
impl !Send for PlainObject
impl !Sync for PlainObject
impl Forget for PlainObject
impl Freeze for PlainObject
impl Move for PlainObject
impl RefUnwindSafe for PlainObject
impl Unpin for PlainObject
impl UnsafeUnpin for PlainObject
impl UnwindSafe for PlainObject
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