Struct flag_algebra::operator::Type
source · pub struct Type<F: Flag> {
pub size: usize,
pub id: usize,
/* private fields */
}Expand description
Type (or root) of a flag. It is identified by its size and its id in the list of flags of that size.
Fields§
§size: usizeSize of the type.
id: usizeIndex of the type in the list of unlabeled flags of this size.
Implementations§
source§impl<F: Flag> Type<F>
impl<F: Flag> Type<F>
sourcepub fn from_flag<G>(g: &G) -> Selfwhere
F: Flag,
G: Into<F> + Clone,
pub fn from_flag<G>(g: &G) -> Selfwhere F: Flag, G: Into<F> + Clone,
Create the type corresponding to g
sourcepub fn types_with_size(size: usize) -> impl Iterator<Item = Self>where
F: Flag,
pub fn types_with_size(size: usize) -> impl Iterator<Item = Self>where F: Flag,
Iterate on all types of a given size.
sourcepub fn print_concise(self) -> String
pub fn print_concise(self) -> String
Print the type identifier in a short way.
Trait Implementations§
source§impl<F: Ord + Flag> Ord for Type<F>
impl<F: Ord + Flag> Ord for Type<F>
source§impl<F: PartialEq + Flag> PartialEq<Type<F>> for Type<F>
impl<F: PartialEq + Flag> PartialEq<Type<F>> for Type<F>
source§impl<F: PartialOrd + Flag> PartialOrd<Type<F>> for Type<F>
impl<F: PartialOrd + Flag> PartialOrd<Type<F>> for Type<F>
1.0.0 · source§fn 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 moreimpl<F: Flag> Copy for Type<F>
impl<F: Eq + Flag> Eq for Type<F>
impl<F: Flag> StructuralEq for Type<F>
impl<F: Flag> StructuralPartialEq for Type<F>
Auto Trait Implementations§
impl<F> RefUnwindSafe for Type<F>where F: RefUnwindSafe,
impl<F> Send for Type<F>where F: Send,
impl<F> Sync for Type<F>where F: Sync,
impl<F> Unpin for Type<F>where F: Unpin,
impl<F> UnwindSafe for Type<F>where F: UnwindSafe,
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.