pub struct PathFieldSet { /* private fields */ }Expand description
A set of field indices, backed by a bit set.
Used to track which fields are present in a SparseRecord
or which fields are part of a type description. Supports set operations
like union (|), intersection (&), and membership tests.
§Examples
use toasty_core::stmt::PathFieldSet;
let mut set = PathFieldSet::new();
set.insert(0);
set.insert(2);
assert!(set.contains(0_usize));
assert!(!set.contains(1_usize));
assert_eq!(set.len(), 2);Implementations§
Source§impl PathFieldSet
impl PathFieldSet
Sourcepub fn new() -> PathFieldSet
pub fn new() -> PathFieldSet
Creates an empty field set.
Sourcepub fn from_slice<T>(fields: &[T]) -> PathFieldSet
pub fn from_slice<T>(fields: &[T]) -> PathFieldSet
Creates a field set from a slice of values convertible to usize.
Sourcepub fn contains(&self, val: impl Into<usize>) -> bool
pub fn contains(&self, val: impl Into<usize>) -> bool
Returns true if the set contains the given field index.
Trait Implementations§
Source§impl BitAnd for PathFieldSet
impl BitAnd for PathFieldSet
Source§type Output = PathFieldSet
type Output = PathFieldSet
The resulting type after applying the
& operator.Source§fn bitand(self, rhs: PathFieldSet) -> PathFieldSet
fn bitand(self, rhs: PathFieldSet) -> PathFieldSet
Performs the
& operation. Read moreSource§impl BitOr for PathFieldSet
impl BitOr for PathFieldSet
Source§type Output = PathFieldSet
type Output = PathFieldSet
The resulting type after applying the
| operator.Source§fn bitor(self, rhs: PathFieldSet) -> PathFieldSet
fn bitor(self, rhs: PathFieldSet) -> PathFieldSet
Performs the
| operation. Read moreSource§impl BitOrAssign for PathFieldSet
impl BitOrAssign for PathFieldSet
Source§fn bitor_assign(&mut self, rhs: PathFieldSet)
fn bitor_assign(&mut self, rhs: PathFieldSet)
Performs the
|= operation. Read moreSource§impl Clone for PathFieldSet
impl Clone for PathFieldSet
Source§fn clone(&self) -> PathFieldSet
fn clone(&self) -> PathFieldSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathFieldSet
impl Debug for PathFieldSet
Source§impl Default for PathFieldSet
impl Default for PathFieldSet
Source§fn default() -> PathFieldSet
fn default() -> PathFieldSet
Returns the “default value” for a type. Read more
Source§impl FromIterator<usize> for PathFieldSet
impl FromIterator<usize> for PathFieldSet
Source§fn from_iter<T>(iter: T) -> PathFieldSetwhere
T: IntoIterator<Item = usize>,
fn from_iter<T>(iter: T) -> PathFieldSetwhere
T: IntoIterator<Item = usize>,
Creates a value from an iterator. Read more
Source§impl Hash for PathFieldSet
impl Hash for PathFieldSet
Source§impl PartialEq for PathFieldSet
impl PartialEq for PathFieldSet
impl Eq for PathFieldSet
impl StructuralPartialEq for PathFieldSet
Auto Trait Implementations§
impl Freeze for PathFieldSet
impl RefUnwindSafe for PathFieldSet
impl Send for PathFieldSet
impl Sync for PathFieldSet
impl Unpin for PathFieldSet
impl UnsafeUnpin for PathFieldSet
impl UnwindSafe for PathFieldSet
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.