pub struct Obj(pub Vec<(String, Arg)>);Expand description
An object: keys in the order they were written.
Tuple Fields§
§0: Vec<(String, Arg)>Implementations§
Source§impl Obj
impl Obj
pub fn new() -> Obj
pub fn has(&self, key: &str) -> bool
pub fn keys(&self) -> impl Iterator<Item = &str>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn set(&mut self, key: &str, value: Arg)
pub fn set(&mut self, key: &str, value: Arg)
Set key, in place if it is there, at the end if not.
pub fn remove(&mut self, key: &str) -> Option<Arg>
Trait Implementations§
impl StructuralPartialEq for Obj
Auto Trait Implementations§
impl Forget for Obj
impl Freeze for Obj
impl Move for Obj
impl RefUnwindSafe for Obj
impl Send for Obj
impl Sync for Obj
impl Unpin for Obj
impl UnsafeUnpin for Obj
impl UnwindSafe for Obj
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more