pub type IndexSet1<T, S = RandomState> = NonEmpty<IndexSet<T, S>>;Available on crate features
indexmap and std only.Aliased Type§
pub struct IndexSet1<T, S = RandomState> { /* private fields */ }Implementations§
Source§impl<T, S> IndexSet1<T, S>
impl<T, S> IndexSet1<T, S>
Sourcepub unsafe fn from_index_set_unchecked(items: IndexSet<T, S>) -> Self
pub unsafe fn from_index_set_unchecked(items: IndexSet<T, S>) -> Self
§Safety
items must be non-empty. For example, it is unsound to call this function with the
immediate output of IndexSet::new().
pub fn try_from_ref( items: &IndexSet<T, S>, ) -> Result<&Self, EmptyError<&IndexSet<T, S>>>
pub fn try_from_mut( items: &mut IndexSet<T, S>, ) -> Result<&mut Self, EmptyError<&mut IndexSet<T, S>>>
pub fn into_index_set(self) -> IndexSet<T, S>
pub fn into_boxed_slice1(self) -> Box<Slice1<T>>
pub fn reserve(&mut self, additional: usize)
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn reserve_exact(&mut self, additional: usize)
pub fn try_reserve_exact( &mut self, additional: usize, ) -> Result<(), TryReserveError>
pub fn shrink_to(&mut self, capacity: usize)
pub fn shrink_to_fit(&mut self)
pub fn sort(&mut self)where
T: Ord,
pub fn sort_by<F>(&mut self, f: F)
pub fn sorted_by<F>(self, f: F) -> Iterator1<IntoIter<T>>
pub fn sort_unstable(&mut self)where
T: Ord,
pub fn sort_unstable_by<F>(&mut self, f: F)
pub fn sorted_unstable_by<F>(self, f: F) -> Iterator1<IntoIter<T>>
pub fn sort_by_cached_key<K, F>(&mut self, f: F)
pub fn reverse(&mut self)
pub fn split_off_tail(&mut self) -> IndexSet<T, S>where
S: Clone,
pub fn move_index(&mut self, from: usize, to: usize)
pub fn swap_indices(&mut self, a: usize, b: usize)
pub fn pop_if_many(&mut self) -> PopIfMany<'_, Self>
pub fn shift_remove_index_if_many( &mut self, index: usize, ) -> TakeRemoveIfMany<'_, Self>
pub fn swap_remove_index_if_many( &mut self, index: usize, ) -> TakeRemoveIfMany<'_, Self>
pub fn get_index(&self, index: usize) -> Option<&T>
pub fn get_range<R>(&self, range: R) -> Option<&Slice<T>>where
R: RangeBounds<usize>,
pub fn binary_search(&self, query: &T) -> Result<usize, usize>where
T: Ord,
pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
pub fn binary_search_by_key<'a, K, F>( &'a self, key: &K, f: F, ) -> Result<usize, usize>
pub fn partition_point<F>(&self, f: F) -> usize
pub fn first(&self) -> &T
pub fn last(&self) -> &T
pub fn len(&self) -> NonZeroUsize
pub fn capacity(&self) -> NonZeroUsize
pub fn iter1(&self) -> Iterator1<Iter<'_, T>>
pub fn hasher(&self) -> &S
pub const fn as_index_set(&self) -> &IndexSet<T, S>
Sourcepub const unsafe fn as_mut_index_set(&mut self) -> &mut IndexSet<T, S>
pub const unsafe fn as_mut_index_set(&mut self) -> &mut IndexSet<T, S>
§Safety
The IndexSet behind the returned mutable reference must not be empty when the
reference is dropped. Consider the following example:
use mitsein::index_set1::IndexSet1;
let mut xs = IndexSet1::from([0i32, 1, 2, 3]);
// This block is unsound. The `&mut IndexSet` is dropped in the block and so `xs` can be
// freely manipulated after the block despite violation of the non-empty guarantee.
unsafe {
xs.as_mut_index_set().clear();
}
let x = xs.first(); // Undefined behavior!pub fn as_slice1(&self) -> &Slice1<T>
Source§impl<T, S> IndexSet1<T, S>where
S: BuildHasher,
impl<T, S> IndexSet1<T, S>where
S: BuildHasher,
pub fn get<Q>(&self, query: &Q) -> Option<&T>
pub fn shift_remove_if_many<'a, 'q, Q>( &'a mut self, query: &'q Q, ) -> DropRemoveIfMany<'a, 'q, Self, Q>
pub fn swap_remove_if_many<'a, 'q, Q>( &'a mut self, query: &'q Q, ) -> DropRemoveIfMany<'a, 'q, Self, Q>
pub fn shift_remove_full_if_many<'a, 'q, Q>( &'a mut self, query: &'q Q, ) -> TakeRemoveFullIfMany<'a, 'q, Self, Q>
pub fn swap_remove_full_if_many<'a, 'q, Q>( &'a mut self, query: &'q Q, ) -> TakeRemoveFullIfMany<'a, 'q, Self, Q>
pub fn shift_take_if_many<'a, 'q, Q>( &'a mut self, query: &'q Q, ) -> TakeRemoveIfMany<'a, Self, &'q Q>
pub fn swap_take_if_many<'a, 'q, Q>( &'a mut self, query: &'q Q, ) -> TakeRemoveIfMany<'a, Self, &'q Q>
pub fn contains<Q>(&self, item: &Q) -> bool
Source§impl<T, S> IndexSet1<T, S>
impl<T, S> IndexSet1<T, S>
pub fn from_one(item: T) -> Selfwhere
S: Default,
pub fn from_one_with_hasher(item: T, hasher: S) -> Self
pub fn from_iter1_with_hasher<U>(items: U, hasher: S) -> Selfwhere
U: IntoIterator1<Item = T>,
pub fn from_head_and_tail<I>(head: T, tail: I) -> Selfwhere
S: Default,
I: IntoIterator<Item = T>,
pub fn from_rtail_and_head<I>(tail: I, head: T) -> Selfwhere
S: Default,
I: IntoIterator<Item = T>,
pub fn append<SR>(&mut self, items: &mut IndexSet<T, SR>)
pub fn insert(&mut self, item: T) -> bool
pub fn insert_full(&mut self, item: T) -> (usize, bool)
pub fn insert_sorted(&mut self, item: T) -> (usize, bool)where
T: Ord,
pub fn replace(&mut self, item: T) -> Option<T>
pub fn replace_full(&mut self, item: T) -> (usize, Option<T>)
pub fn difference<'a, R, SR>(&'a self, other: &'a R) -> Difference<'a, T, SR>where
R: ClosedIndexSet<Item = T, State = SR>,
SR: BuildHasher,
pub fn symmetric_difference<'a, R, SR>(
&'a self,
other: &'a R,
) -> SymmetricDifference<'a, T, S, SR>where
R: ClosedIndexSet<Item = T, State = SR>,
SR: BuildHasher,
pub fn intersection<'a, R, SR>(
&'a self,
other: &'a R,
) -> Intersection<'a, T, SR>where
R: ClosedIndexSet<Item = T, State = SR>,
SR: BuildHasher,
pub fn union<'a, R, SR>(&'a self, other: &'a R) -> Iterator1<Union<'a, T, S>>where
R: ClosedIndexSet<Item = T, State = SR>,
SR: 'a + BuildHasher,
pub fn is_disjoint<R, SR>(&self, other: &R) -> boolwhere
R: ClosedIndexSet<Item = T, State = SR>,
SR: BuildHasher,
pub fn is_subset<R, SR>(&self, other: &R) -> boolwhere
R: ClosedIndexSet<Item = T, State = SR>,
SR: BuildHasher,
pub fn is_superset<R, SR>(&self, other: &R) -> boolwhere
R: ClosedIndexSet<Item = T, State = SR>,
SR: BuildHasher,
Source§impl<T, S> IndexSet1<T, S>
impl<T, S> IndexSet1<T, S>
pub fn par_iter1( &self, ) -> ParallelIterator1<<&Self as IntoParallelIterator>::Iter>
Available on crate feature
rayon only.Source§impl<T, S> IndexSet1<T, S>
impl<T, S> IndexSet1<T, S>
pub fn par_difference<'a, R, SR>( &'a self, other: &'a R, ) -> ParDifference<'a, T, S, SR>
Available on crate feature
rayon only.pub fn par_symmetric_difference<'a, R, SR>( &'a self, other: &'a R, ) -> ParSymmetricDifference<'a, T, S, SR>
Available on crate feature
rayon only.pub fn par_intersection<'a, R, SR>( &'a self, other: &'a R, ) -> ParIntersection<'a, T, S, SR>
Available on crate feature
rayon only.pub fn par_union<'a, R, SR>( &'a self, other: &'a R, ) -> ParallelIterator1<ParUnion<'a, T, S, SR>>
Available on crate feature
rayon only.pub fn par_eq<R, SR>(&self, other: &R) -> bool
Available on crate feature
rayon only.pub fn par_is_disjoint<R, SR>(&self, other: &R) -> bool
Available on crate feature
rayon only.pub fn par_is_subset<R, SR>(&self, other: &R) -> bool
Available on crate feature
rayon only.pub fn par_is_superset<R, SR>(&self, other: &R) -> bool
Available on crate feature
rayon only.Source§impl<T, S> IndexSet1<T, S>
impl<T, S> IndexSet1<T, S>
pub fn par_sort(&mut self)where
T: Ord,
Available on crate feature
rayon only.pub fn par_sort_by<F>(&mut self, f: F)
Available on crate feature
rayon only.pub fn par_sorted_by<F>(self, f: F) -> ParallelIterator1<IntoParIter<T>>
Available on crate feature
rayon only.pub fn par_sort_unstable(&mut self)where
T: Ord,
Available on crate feature
rayon only.pub fn par_sort_unstable_by<F>(&mut self, f: F)
Available on crate feature
rayon only.pub fn par_sorted_unstable_by<F>( self, f: F, ) -> ParallelIterator1<IntoParIter<T>>
Available on crate feature
rayon only.pub fn par_sort_by_cached_key<K, F>(&mut self, f: F)
Available on crate feature
rayon only.Source§impl<T> IndexSet1<T, RandomState>
impl<T> IndexSet1<T, RandomState>
pub fn from_one_with_capacity(item: T, capacity: usize) -> Self
pub fn from_iter1_with_capacity<U>(items: U, capacity: usize) -> Selfwhere
U: IntoIterator1<Item = T>,
Trait Implementations§
Source§impl<'a, T> Arbitrary<'a> for IndexSet1<T>
Available on crate feature arbitrary only.
impl<'a, T> Arbitrary<'a> for IndexSet1<T>
Available on crate feature
arbitrary only.Source§fn arbitrary(unstructured: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(unstructured: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<R, T, S> BitAnd<&R> for &IndexSet1<T, S>where
R: ClosedIndexSet<Item = T>,
R::State: BuildHasher,
T: Clone + Eq + Hash,
S: BuildHasher + Default,
impl<R, T, S> BitAnd<&R> for &IndexSet1<T, S>where
R: ClosedIndexSet<Item = T>,
R::State: BuildHasher,
T: Clone + Eq + Hash,
S: BuildHasher + Default,
Source§impl<R, T, S> BitOr<&R> for &IndexSet1<T, S>where
R: ClosedIndexSet<Item = T>,
R::State: BuildHasher,
T: Clone + Eq + Hash,
S: BuildHasher + Default,
impl<R, T, S> BitOr<&R> for &IndexSet1<T, S>where
R: ClosedIndexSet<Item = T>,
R::State: BuildHasher,
T: Clone + Eq + Hash,
S: BuildHasher + Default,
Source§impl<R, T, S> BitXor<&R> for &IndexSet1<T, S>where
R: ClosedIndexSet<Item = T>,
R::State: BuildHasher,
T: Clone + Eq + Hash,
S: BuildHasher + Default,
impl<R, T, S> BitXor<&R> for &IndexSet1<T, S>where
R: ClosedIndexSet<Item = T>,
R::State: BuildHasher,
T: Clone + Eq + Hash,
S: BuildHasher + Default,
Source§impl<T, S, R> ByRange<usize, R> for IndexSet1<T, S>where
R: RangeBounds<usize>,
impl<T, S, R> ByRange<usize, R> for IndexSet1<T, S>where
R: RangeBounds<usize>,
Source§type Error = RangeError<usize>
type Error = RangeError<usize>
Available on crate features
alloc or arrayvec or heapless only.Source§impl<T, S> ByTail for IndexSet1<T, S>
impl<T, S> ByTail for IndexSet1<T, S>
Source§impl<T, S> ClosedIndexSet for IndexSet1<T, S>
impl<T, S> ClosedIndexSet for IndexSet1<T, S>
Source§impl<T, S> Extend<T> for IndexSet1<T, S>
impl<T, S> Extend<T> for IndexSet1<T, S>
Source§fn extend<I>(&mut self, extension: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, extension: I)where
I: IntoIterator<Item = T>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
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)
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<T, S> FromIterator1<T> for IndexSet1<T, S>
impl<T, S> FromIterator1<T> for IndexSet1<T, S>
fn from_iter1<I>(items: I) -> Selfwhere
I: IntoIterator1<Item = T>,
fn try_from_iter<I>(items: I) -> Result<Self, EmptyError<Peekable<I::IntoIter>>>where
Self: Sized,
I: IntoIterator<Item = T>,
Source§impl<T, S> FromParallelIterator1<T> for IndexSet1<T, S>
Available on crate feature rayon only.
impl<T, S> FromParallelIterator1<T> for IndexSet1<T, S>
Available on crate feature
rayon only.fn from_par_iter1<I>(items: I) -> Selfwhere
I: IntoParallelIterator1<Item = T>,
Source§impl<'a, T, S> IntoIterator for &'a IndexSet1<T, S>
impl<'a, T, S> IntoIterator for &'a IndexSet1<T, S>
Source§impl<T, S> IntoIterator for IndexSet1<T, S>
impl<T, S> IntoIterator for IndexSet1<T, S>
Source§impl<T, S> IntoIterator1 for &IndexSet1<T, S>
impl<T, S> IntoIterator1 for &IndexSet1<T, S>
fn into_iter1(self) -> Iterator1<Self::IntoIter>
Source§impl<T, S> IntoIterator1 for IndexSet1<T, S>
impl<T, S> IntoIterator1 for IndexSet1<T, S>
fn into_iter1(self) -> Iterator1<Self::IntoIter>
Source§impl<'a, T, S> IntoParallelIterator for &'a IndexSet1<T, S>
Available on crate feature rayon only.
impl<'a, T, S> IntoParallelIterator for &'a IndexSet1<T, S>
Available on crate feature
rayon only.Source§impl<T, S> IntoParallelIterator for IndexSet1<T, S>
Available on crate feature rayon only.
impl<T, S> IntoParallelIterator for IndexSet1<T, S>
Available on crate feature
rayon only.Source§impl<T, S> IntoParallelIterator1 for &IndexSet1<T, S>
Available on crate feature rayon only.
impl<T, S> IntoParallelIterator1 for &IndexSet1<T, S>
Available on crate feature
rayon only.fn into_par_iter1(self) -> ParallelIterator1<Self::Iter>
Source§impl<T, S> IntoParallelIterator1 for IndexSet1<T, S>
Available on crate feature rayon only.
impl<T, S> IntoParallelIterator1 for IndexSet1<T, S>
Available on crate feature
rayon only.fn into_par_iter1(self) -> ParallelIterator1<Self::Iter>
Source§impl<T, S> JsonSchema for IndexSet1<T, S>where
T: JsonSchema,
Available on crate feature schemars only.
impl<T, S> JsonSchema for IndexSet1<T, S>where
T: JsonSchema,
Available on crate feature
schemars only.Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read more