wiwi_chain/
types.rs

1use crate::Chain;
2
3pub type ArrayChain<T, const N: usize> = Chain<[T; N]>;
4pub type ArrayMutChain<'h, T, const N: usize> = Chain<&'h mut [T; N]>;
5
6pub type BTreeMapChain<K, V> = Chain<std::collections::BTreeMap<K, V>>;
7pub type BTreeMapMutChain<'h, K, V> = Chain<&'h mut std::collections::BTreeMap<K, V>>;
8
9pub type BTreeSetChain<T> = Chain<std::collections::BTreeSet<T>>;
10pub type BTreeSetMutChain<'h, T> = Chain<&'h mut std::collections::BTreeSet<T>>;
11
12pub type HashMapChain<K, V, S = std::hash::RandomState> = Chain<std::collections::HashMap<K, V, S>>;
13pub type HashMapMutChain<'h, K, V, S = std::hash::RandomState> = Chain<&'h mut std::collections::HashMap<K, V, S>>;
14
15pub type HashSetChain<T, S = std::hash::RandomState> = Chain<std::collections::HashSet<T, S>>;
16pub type HashSetMutChain<'h, T, S = std::hash::RandomState> = Chain<&'h mut std::collections::HashSet<T, S>>;
17
18pub type StringChain = Chain<String>;
19pub type StringMutChain<'h> = Chain<&'h mut String>;
20
21pub type VecChain<T> = Chain<Vec<T>>;
22pub type VecMutChain<'h, T> = Chain<&'h mut Vec<T>>;
23
24#[cfg(feature = "hashbrown")]
25pub mod hashbrown {
26	use crate::Chain;
27
28	pub type HashMapChain<K, V, S = hashbrown::DefaultHashBuilder> = Chain<hashbrown::HashMap<K, V, S>>;
29	pub type HashMapMutChain<'h, K, V, S = hashbrown::DefaultHashBuilder> = Chain<&'h mut hashbrown::HashMap<K, V, S>>;
30
31	pub type HashSetChain<T, S = hashbrown::DefaultHashBuilder> = Chain<hashbrown::HashSet<T, S>>;
32	pub type HashSetMutChain<'h, T, S = hashbrown::DefaultHashBuilder> = Chain<&'h mut hashbrown::HashSet<T, S>>;
33}