Debian Codegraph @

src/convenience.rs

raw symbols SCIP
1 use superrust-analyzer cargo foldhash 0.2.0 crate/::fastrust-analyzer cargo foldhash 0.2.0 fast/::{FixedStaterust-analyzer cargo foldhash 0.2.0 fast/FixedState#, RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#};
2
3 /// Type alias for [`std::collections::HashMap<K, V, foldhash::fast::RandomState>`].
4 pub type HashMaprust-analyzer cargo foldhash 0.2.0 convenience/HashMap#<K, V> = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<K, V, RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#>;
5
6 /// Type alias for [`std::collections::HashSet<T, foldhash::fast::RandomState>`].
7 pub type HashSetrust-analyzer cargo foldhash 0.2.0 convenience/HashSet#<T> = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#<T, RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#>;
8
9 /// A convenience extension trait to enable [`HashMap::new`] for hash maps that use `foldhash`.
10 pub trait HashMapExtrust-analyzer cargo foldhash 0.2.0 convenience/HashMapExt# {
11 /// Creates an empty `HashMap`.
12 fn newrust-analyzer cargo foldhash 0.2.0 convenience/HashMapExt#new().() -> Self;
13
14 /// Creates an empty `HashMap` with at least the specified capacity.
15 fn with_capacityrust-analyzer cargo foldhash 0.2.0 convenience/HashMapExt#with_capacity().(capacity: usize) -> Self;
16 }
17
18 impl<K, V> HashMapExtrust-analyzer cargo foldhash 0.2.0 convenience/HashMapExt# for stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<K, V, RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#> {
19 #[inline(always)]
20 fn newrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, RandomState>`][HashMapExt]new().() -> Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, RandomState>`][HashMapExt] {
21 Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, RandomState>`][HashMapExt]::with_hasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S>`]with_hasher().(RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#::defaultrust-analyzer cargo foldhash 0.2.0 fast/impl#[RandomState][Default]default().())
22 }
23
24 #[inline(always)]
25 fn with_capacityrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, RandomState>`][HashMapExt]with_capacity().(capacity: usize) -> Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, RandomState>`][HashMapExt] {
26 Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, RandomState>`][HashMapExt]::with_capacity_and_hasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S>`]with_capacity_and_hasher().(capacity, RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#::defaultrust-analyzer cargo foldhash 0.2.0 fast/impl#[RandomState][Default]default().())
27 }
28 }
29
30 impl<K, V> HashMapExtrust-analyzer cargo foldhash 0.2.0 convenience/HashMapExt# for stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<K, V, FixedStaterust-analyzer cargo foldhash 0.2.0 fast/FixedState#> {
31 #[inline(always)]
32 fn newrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, FixedState>`][HashMapExt]new().() -> Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, FixedState>`][HashMapExt] {
33 Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, FixedState>`][HashMapExt]::with_hasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S>`]with_hasher().(FixedStaterust-analyzer cargo foldhash 0.2.0 fast/FixedState#::defaultrust-analyzer cargo foldhash 0.2.0 fast/impl#[FixedState][Default]default().())
34 }
35
36 #[inline(always)]
37 fn with_capacityrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, FixedState>`][HashMapExt]with_capacity().(capacity: usize) -> Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, FixedState>`][HashMapExt] {
38 Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashMap<K, V, FixedState>`][HashMapExt]::with_capacity_and_hasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S>`]with_capacity_and_hasher().(capacity, FixedStaterust-analyzer cargo foldhash 0.2.0 fast/FixedState#::defaultrust-analyzer cargo foldhash 0.2.0 fast/impl#[FixedState][Default]default().())
39 }
40 }
41
42 /// A convenience extension trait to enable [`HashSet::new`] for hash sets that use `foldhash`.
43 pub trait HashSetExtrust-analyzer cargo foldhash 0.2.0 convenience/HashSetExt# {
44 /// Creates an empty `HashSet`.
45 fn newrust-analyzer cargo foldhash 0.2.0 convenience/HashSetExt#new().() -> Self;
46
47 /// Creates an empty `HashSet` with at least the specified capacity.
48 fn with_capacityrust-analyzer cargo foldhash 0.2.0 convenience/HashSetExt#with_capacity().(capacity: usize) -> Self;
49 }
50
51 impl<T> HashSetExtrust-analyzer cargo foldhash 0.2.0 convenience/HashSetExt# for stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#<T, RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#> {
52 #[inline(always)]
53 fn newrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, RandomState>`][HashSetExt]new().() -> Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, RandomState>`][HashSetExt] {
54 Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, RandomState>`][HashSetExt]::with_hasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S>`]with_hasher().(RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#::defaultrust-analyzer cargo foldhash 0.2.0 fast/impl#[RandomState][Default]default().())
55 }
56
57 #[inline(always)]
58 fn with_capacityrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, RandomState>`][HashSetExt]with_capacity().(capacity: usize) -> Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, RandomState>`][HashSetExt] {
59 Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, RandomState>`][HashSetExt]::with_capacity_and_hasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S>`]with_capacity_and_hasher().(capacity, RandomStaterust-analyzer cargo foldhash 0.2.0 fast/RandomState#::defaultrust-analyzer cargo foldhash 0.2.0 fast/impl#[RandomState][Default]default().())
60 }
61 }
62
63 impl<T> HashSetExtrust-analyzer cargo foldhash 0.2.0 convenience/HashSetExt# for stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#<T, FixedStaterust-analyzer cargo foldhash 0.2.0 fast/FixedState#> {
64 #[inline(always)]
65 fn newrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, FixedState>`][HashSetExt]new().() -> Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, FixedState>`][HashSetExt] {
66 Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, FixedState>`][HashSetExt]::with_hasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S>`]with_hasher().(FixedStaterust-analyzer cargo foldhash 0.2.0 fast/FixedState#::defaultrust-analyzer cargo foldhash 0.2.0 fast/impl#[FixedState][Default]default().())
67 }
68
69 #[inline(always)]
70 fn with_capacityrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, FixedState>`][HashSetExt]with_capacity().(capacity: usize) -> Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, FixedState>`][HashSetExt] {
71 Selfrust-analyzer cargo foldhash 0.2.0 convenience/impl#[`std::collections::HashSet<T, FixedState>`][HashSetExt]::with_capacity_and_hasherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S>`]with_capacity_and_hasher().(capacity, FixedStaterust-analyzer cargo foldhash 0.2.0 fast/FixedState#::defaultrust-analyzer cargo foldhash 0.2.0 fast/impl#[FixedState][Default]default().())
72 }
73 }