Struct strflags::Flags

source ·
pub struct Flags<T: PartialEq, const SEP: char = '|'>(/* private fields */);
Expand description

A set of string-enums

Implementations§

source§

impl<T: PartialEq, const S: char> Flags<T, S>

source

pub const EMPTY: Self = _

source

pub fn new(value: T) -> Self

source

pub fn pair(value1: T, value2: T) -> Self

source

pub fn len(&self) -> usize

source

pub fn is_some(&self) -> bool

source

pub fn is_none(&self) -> bool

source

pub fn contains(&self, t: impl Query<T>) -> boolwhere T: FlagsMarker,

source

pub fn iter<'t>(&'t self) -> impl Iterator<Item = &'t T>

Trait Implementations§

source§

impl<T: PartialEq, const S: char> Add<Flags<T, S>> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
source§

impl<T: PartialEq, const S: char> Add<T> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the + operator.
source§

fn add(self, rhs: T) -> Self

Performs the + operation. Read more
source§

impl<T: PartialEq, const S: char> AddAssign<Flags<T, S>> for Flags<T, S>

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl<T: PartialEq, const S: char> AddAssign<T> for Flags<T, S>

source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
source§

impl<T: PartialEq, const S: char> BitAnd<Flags<T, S>> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
source§

impl<T: PartialEq, const S: char> BitAnd<T> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: T) -> Self

Performs the & operation. Read more
source§

impl<T: PartialEq, const S: char> BitAndAssign<Flags<T, S>> for Flags<T, S>

source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
source§

impl<T: PartialEq, const S: char> BitAndAssign<T> for Flags<T, S>

source§

fn bitand_assign(&mut self, rhs: T)

Performs the &= operation. Read more
source§

impl<T: PartialEq, const S: char> BitOr<Flags<T, S>> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
source§

impl<T: PartialEq, const S: char> BitOr<T> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: T) -> Self

Performs the | operation. Read more
source§

impl<T: PartialEq, const S: char> BitOrAssign<Flags<T, S>> for Flags<T, S>

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl<T: PartialEq, const S: char> BitOrAssign<T> for Flags<T, S>

source§

fn bitor_assign(&mut self, rhs: T)

Performs the |= operation. Read more
source§

impl<T: PartialEq, const S: char> BitXor<Flags<T, S>> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Self) -> Self

Performs the ^ operation. Read more
source§

impl<T: PartialEq, const S: char> BitXor<T> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: T) -> Self

Performs the ^ operation. Read more
source§

impl<T: PartialEq, const S: char> BitXorAssign<Flags<T, S>> for Flags<T, S>

source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
source§

impl<T: PartialEq, const S: char> BitXorAssign<T> for Flags<T, S>

source§

fn bitxor_assign(&mut self, rhs: T)

Performs the ^= operation. Read more
source§

impl<T: Clone + PartialEq, const SEP: char> Clone for Flags<T, SEP>

source§

fn clone(&self) -> Flags<T, SEP>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, const S: char> Debug for Flags<T, S>where T: AsRef<str> + PartialEq,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: PartialEq, const S: char> Default for Flags<T, S>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T, const S: char> Display for Flags<T, S>where T: Display + PartialEq,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, const S: char> FromStr for Flags<T, S>where T: FromStr + PartialEq,

§

type Err = <T as FromStr>::Err

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<'t, T: PartialEq, const S: char> IntoIterator for &'t Flags<T, S>

§

type Item = &'t T

The type of the elements being iterated over.
§

type IntoIter = Iter<'t, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: PartialEq, const S: char> IntoIterator for Flags<T, S>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<[T; 2]>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const S: char> PartialEq<Flags<T, S>> for Flags<T, S>where T: PartialEq,

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: FlagsMarker + PartialEq> Query<T> for &Flags<T>

§

type Iter<'t> = AsRefStrIter<'t, Iter<'t, T>> where Self: 't

source§

fn items<'t>(&'t self) -> Self::Iter<'t>

source§

impl<T: FlagsMarker + PartialEq> Query<T> for Flags<T>

§

type Iter<'t> = AsRefStrIter<'t, Iter<'t, T>> where T: 't

source§

fn items<'t>(&'t self) -> Self::Iter<'t>

source§

impl<T: PartialEq, const S: char> Sub<Flags<T, S>> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
source§

impl<T: PartialEq, const S: char> Sub<T> for Flags<T, S>

§

type Output = Flags<T, S>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: T) -> Self

Performs the - operation. Read more
source§

impl<T: PartialEq, const S: char> SubAssign<Flags<T, S>> for Flags<T, S>

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl<T: PartialEq, const S: char> SubAssign<T> for Flags<T, S>

source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl<T, const SEP: char> RefUnwindSafe for Flags<T, SEP>where T: RefUnwindSafe,

§

impl<T, const SEP: char> Send for Flags<T, SEP>where T: Send,

§

impl<T, const SEP: char> Sync for Flags<T, SEP>where T: Sync,

§

impl<T, const SEP: char> Unpin for Flags<T, SEP>where T: Unpin,

§

impl<T, const SEP: char> UnwindSafe for Flags<T, SEP>where T: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.