Type Alias arrow2::io::ipc::read::Dictionaries

source ·
pub type Dictionaries = AHashMap<i64, Box<dyn Array>>;
Expand description

how dictionaries are tracked in this crate

Aliased Type§

struct Dictionaries(/* private fields */);

Implementations

source§

impl<K, V> AHashMap<K, V>

source

pub fn new() -> AHashMap<K, V>

This crates a hashmap using RandomState::new which obtains its keys from [RandomSource]. See the documentation in [RandomSource] for notes about key strength.

source

pub fn with_capacity(capacity: usize) -> AHashMap<K, V>

This crates a hashmap with the specified capacity using RandomState::new. See the documentation in [RandomSource] for notes about key strength.

source§

impl<K, V, S> AHashMap<K, V, S>
where S: BuildHasher,

source

pub fn with_hasher(hash_builder: S) -> AHashMap<K, V, S>

source

pub fn with_capacity_and_hasher( capacity: usize, hash_builder: S ) -> AHashMap<K, V, S>

source§

impl<K, V, S> AHashMap<K, V, S>
where K: Hash + Eq, S: BuildHasher,

source

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

Returns a reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed form must match those for the key type.

§Examples
use std::collections::HashMap;

let mut map = HashMap::new();
map.insert(1, "a");
assert_eq!(map.get(&1), Some(&"a"));
assert_eq!(map.get(&2), None);
source

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

Returns the key-value pair corresponding to the supplied key.

The supplied key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed form must match those for the key type.

§Examples
use std::collections::HashMap;

let mut map = HashMap::new();
map.insert(1, "a");
assert_eq!(map.get_key_value(&1), Some((&1, &"a")));
assert_eq!(map.get_key_value(&2), None);
source

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

Returns a mutable reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed form must match those for the key type.

§Examples
use std::collections::HashMap;

let mut map = HashMap::new();
map.insert(1, "a");
if let Some(x) = map.get_mut(&1) {
    *x = "b";
}
assert_eq!(map[&1], "b");
source

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

Inserts a key-value pair into the map.

If the map did not have this key present, None is returned.

If the map did have this key present, the value is updated, and the old value is returned. The key is not updated, though; this matters for types that can be == without being identical. See the [module-level documentation] for more.

§Examples
use std::collections::HashMap;

let mut map = HashMap::new();
assert_eq!(map.insert(37, "a"), None);
assert_eq!(map.is_empty(), false);

map.insert(37, "b");
assert_eq!(map.insert(37, "c"), Some("b"));
assert_eq!(map[&37], "c");
source

pub fn into_keys(self) -> IntoKeys<K, V>

Creates a consuming iterator visiting all the keys in arbitrary order. The map cannot be used after calling this. The iterator element type is K.

§Examples
use std::collections::HashMap;

let map = HashMap::from([
    ("a", 1),
    ("b", 2),
    ("c", 3),
]);

let mut vec: Vec<&str> = map.into_keys().collect();
// The `IntoKeys` iterator produces keys in arbitrary order, so the
// keys must be sorted to test them against a sorted array.
vec.sort_unstable();
assert_eq!(vec, ["a", "b", "c"]);
§Performance

In the current implementation, iterating over keys takes O(capacity) time instead of O(len) because it internally visits empty buckets too.

source

pub fn into_values(self) -> IntoValues<K, V>

Creates a consuming iterator visiting all the values in arbitrary order. The map cannot be used after calling this. The iterator element type is V.

§Examples
use std::collections::HashMap;

let map = HashMap::from([
    ("a", 1),
    ("b", 2),
    ("c", 3),
]);

let mut vec: Vec<i32> = map.into_values().collect();
// The `IntoValues` iterator produces values in arbitrary order, so
// the values must be sorted to test them against a sorted array.
vec.sort_unstable();
assert_eq!(vec, [1, 2, 3]);
§Performance

In the current implementation, iterating over values takes O(capacity) time instead of O(len) because it internally visits empty buckets too.

source

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

