pub struct HashMapStorage { /* private fields */ }Expand description
Default in-memory variable store backed by a HashMap.
§Example
use bubbles::{HashMapStorage, Value, VariableStorage};
let mut storage = HashMapStorage::new();
storage.set("$hp", Value::Number(100.0));
storage.set("$name", Value::Text("Hero".into()));
assert_eq!(storage.get("$hp"), Some(Value::Number(100.0)));
assert_eq!(storage.get("$name"), Some(Value::Text("Hero".into())));Implementations§
Trait Implementations§
Source§impl Clone for HashMapStorage
impl Clone for HashMapStorage
Source§fn clone(&self) -> HashMapStorage
fn clone(&self) -> HashMapStorage
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 HashMapStorage
impl Debug for HashMapStorage
Source§impl Default for HashMapStorage
impl Default for HashMapStorage
Source§fn default() -> HashMapStorage
fn default() -> HashMapStorage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HashMapStorage
impl RefUnwindSafe for HashMapStorage
impl Send for HashMapStorage
impl Sync for HashMapStorage
impl Unpin for HashMapStorage
impl UnsafeUnpin for HashMapStorage
impl UnwindSafe for HashMapStorage
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