[][src]Struct lnpbp::features::FlagVec

pub struct FlagVec(_);

Structure holding a given set of features

Implementations

impl FlagVec[src]

pub fn new() -> FlagVec[src]

Constructs a features vector of zero feature flag set

pub fn with_capacity(upto: FlagNo) -> Self[src]

Constructs a features vector of upto feature flag in unset state

pub fn shrunk(&self) -> Self[src]

Returns a shrunk copy of the self

pub fn iter(&self) -> AllSet<'_>

Notable traits for AllSet<'_>

impl<'_> Iterator for AllSet<'_> type Item = FlagNo;
[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]

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]

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]

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]

Returns whether a feature flag with flag_no is set (true or false)

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)

pub fn unset(&mut self, flag_no: FlagNo) -> bool[src]

Unsets the feature flag with number flag_no. Returns true if the flag was set before and false otherwise (i.e. previous value of the flag)

pub fn invert(&mut self, flag_no: FlagNo)[src]

Inverts the feature flag with number flag_no

Trait Implementations

impl Binary for FlagVec[src]

impl BitAnd<FlagVec> for FlagVec[src]

type Output = Self

The resulting type after applying the & operator.

impl BitOr<FlagVec> for FlagVec[src]

type Output = Self

The resulting type after applying the | operator.

impl BitXor<FlagVec> for FlagVec[src]

type Output = Self

The resulting type after applying the ^ operator.

impl Clone for FlagVec[src]

impl Debug for FlagVec[src]

impl Default for FlagVec[src]

impl Display for FlagVec[src]

impl Eq for FlagVec[src]

impl FromStr for FlagVec[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Hash for FlagVec[src]

impl LowerHex for FlagVec[src]

impl Octal for FlagVec[src]

impl PartialEq<FlagVec> for FlagVec[src]

impl StrictDecode for FlagVec[src]

type Error = Error

Implementation-dependent error type

impl StrictEncode for FlagVec[src]

type Error = Error

Implementation-dependent error type

impl<'_> TryFrom<&'_ [u8]> for FlagVec[src]

type Error = ParseError

The type returned in the event of a conversion error.

impl TryFrom<Vec<u8>> for FlagVec[src]

type Error = ParseError

The type returned in the event of a conversion error.

impl UpperHex 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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToHex for T where
    T: LowerHex
[src]

pub fn to_hex(&self) -> String[src]

Outputs the hash in hexadecimal form

impl<T> ToHex for T where
    T: LowerHex
[src]

pub fn to_hex(&self) -> String[src]

Outputs the hash in hexadecimal form

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,