[][src]Trait rustc_mir::interpret::machine::AllocMap

pub trait AllocMap<K: Hash + Eq, V> {
    fn contains_key<Q: ?Sized + Hash + Eq>(&mut self, k: &Q) -> bool
    where
        K: Borrow<Q>
;
fn insert(&mut self, k: K, v: V) -> Option<V>;
fn remove<Q: ?Sized + Hash + Eq>(&mut self, k: &Q) -> Option<V>
    where
        K: Borrow<Q>
;
fn filter_map_collect<T>(
        &self,
        f: impl FnMut(&K, &V) -> Option<T>
    ) -> Vec<T>;
fn get_or<E>(
        &self,
        k: K,
        vacant: impl FnOnce() -> Result<V, E>
    ) -> Result<&V, E>;
fn get_mut_or<E>(
        &mut self,
        k: K,
        vacant: impl FnOnce() -> Result<V, E>
    ) -> Result<&mut V, E>; fn get(&self, k: K) -> Option<&V> { ... }
fn get_mut(&mut self, k: K) -> Option<&mut V> { ... } }
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The functionality needed by memory to manage its allocations

Required methods

fn contains_key<Q: ?Sized + Hash + Eq>(&mut self, k: &Q) -> bool where
    K: Borrow<Q>, 

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Tests if the map contains the given key. Deliberately takes &mut because that is sufficient, and some implementations can be more efficient then (using RefCell::get_mut).

fn insert(&mut self, k: K, v: V) -> Option<V>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Inserts a new entry into the map.

fn remove<Q: ?Sized + Hash + Eq>(&mut self, k: &Q) -> Option<V> where
    K: Borrow<Q>, 

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Removes an entry from the map.

fn filter_map_collect<T>(&self, f: impl FnMut(&K, &V) -> Option<T>) -> Vec<T>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns data based on the keys and values in the map.

fn get_or<E>(
    &self,
    k: K,
    vacant: impl FnOnce() -> Result<V, E>
) -> Result<&V, E>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns a reference to entry k. If no such entry exists, call vacant and either forward its error, or add its result to the map and return a reference to that.

fn get_mut_or<E>(
    &mut self,
    k: K,
    vacant: impl FnOnce() -> Result<V, E>
) -> Result<&mut V, E>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns a mutable reference to entry k. If no such entry exists, call vacant and either forward its error, or add its result to the map and return a reference to that.

Loading content...

Provided methods

fn get(&self, k: K) -> Option<&V>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Read-only lookup.

fn get_mut(&mut self, k: K) -> Option<&mut V>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Mutable lookup.

Loading content...

Implementations on Foreign Types

impl<K: Hash + Eq, V> AllocMap<K, V> for FxHashMap<K, V>[src]

Loading content...

Implementors

Loading content...