pub trait MapLike: Sized {
// Required methods
fn new() -> Self;
fn get(&self, key: &u64) -> Option<&(NanValue, NanValue)>;
fn insert(&self, key: u64, value: (NanValue, NanValue)) -> Self;
fn len(&self) -> usize;
fn iter(&self) -> impl Iterator<Item = (&u64, &(NanValue, NanValue))>;
fn values(&self) -> impl Iterator<Item = &(NanValue, NanValue)>;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Trait abstracting the persistent-map operations needed by the arena.
Implementors provide a hash-keyed map from u64 to (NanValue, NanValue).
Required Methods§
fn new() -> Self
fn get(&self, key: &u64) -> Option<&(NanValue, NanValue)>
fn insert(&self, key: u64, value: (NanValue, NanValue)) -> Self
fn len(&self) -> usize
fn iter(&self) -> impl Iterator<Item = (&u64, &(NanValue, NanValue))>
fn values(&self) -> impl Iterator<Item = &(NanValue, NanValue)>
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.