Struct amplify::flags::FlagVec [−][src]
pub struct FlagVec(_);
Expand description
Structure holding a given set of features
Implementations
impl FlagVec
[src]
impl FlagVec
[src]pub fn with_capacity(upto: FlagNo) -> Self
[src]
pub fn with_capacity(upto: FlagNo) -> Self
[src]Constructs a features vector of upto
feature flag in unset state
pub fn as_inner(&self) -> &[u8]
[src]
pub fn as_inner(&self) -> &[u8]
[src]Returns byte slice representation of the inner data (slice of bytes, with 8 bit flags per each byte)
pub fn from_inner(slice: Vec<u8>) -> Self
[src]
pub fn from_inner(slice: Vec<u8>) -> Self
[src]Constructs flag vector from inner representation (slice of bytes, with 8 bit flags per each byte)
pub fn iter(&self) -> AllSet<'_>ⓘ
[src]
pub fn iter(&self) -> AllSet<'_>ⓘ
[src]Creates an iterator for the current feature flags which have “set” state
pub fn known_iter(&self, known: FlagVec) -> FilteredIter<'_>ⓘNotable traits for FilteredIter<'_>
impl Iterator for FilteredIter<'_> type Item = FlagNo;
[src]
pub fn known_iter(&self, known: FlagVec) -> FilteredIter<'_>ⓘNotable traits for FilteredIter<'_>
impl Iterator for FilteredIter<'_> type Item = FlagNo;
[src]Creates iterator over known set of the features
pub fn unknown_iter(&self, known: FlagVec) -> FilteredIter<'_>ⓘNotable traits for FilteredIter<'_>
impl Iterator for FilteredIter<'_> type Item = FlagNo;
[src]
pub fn unknown_iter(&self, known: FlagVec) -> FilteredIter<'_>ⓘNotable traits for FilteredIter<'_>
impl Iterator for FilteredIter<'_> type Item = FlagNo;
[src]Creates iterator over unknown set of the features, i.e. features that
do not match flags set in known
parameter
pub fn shrink(&mut self) -> bool
[src]
pub fn shrink(&mut self) -> bool
[src]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
pub fn is_set(&self, flag_no: FlagNo) -> bool
[src]
pub fn is_set(&self, flag_no: FlagNo) -> bool
[src]Returns whether a feature flag with flag_no
is set (true
or false
)
pub fn set(&mut self, flag_no: FlagNo) -> bool
[src]
pub fn set(&mut self, flag_no: FlagNo) -> bool
[src]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
impl Ord for FlagVec
[src]
impl Ord for FlagVec
[src]impl PartialOrd<FlagVec> for FlagVec
[src]
impl PartialOrd<FlagVec> for FlagVec
[src]fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for FlagVec
[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more