Struct rustc_data_structures::lazy_btree_map::LazyBTreeMap[][src]

pub struct LazyBTreeMap<K, V>(Option<BTreeMap<K, V>>);
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

A thin wrapper around BTreeMap that avoids allocating upon creation.

Vec, HashSet and HashMap all have the nice feature that they don't do any heap allocation when creating a new structure of the default size. In contrast, BTreeMap does allocate in that situation. The compiler uses B-Tree maps in some places such that many maps are created but few are inserted into, so having a BTreeMap alternative that avoids allocating on creation is a performance win.

Only a fraction of BTreeMap's functionality is currently supported. Additional functionality should be added on demand.

Methods

impl<K, V> LazyBTreeMap<K, V>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Important traits for Iter<'a, K, V>

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

impl<K: Ord, V> LazyBTreeMap<K, V>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Important traits for Values<'a, K, V>

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Trait Implementations

impl<K: Debug, V: Debug> Debug for LazyBTreeMap<K, V>
[src]

Formats the value using the given formatter. Read more

impl<K: Ord, V> Default for LazyBTreeMap<K, V>
[src]

Returns the "default value" for a type. Read more

impl<'a, K: 'a, V: 'a> IntoIterator for &'a LazyBTreeMap<K, V>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Important traits for Iter<'a, K, V>

Creates an iterator from a value. Read more

Auto Trait Implementations

impl<K, V> Send for LazyBTreeMap<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for LazyBTreeMap<K, V> where
    K: Sync,
    V: Sync