pub struct FlagVec(_);
Expand description
Structure holding a given set of features
Implementations
sourceimpl FlagVec
impl FlagVec
sourcepub fn with_capacity(upto: FlagNo) -> Self
pub fn with_capacity(upto: FlagNo) -> Self
Constructs a features vector of upto
feature flag in unset state
sourcepub fn count_flags(&self) -> u16
pub fn count_flags(&self) -> u16
Counts number of flags set
sourcepub fn as_inner(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn as_inner(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns byte slice representation of the inner data (slice of bytes, with 8 bit flags per each byte)
sourcepub fn from_inner(slice: Vec<u8>) -> Self
pub fn from_inner(slice: Vec<u8>) -> Self
Constructs flag vector from inner representation (slice of bytes, with 8 bit flags per each byte)
sourcepub fn iter(&self) -> AllSet<'_>ⓘNotable traits for AllSet<'_>impl Iterator for AllSet<'_> type Item = FlagNo;
pub fn iter(&self) -> AllSet<'_>ⓘNotable traits for AllSet<'_>impl Iterator for AllSet<'_> type Item = FlagNo;
Creates an iterator for the current feature flags which have “set” state
sourcepub fn known_iter(&self, known: FlagVec) -> FilteredIter<'_>ⓘNotable traits for FilteredIter<'_>impl Iterator for FilteredIter<'_> type Item = FlagNo;
pub fn known_iter(&self, known: FlagVec) -> FilteredIter<'_>ⓘNotable traits for FilteredIter<'_>impl Iterator for FilteredIter<'_> type Item = FlagNo;
Creates iterator over known set of the features
sourcepub fn unknown_iter(&self, known: FlagVec) -> FilteredIter<'_>ⓘNotable traits for FilteredIter<'_>impl Iterator for FilteredIter<'_> type Item = FlagNo;
pub fn unknown_iter(&self, known: FlagVec) -> FilteredIter<'_>ⓘNotable traits for FilteredIter<'_>impl Iterator for FilteredIter<'_> type Item = FlagNo;
Creates iterator over unknown set of the features, i.e. features that
do not match flags set in known
parameter
sourcepub fn shrink(&mut self) -> bool
pub fn shrink(&mut self) -> bool
Reduces the size of the internal buffer to the smallest capacity
required to keep all currently set feature flags. Returns true
if
resize operation was required, or false
otherwise, when the internal
buffer already was of the smallest possible size
sourcepub fn is_set(&self, flag_no: FlagNo) -> bool
pub fn is_set(&self, flag_no: FlagNo) -> bool
Returns whether a feature flag with flag_no
is set (true
or false
)
sourcepub fn set(&mut self, flag_no: FlagNo) -> bool
pub fn set(&mut self, flag_no: FlagNo) -> bool
Sets the feature flag with number flag_no
. Returns true
if the flag
was already set and false
otherwise (i.e. previous value of the flag)
Trait Implementations
sourceimpl Ord for FlagVec
impl Ord for FlagVec
sourceimpl PartialOrd<FlagVec> for FlagVec
impl PartialOrd<FlagVec> for FlagVec
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for FlagVec
Auto Trait Implementations
impl RefUnwindSafe for FlagVec
impl Send for FlagVec
impl Sync for FlagVec
impl Unpin for FlagVec
impl UnwindSafe for FlagVec
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more