Struct syntax::parse::parser::Restrictions [−]
pub struct Restrictions { /* fields omitted */ }Methods
impl Restrictions
impl Restrictionspub const STMT_EXPR: Restrictions
STMT_EXPR: Restrictions = Restrictions{bits: 1 << 0,}
pub const NO_STRUCT_LITERAL: Restrictions
NO_STRUCT_LITERAL: Restrictions = Restrictions{bits: 1 << 1,}
pub fn empty() -> Restrictions
pub fn empty() -> RestrictionsReturns an empty set of flags.
pub fn all() -> Restrictions
pub fn all() -> RestrictionsReturns the set containing all flags.
pub fn bits(&self) -> u8
pub fn bits(&self) -> u8Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u8) -> Option<Restrictions>
pub fn from_bits(bits: u8) -> Option<Restrictions>Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u8) -> Restrictions
pub fn from_bits_truncate(bits: u8) -> RestrictionsConvert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> boolReturns true if no flags are currently stored.
pub fn is_all(&self) -> bool
pub fn is_all(&self) -> boolReturns true if all flags are currently set.
pub fn intersects(&self, other: Restrictions) -> bool
pub fn intersects(&self, other: Restrictions) -> boolReturns true if there are flags common to both self and other.
pub fn contains(&self, other: Restrictions) -> bool
pub fn contains(&self, other: Restrictions) -> boolReturns true all of the flags in other are contained within self.
pub fn insert(&mut self, other: Restrictions)
pub fn insert(&mut self, other: Restrictions)Inserts the specified flags in-place.
pub fn remove(&mut self, other: Restrictions)
pub fn remove(&mut self, other: Restrictions)Removes the specified flags in-place.
pub fn toggle(&mut self, other: Restrictions)
pub fn toggle(&mut self, other: Restrictions)Toggles the specified flags in-place.
pub fn set(&mut self, other: Restrictions, value: bool)
pub fn set(&mut self, other: Restrictions, value: bool)Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Copy for Restrictions
impl Copy for Restrictionsimpl PartialEq for Restrictions
impl PartialEq for Restrictionsfn eq(&self, other: &Restrictions) -> bool
fn eq(&self, other: &Restrictions) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Restrictions) -> bool
fn ne(&self, other: &Restrictions) -> boolThis method tests for !=.
impl Eq for Restrictions
impl Eq for Restrictionsimpl Clone for Restrictions
impl Clone for Restrictionsfn clone(&self) -> Restrictions
fn clone(&self) -> RestrictionsReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl PartialOrd for Restrictions
impl PartialOrd for Restrictionsfn partial_cmp(&self, other: &Restrictions) -> Option<Ordering>
fn partial_cmp(&self, other: &Restrictions) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Restrictions) -> bool
fn lt(&self, other: &Restrictions) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Restrictions) -> bool
fn le(&self, other: &Restrictions) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Restrictions) -> bool
fn gt(&self, other: &Restrictions) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Restrictions) -> bool
fn ge(&self, other: &Restrictions) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Ord for Restrictions
impl Ord for Restrictionsfn cmp(&self, other: &Restrictions) -> Ordering
fn cmp(&self, other: &Restrictions) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl Hash for Restrictions
impl Hash for Restrictionsfn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for Restrictions
impl Debug for Restrictionsimpl Binary for Restrictions
impl Binary for Restrictionsimpl Octal for Restrictions
impl Octal for Restrictionsimpl LowerHex for Restrictions
impl LowerHex for Restrictionsimpl UpperHex for Restrictions
impl UpperHex for Restrictionsimpl BitOr for Restrictions
impl BitOr for Restrictionstype Output = Restrictions
The resulting type after applying the | operator.
fn bitor(self, other: Restrictions) -> Restrictions
fn bitor(self, other: Restrictions) -> RestrictionsReturns the union of the two sets of flags.
impl BitOrAssign for Restrictions
impl BitOrAssign for Restrictionsfn bitor_assign(&mut self, other: Restrictions)
fn bitor_assign(&mut self, other: Restrictions)Adds the set of flags.
impl BitXor for Restrictions
impl BitXor for Restrictionstype Output = Restrictions
The resulting type after applying the ^ operator.
fn bitxor(self, other: Restrictions) -> Restrictions
fn bitxor(self, other: Restrictions) -> RestrictionsReturns the left flags, but with all the right flags toggled.
impl BitXorAssign for Restrictions
impl BitXorAssign for Restrictionsfn bitxor_assign(&mut self, other: Restrictions)
fn bitxor_assign(&mut self, other: Restrictions)Toggles the set of flags.
impl BitAnd for Restrictions
impl BitAnd for Restrictionstype Output = Restrictions
The resulting type after applying the & operator.
fn bitand(self, other: Restrictions) -> Restrictions
fn bitand(self, other: Restrictions) -> RestrictionsReturns the intersection between the two sets of flags.
impl BitAndAssign for Restrictions
impl BitAndAssign for Restrictionsfn bitand_assign(&mut self, other: Restrictions)
fn bitand_assign(&mut self, other: Restrictions)Disables all flags disabled in the set.
impl Sub for Restrictions
impl Sub for Restrictionstype Output = Restrictions
The resulting type after applying the - operator.
fn sub(self, other: Restrictions) -> Restrictions
fn sub(self, other: Restrictions) -> RestrictionsReturns the set difference of the two sets of flags.
impl SubAssign for Restrictions
impl SubAssign for Restrictionsfn sub_assign(&mut self, other: Restrictions)
fn sub_assign(&mut self, other: Restrictions)Disables all flags enabled in the set.
impl Not for Restrictions
impl Not for Restrictionstype Output = Restrictions
The resulting type after applying the ! operator.
fn not(self) -> Restrictions
fn not(self) -> RestrictionsReturns the complement of this set of flags.
impl Extend<Restrictions> for Restrictions
impl Extend<Restrictions> for Restrictionsfn extend<T: IntoIterator<Item = Restrictions>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Restrictions>>(&mut self, iterator: T)Extends a collection with the contents of an iterator. Read more
impl FromIterator<Restrictions> for Restrictions
impl FromIterator<Restrictions> for Restrictionsfn from_iter<T: IntoIterator<Item = Restrictions>>(iterator: T) -> Restrictions
fn from_iter<T: IntoIterator<Item = Restrictions>>(iterator: T) -> RestrictionsCreates a value from an iterator. Read more
Auto Trait Implementations
impl Send for Restrictions
impl Send for Restrictionsimpl Sync for Restrictions
impl Sync for Restrictions