Skip to main content

MapLike

Trait MapLike 

Source
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§

Source

fn new() -> Self

Source

fn get(&self, key: &u64) -> Option<&(NanValue, NanValue)>

Source

fn insert(&self, key: u64, value: (NanValue, NanValue)) -> Self

Source

fn len(&self) -> usize

Source

fn iter(&self) -> impl Iterator<Item = (&u64, &(NanValue, NanValue))>

Source

fn values(&self) -> impl Iterator<Item = &(NanValue, NanValue)>

Provided Methods§

Source

fn is_empty(&self) -> bool

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.

Implementations on Foreign Types§

Source§

impl MapLike for AverMap<u64, (NanValue, NanValue)>

Available on crate feature runtime only.
Source§

fn new() -> AverMap<u64, (NanValue, NanValue)>

Source§

fn get(&self, key: &u64) -> Option<&(NanValue, NanValue)>

Source§

fn insert( &self, key: u64, value: (NanValue, NanValue), ) -> AverMap<u64, (NanValue, NanValue)>

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn iter(&self) -> impl Iterator<Item = (&u64, &(NanValue, NanValue))>

Source§

fn values(&self) -> impl Iterator<Item = &(NanValue, NanValue)>

Implementors§