devela/data/collections/
reexports.rsuse crate::reexport;
#[cfg(feature = "alloc")]
mod impls_alloc {
use super::*;
use crate::impl_cdef;
impl_cdef![<T> Self::new() => BTreeSet<T>, LinkedList<T>, Vec<T>, VecDeque<T>];
impl_cdef![<K, V> Self::new() => BTreeMap<K, V>];
}
reexport! { rust: core::array,
tag: crate::TAG_ITERATOR!(),
doc: "A by-value [array] iterator.",
@IntoIter as ArrayIntoIter
}
reexport! { rust: core::array,
doc: "Creates an array `[T; N]`, where each `T` is returned from `cb` from its index.",
@from_fn as array_from_fn
}
reexport! { rust: core::array,
doc: "Converts a mutable reference to `T` into `&mut [T; 1]` (without copying).",
@from_mut as array_from_mut
}
reexport! { rust: core::array,
doc: "Converts a reference to `T` into `&[T; 1]` (without copying).",
@from_ref as array_from_ref
}
reexport! { rust: alloc::collections,
doc: "A doubly-linked list with owned nodes.",
LinkedList
}
reexport! { rust: alloc::collections,
doc: "An ordered map based on a B-Tree.",
BTreeMap
}
reexport! { rust: alloc::collections::btree_map,
doc: "An ordered map based on a B-Tree.",
@Entry as BTreeMapEntry
}
reexport! { rust: alloc::collections,
doc: "An ordered set based on a B-Tree.",
BTreeSet
}
reexport! { rust: alloc::collections,
doc: "A priority queue implemented with a binary heap.",
BinaryHeap
}
reexport! { rust: alloc::vec,
doc: "A contiguous growable array.",
Vec
}
reexport! { rust: alloc::collections,
doc: "A double-ended growable queue.",
VecDeque
}
#[doc = "*Re-exported from [`alloc::vec`][macro@crate::_dep::_alloc::vec]*."]
#[doc = "\n\n---"]
#[macro_export]
#[cfg(feature = "alloc")]
#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "alloc")))]
#[cfg_attr(cargo_primary_package, doc(hidden))]
macro_rules! vec_ { ($($tt:tt)*) => { $crate::_dep::_alloc::vec![$($tt)*] } }
#[cfg(feature = "alloc")]
#[doc(inline)]
pub use vec_;
#[allow(unused_macros)]
macro_rules! hashbrown_or_std {
(start) => {
"<span class='stab portability'
title='re-exported from either `hashbrown` or `std`'>`std?`</span>"
};
(end) => {
"\n\n*Re-exported from either the [`hashmap`](https://docs.rs/hasmap) crate
or from [`std::collections`](https::doc.rust-lang.org/std/collections)*.
\n\n---"
};
}
#[allow(unused_imports)]
use hashbrown_or_std;
#[cfg(feature = "dep_hashbrown")]
pub use hashbrown_reexports::*;
#[cfg(feature = "dep_hashbrown")]
mod hashbrown_reexports {
use super::hashbrown_or_std;
#[doc = hashbrown_or_std!(start)]
#[doc = hashbrown_or_std!(end)]
#[cfg_attr(
feature = "nightly_doc",
doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
)]
pub use crate::_dep::hashbrown::HashMap;
#[doc = hashbrown_or_std!(start)]
#[doc = hashbrown_or_std!(end)]
#[cfg_attr(
feature = "nightly_doc",
doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
)]
pub use crate::_dep::hashbrown::hash_map::Entry as HashMapEntry;
#[doc = hashbrown_or_std!(start)]
#[doc = hashbrown_or_std!(end)]
#[cfg_attr(
feature = "nightly_doc",
doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
)]
pub use crate::_dep::hashbrown::HashSet;
}
#[cfg(all(not(feature = "dep_hashbrown"), feature = "std"))]
pub use std_reexports::*;
#[cfg(all(not(feature = "dep_hashbrown"), feature = "std"))]
mod std_reexports {
use super::hashbrown_or_std;
#[doc = hashbrown_or_std!(start)]
#[doc = hashbrown_or_std!(end)]
#[cfg_attr(
feature = "nightly_doc",
doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
)]
pub use std::collections::hash_map::HashMap;
#[doc = hashbrown_or_std!(start)]
#[doc = hashbrown_or_std!(end)]
#[cfg_attr(
feature = "nightly_doc",
doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
)]
pub use std::collections::hash_map::Entry as HashMapEntry;
#[doc = hashbrown_or_std!(start)]
#[doc = hashbrown_or_std!(end)]
#[cfg_attr(
feature = "nightly_doc",
doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
)]
pub use std::collections::HashSet;
}
#[cfg(feature = "std")]
#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "std")))]
pub type HashMapStd<K, V> = std::collections::HashMap<K, V>;
#[cfg(feature = "std")]
#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "std")))]
pub type HashSetStd<T> = std::collections::HashSet<T>;
#[cfg(all(feature = "hash", any(feature = "std", feature = "dep_hashbrown")))]
pub use aliases::*;
#[cfg(all(feature = "hash", any(feature = "std", feature = "dep_hashbrown")))]
#[cfg_attr(
feature = "nightly_doc",
doc(cfg(all(
feature = "hash",
any(feature = "std", all(feature = "dep_hashbrown", feature = "hash"))
)))
)]
mod aliases {
use super::{HashMap, HashSet};
use crate::HasherBuildFx;
pub type HashMapFx<K, V> = HashMap<K, V, HasherBuildFx>;
pub type HashSetFx<T> = HashSet<T, HasherBuildFx>;
}