Struct sqlite3_parser::ast::DistinctNames
source · pub struct DistinctNames(/* private fields */);
Expand description
Ordered set of distinct column names
Implementations§
source§impl DistinctNames
impl DistinctNames
sourcepub fn new(name: Name) -> DistinctNames
pub fn new(name: Name) -> DistinctNames
Initialize
sourcepub fn single(name: Name) -> DistinctNames
pub fn single(name: Name) -> DistinctNames
Single column name
Methods from Deref<Target = IndexSet<Name>>§
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Return the number of elements the set can hold without reallocating.
This number is a lower bound; the set might be able to hold more, but is guaranteed to be able to hold at least this many.
Computes in O(1) time.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the set contains no elements.
Computes in O(1) time.
sourcepub fn iter(&self) -> Iter<'_, T>
pub fn iter(&self) -> Iter<'_, T>
Return an iterator over the values of the set, in their order
sourcepub fn difference<'a, S2>(
&'a self,
other: &'a IndexSet<T, S2>,
) -> Difference<'a, T, S2>where
S2: BuildHasher,
pub fn difference<'a, S2>(
&'a self,
other: &'a IndexSet<T, S2>,
) -> Difference<'a, T, S2>where
S2: BuildHasher,
Return an iterator over the values that are in self
but not other
.
Values are produced in the same order that they appear in self
.
sourcepub fn symmetric_difference<'a, S2>(
&'a self,
other: &'a IndexSet<T, S2>,
) -> SymmetricDifference<'a, T, S, S2>where
S2: BuildHasher,
pub fn symmetric_difference<'a, S2>(
&'a self,
other: &'a IndexSet<T, S2>,
) -> SymmetricDifference<'a, T, S, S2>where
S2: BuildHasher,
Return an iterator over the values that are in self
or other
,
but not in both.
Values from self
are produced in their original order, followed by
values from other
in their original order.
sourcepub fn intersection<'a, S2>(
&'a self,
other: &'a IndexSet<T, S2>,
) -> Intersection<'a, T, S2>where
S2: BuildHasher,
pub fn intersection<'a, S2>(
&'a self,
other: &'a IndexSet<T, S2>,
) -> Intersection<'a, T, S2>where
S2: BuildHasher,
Return an iterator over the values that are in both self
and other
.
Values are produced in the same order that they appear in self
.
sourcepub fn union<'a, S2>(&'a self, other: &'a IndexSet<T, S2>) -> Union<'a, T, S>where
S2: BuildHasher,
pub fn union<'a, S2>(&'a self, other: &'a IndexSet<T, S2>) -> Union<'a, T, S>where
S2: BuildHasher,
Return an iterator over all values that are in self
or other
.
Values from self
are produced in their original order, followed by
values that are unique to other
in their original order.
sourcepub fn contains<Q>(&self, value: &Q) -> bool
pub fn contains<Q>(&self, value: &Q) -> bool
Return true
if an equivalent to value
exists in the set.
Computes in O(1) time (average).
sourcepub fn get<Q>(&self, value: &Q) -> Option<&T>
pub fn get<Q>(&self, value: &Q) -> Option<&T>
Return a reference to the value stored in the set, if it is present,
else None
.
Computes in O(1) time (average).
sourcepub fn get_index_of<Q>(&self, value: &Q) -> Option<usize>
pub fn get_index_of<Q>(&self, value: &Q) -> Option<usize>
Return item index, if it exists in the set
Computes in O(1) time (average).
sourcepub fn binary_search(&self, x: &T) -> Result<usize, usize>where
T: Ord,
pub fn binary_search(&self, x: &T) -> Result<usize, usize>where
T: Ord,
Search over a sorted set for a value.
Returns the position where that value is present, or the position where it can be inserted
to maintain the sort. See slice::binary_search
for more details.
Computes in O(log(n)) time, which is notably less scalable than looking the value up
using get_index_of
, but this can also position missing values.
sourcepub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
Search over a sorted set with a comparator function.
Returns the position where that value is present, or the position where it can be inserted
to maintain the sort. See slice::binary_search_by
for more details.
Computes in O(log(n)) time.
sourcepub fn binary_search_by_key<'a, B, F>(
&'a self,
b: &B,
f: F,
) -> Result<usize, usize>
pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F, ) -> Result<usize, usize>
Search over a sorted set with an extraction function.
Returns the position where that value is present, or the position where it can be inserted
to maintain the sort. See slice::binary_search_by_key
for more details.
Computes in O(log(n)) time.
sourcepub fn partition_point<P>(&self, pred: P) -> usize
pub fn partition_point<P>(&self, pred: P) -> usize
Returns the index of the partition point of a sorted set according to the given predicate (the index of the first element of the second partition).
See slice::partition_point
for more details.
Computes in O(log(n)) time.
sourcepub fn as_slice(&self) -> &Slice<T>
pub fn as_slice(&self) -> &Slice<T>
Returns a slice of all the values in the set.
Computes in O(1) time.
sourcepub fn get_index(&self, index: usize) -> Option<&T>
pub fn get_index(&self, index: usize) -> Option<&T>
Get a value by index
Valid indices are 0 <= index < self.len()
Computes in O(1) time.
sourcepub fn get_range<R>(&self, range: R) -> Option<&Slice<T>>where
R: RangeBounds<usize>,
pub fn get_range<R>(&self, range: R) -> Option<&Slice<T>>where
R: RangeBounds<usize>,
Returns a slice of values in the given range of indices.
Valid indices are 0 <= index < self.len()
Computes in O(1) time.
sourcepub fn is_disjoint<S2>(&self, other: &IndexSet<T, S2>) -> boolwhere
S2: BuildHasher,
pub fn is_disjoint<S2>(&self, other: &IndexSet<T, S2>) -> boolwhere
S2: BuildHasher,
Returns true
if self
has no elements in common with other
.
sourcepub fn is_subset<S2>(&self, other: &IndexSet<T, S2>) -> boolwhere
S2: BuildHasher,
pub fn is_subset<S2>(&self, other: &IndexSet<T, S2>) -> boolwhere
S2: BuildHasher,
Returns true
if all elements of self
are contained in other
.
sourcepub fn is_superset<S2>(&self, other: &IndexSet<T, S2>) -> boolwhere
S2: BuildHasher,
pub fn is_superset<S2>(&self, other: &IndexSet<T, S2>) -> boolwhere
S2: BuildHasher,
Returns true
if all elements of other
are contained in self
.
Trait Implementations§
source§impl Clone for DistinctNames
impl Clone for DistinctNames
source§fn clone(&self) -> DistinctNames
fn clone(&self) -> DistinctNames
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DistinctNames
impl Debug for DistinctNames
source§impl Deref for DistinctNames
impl Deref for DistinctNames
source§impl PartialEq for DistinctNames
impl PartialEq for DistinctNames
source§fn eq(&self, other: &DistinctNames) -> bool
fn eq(&self, other: &DistinctNames) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for DistinctNames
impl StructuralPartialEq for DistinctNames
Auto Trait Implementations§
impl Freeze for DistinctNames
impl RefUnwindSafe for DistinctNames
impl Send for DistinctNames
impl Sync for DistinctNames
impl Unpin for DistinctNames
impl UnwindSafe for DistinctNames
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.