pub struct LogosMap<K, V>(pub Rc<RefCell<FxHashMap<K, V>>>);Expand description
Key-value mapping with reference semantics.
LogosMap<K, V> wraps Rc<RefCell<FxHashMap<K, V>>> to provide shared mutable access.
Cloning a LogosMap produces a shallow copy (shared reference), not a deep copy.
Use .deep_clone() for an independent copy (LOGOS copy of).
Tuple Fields§
§0: Rc<RefCell<FxHashMap<K, V>>>Implementations§
Source§impl<K: Eq + Hash, V> LogosMap<K, V>
impl<K: Eq + Hash, V> LogosMap<K, V>
pub fn new() -> Self
pub fn with_capacity(cap: usize) -> Self
pub fn from_map(m: FxHashMap<K, V>) -> Self
pub fn insert(&self, key: K, value: V) -> Option<V>
pub fn remove(&self, key: &K) -> Option<V>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains_key(&self, key: &K) -> bool
pub fn borrow(&self) -> Ref<'_, FxHashMap<K, V>>
pub fn borrow_mut(&self) -> RefMut<'_, FxHashMap<K, V>>
Trait Implementations§
Source§impl<'de, K: Deserialize<'de> + Eq + Hash, V: Deserialize<'de>> Deserialize<'de> for LogosMap<K, V>
impl<'de, K: Deserialize<'de> + Eq + Hash, V: Deserialize<'de>> Deserialize<'de> for LogosMap<K, V>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K: Eq + Hash, V> LogosContains<K> for LogosMap<K, V>
impl<K: Eq + Hash, V> LogosContains<K> for LogosMap<K, V>
Source§fn logos_contains(&self, key: &K) -> bool
fn logos_contains(&self, key: &K) -> bool
Check if this collection contains the given value.
Auto Trait Implementations§
impl<K, V> Freeze for LogosMap<K, V>
impl<K, V> !RefUnwindSafe for LogosMap<K, V>
impl<K, V> !Send for LogosMap<K, V>
impl<K, V> !Sync for LogosMap<K, V>
impl<K, V> Unpin for LogosMap<K, V>
impl<K, V> UnsafeUnpin for LogosMap<K, V>
impl<K, V> !UnwindSafe for LogosMap<K, V>
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