Removes a key from the map, returning the value at the key if the key was previously in the map.

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed form must match those for the key type.

§Examples
use std::collections::HashMap;

let mut map = HashMap::new();
map.insert(1, "a");
assert_eq!(map.remove(&1), Some("a"));
assert_eq!(map.remove(&1), None);

Trait Implementations

source§

impl<K, V, S> Clone for AHashMap<K, V, S>
where K: Clone, V: Clone, S: Clone,

source§

fn clone(&self) -> AHashMap<K, V, S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, V, S> Debug for AHashMap<K, V, S>
where K: Debug, V: Debug, S: BuildHasher,

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<K, V> Default for AHashMap<K, V>

NOTE: For safety this trait impl is only available available if either of the flags runtime-rng (on by default) or compile-time-rng are enabled. This is to prevent weakly keyed maps from being accidentally created. Instead one of constructors for RandomState must be used.

source§

fn default() -> AHashMap<K, V>

Returns the “default value” for a type. Read more
source§

impl<K, V, S> Deref for AHashMap<K, V, S>

§

type Target = HashMap<K, V, S>

The resulting type after dereferencing.
source§

fn deref(&self) -> &<AHashMap<K, V, S> as Deref>::Target

Dereferences the value.
source§

impl<K, V, S> DerefMut for AHashMap<K, V, S>

source§

fn deref_mut(&mut self) -> &mut <AHashMap<K, V, S> as Deref>::Target

Mutably dereferences the value.
source§

impl<'a, K, V, S> Extend<(&'a K, &'a V)> for AHashMap<K, V, S>
where K: Eq + Hash + Copy + 'a, V: Copy + 'a, S: BuildHasher,

source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S> Extend<(K, V)> for AHashMap<K, V, S>
where K: Eq + Hash, S: BuildHasher,

source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, const N: usize> From<[(K, V); N]> for AHashMap<K, V>
where K: Eq + Hash,

source§

fn from(arr: [(K, V); N]) -> AHashMap<K, V>

§Examples
use ahash::AHashMap;

let map1 = AHashMap::from([(1, 2), (3, 4)]);
let map2: AHashMap<_, _> = [(1, 2), (3, 4)].into();
assert_eq!(map1, map2);
source§

impl<K, V> From<HashMap<K, V, RandomState>> for AHashMap<K, V>

source§

fn from(item: HashMap<K, V, RandomState>) -> AHashMap<K, V>

Converts to this type from the input type.
source§

impl<K, V> FromIterator<(K, V)> for AHashMap<K, V>
where K: Eq + Hash,

source§

fn from_iter<T>(iter: T) -> AHashMap<K, V>
where T: IntoIterator<Item = (K, V)>,

This crates a hashmap from the provided iterator using RandomState::new. See the documentation in [RandomSource] for notes about key strength.

source§

impl<K, Q, V, S> Index<&Q> for AHashMap<K, V, S>
where K: Eq + Hash + Borrow<Q>, Q: Eq + Hash + ?Sized, S: BuildHasher,

source§

fn index(&self, key: &Q) -> &V

Returns a reference to the value corresponding to the supplied key.

§Panics

Panics if the key is not present in the HashMap.

§

type Output = V

The returned type after indexing.
source§

impl<K, V> Into<HashMap<K, V, RandomState>> for AHashMap<K, V>

source§

fn into(self) -> HashMap<K, V, RandomState>

Converts this type into the (usually inferred) input type.
source§

impl<K, V, S> IntoIterator for AHashMap<K, V, S>

§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <AHashMap<K, V, S> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, S> PartialEq for AHashMap<K, V, S>
where K: Eq + Hash, V: PartialEq, S: BuildHasher,

source§

fn eq(&self, other: &AHashMap<K, V, S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K, V, S> Eq for AHashMap<K, V, S>
where K: Eq + Hash, V: Eq, S: BuildHasher,

source§

impl<K, V, S> UnwindSafe for AHashMap<K, V, S>
where K: UnwindSafe, V: UnwindSafe,