pub struct Object {
pub keys: Vec<String>,
pub values: HashMap<String, Value>,
}Expand description
An ordered key-value store used for SAS objects. Preserves insertion order, which is required for deterministic round-trips.
Fields§
§keys: Vec<String>§values: HashMap<String, Value>Implementations§
Source§impl Object
impl Object
pub fn new() -> Self
Sourcepub fn insert(&mut self, key: String, val: Value) -> bool
pub fn insert(&mut self, key: String, val: Value) -> bool
Insert a key-value pair. Returns false if the key already exists (E01).
pub fn get(&self, key: &str) -> Option<&Value>
pub fn contains_key(&self, key: &str) -> bool
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
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 UnsafeUnpin 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