[−][src]Struct rpds::set::hash_trie_set::HashTrieSet
A persistent set with structural sharing. This implementation uses a hash array mapped trie.
Complexity
Let n be the number of elements in the set.
Temporal complexity
Operation | Average | Worst case |
---|---|---|
new() | Θ(1) | Θ(1) |
insert() | Θ(1) | Θ(n) |
remove() | Θ(1) | Θ(n) |
contains() | Θ(1) | Θ(n) |
size() | Θ(1) | Θ(1) |
clone() | Θ(1) | Θ(1) |
iterator creation | Θ(1) | Θ(1) |
iterator step | Θ(1) | Θ(1) |
iterator full | Θ(n) | Θ(n) |
Implementation details
This is a thin wrapper around a HashTrieMap
.
Methods
impl<T> HashTrieSet<T, RandomState> where
T: Eq + Hash,
[src]
T: Eq + Hash,
#[must_use]
pub fn new() -> HashTrieSet<T>
[src]
#[must_use]
pub fn new() -> HashTrieSet<T>pub fn new_with_degree(degree: u8) -> HashTrieSet<T>
[src]
impl<T, H: BuildHasher> HashTrieSet<T, H> where
T: Eq + Hash,
H: Clone,
[src]
T: Eq + Hash,
H: Clone,
pub fn new_with_hasher(hasher_builder: H) -> HashTrieSet<T, H>
[src]
pub fn new_with_hasher_and_degree(
hasher_builder: H,
degree: u8
) -> HashTrieSet<T, H>
[src]
hasher_builder: H,
degree: u8
) -> HashTrieSet<T, H>
#[must_use]
pub fn insert(&self, v: T) -> HashTrieSet<T, H>
[src]
#[must_use]
pub fn insert(&self, v: T) -> HashTrieSet<T, H>pub fn insert_mut(&mut self, v: T)
[src]
#[must_use]
pub fn remove<V: ?Sized>(&self, v: &V) -> HashTrieSet<T, H> where
T: Borrow<V>,
V: Hash + Eq,
[src]
#[must_use]
pub fn remove<V: ?Sized>(&self, v: &V) -> HashTrieSet<T, H> whereT: Borrow<V>,
V: Hash + Eq,
pub fn remove_mut<V: ?Sized>(&mut self, v: &V) -> bool where
T: Borrow<V>,
V: Hash + Eq,
[src]
T: Borrow<V>,
V: Hash + Eq,
#[must_use]
pub fn contains<V: ?Sized>(&self, v: &V) -> bool where
T: Borrow<V>,
V: Hash + Eq,
[src]
#[must_use]
pub fn contains<V: ?Sized>(&self, v: &V) -> bool whereT: Borrow<V>,
V: Hash + Eq,
#[must_use]
pub fn is_disjoint<I: BuildHasher + Clone>(
&self,
other: &HashTrieSet<T, I>
) -> bool
[src]
#[must_use]
pub fn is_disjoint<I: BuildHasher + Clone>(&self,
other: &HashTrieSet<T, I>
) -> bool
#[must_use]
pub fn is_subset<I: BuildHasher + Clone>(
&self,
other: &HashTrieSet<T, I>
) -> bool
[src]
#[must_use]
pub fn is_subset<I: BuildHasher + Clone>(&self,
other: &HashTrieSet<T, I>
) -> bool
#[must_use]
pub fn is_superset<I: BuildHasher + Clone>(
&self,
other: &HashTrieSet<T, I>
) -> bool
[src]
#[must_use]
pub fn is_superset<I: BuildHasher + Clone>(&self,
other: &HashTrieSet<T, I>
) -> bool
#[must_use]
pub fn size(&self) -> usize
[src]
#[must_use]
pub fn size(&self) -> usize#[must_use]
pub fn is_empty(&self) -> bool
[src]
#[must_use]
pub fn is_empty(&self) -> bool#[must_use]
pub fn iter(&self) -> Iter<T>
[src]
#[must_use]
pub fn iter(&self) -> Iter<T>Trait Implementations
impl<T, H: BuildHasher> Default for HashTrieSet<T, H> where
T: Eq + Hash,
H: Default + Clone,
[src]
T: Eq + Hash,
H: Default + Clone,
fn default() -> HashTrieSet<T, H>
[src]
impl<T: Eq, H: BuildHasher> PartialEq<HashTrieSet<T, H>> for HashTrieSet<T, H> where
T: Hash,
H: Clone,
[src]
T: Hash,
H: Clone,
fn eq(&self, other: &HashTrieSet<T, H>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=
.
impl<T: Eq, H: BuildHasher> Eq for HashTrieSet<T, H> where
T: Hash,
H: Clone,
[src]
T: Hash,
H: Clone,
impl<T, H: BuildHasher> Clone for HashTrieSet<T, H> where
T: Eq + Hash,
H: Clone,
[src]
T: Eq + Hash,
H: Clone,
fn clone(&self) -> HashTrieSet<T, H>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, T, H: BuildHasher> IntoIterator for &'a HashTrieSet<T, H> where
T: Eq + Hash,
H: Default + Clone,
[src]
T: Eq + Hash,
H: Default + Clone,
type Item = &'a T
The type of the elements being iterated over.
type IntoIter = Iter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Iter<'a, T>
[src]
impl<T: Debug, H: Debug + BuildHasher> Debug for HashTrieSet<T, H> where
T: Eq + Hash,
H: Clone,
[src]
T: Eq + Hash,
H: Clone,
impl<T, H: BuildHasher> Display for HashTrieSet<T, H> where
T: Eq + Hash + Display,
H: Clone,
[src]
T: Eq + Hash + Display,
H: Clone,
impl<T, H> FromIterator<T> for HashTrieSet<T, H> where
T: Eq + Hash,
H: BuildHasher + Clone + Default,
[src]
T: Eq + Hash,
H: BuildHasher + Clone + Default,
fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> HashTrieSet<T, H>
[src]
impl<T, H> Serialize for HashTrieSet<T, H> where
T: Eq + Hash + Serialize,
H: BuildHasher + Clone + Default,
[src]
T: Eq + Hash + Serialize,
H: BuildHasher + Clone + Default,
impl<'de, T, H> Deserialize<'de> for HashTrieSet<T, H> where
T: Eq + Hash + Deserialize<'de>,
H: BuildHasher + Clone + Default,
[src]
T: Eq + Hash + Deserialize<'de>,
H: BuildHasher + Clone + Default,
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<HashTrieSet<T, H>, D::Error>
[src]
deserializer: D
) -> Result<HashTrieSet<T, H>, D::Error>
Auto Trait Implementations
impl<T, H> Send for HashTrieSet<T, H> where
H: Send,
T: Send + Sync,
H: Send,
T: Send + Sync,
impl<T, H> Sync for HashTrieSet<T, H> where
H: Sync,
T: Send + Sync,
H: Sync,
T: Send + Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,