Struct oxc::syntax::scope::ScopeFlags
source · pub struct ScopeFlags(/* private fields */);Implementations§
source§impl ScopeFlags
impl ScopeFlags
pub const StrictMode: ScopeFlags = _
pub const Top: ScopeFlags = _
pub const Function: ScopeFlags = _
pub const Arrow: ScopeFlags = _
pub const ClassStaticBlock: ScopeFlags = _
pub const TsModuleBlock: ScopeFlags = _
pub const Constructor: ScopeFlags = _
pub const GetAccessor: ScopeFlags = _
pub const SetAccessor: ScopeFlags = _
pub const Var: ScopeFlags = _
pub const Modifiers: ScopeFlags = _
source§impl ScopeFlags
impl ScopeFlags
sourcepub const fn empty() -> ScopeFlags
pub const fn empty() -> ScopeFlags
Get a flags value with all bits unset.
sourcepub const fn all() -> ScopeFlags
pub const fn all() -> ScopeFlags
Get a flags value with all known bits set.
sourcepub const fn bits(&self) -> u16
pub const fn bits(&self) -> u16
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
sourcepub const fn from_bits(bits: u16) -> Option<ScopeFlags>
pub const fn from_bits(bits: u16) -> Option<ScopeFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
sourcepub const fn from_bits_truncate(bits: u16) -> ScopeFlags
pub const fn from_bits_truncate(bits: u16) -> ScopeFlags
Convert from a bits value, unsetting any unknown bits.
sourcepub const fn from_bits_retain(bits: u16) -> ScopeFlags
pub const fn from_bits_retain(bits: u16) -> ScopeFlags
Convert from a bits value exactly.
sourcepub fn from_name(name: &str) -> Option<ScopeFlags>
pub fn from_name(name: &str) -> Option<ScopeFlags>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
sourcepub const fn intersects(&self, other: ScopeFlags) -> bool
pub const fn intersects(&self, other: ScopeFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
sourcepub const fn contains(&self, other: ScopeFlags) -> bool
pub const fn contains(&self, other: ScopeFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
sourcepub fn insert(&mut self, other: ScopeFlags)
pub fn insert(&mut self, other: ScopeFlags)
The bitwise or (|) of the bits in two flags values.
sourcepub fn remove(&mut self, other: ScopeFlags)
pub fn remove(&mut self, other: ScopeFlags)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
sourcepub fn toggle(&mut self, other: ScopeFlags)
pub fn toggle(&mut self, other: ScopeFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
sourcepub fn set(&mut self, other: ScopeFlags, value: bool)
pub fn set(&mut self, other: ScopeFlags, value: bool)
Call insert when value is true or remove when value is false.
sourcepub const fn intersection(self, other: ScopeFlags) -> ScopeFlags
pub const fn intersection(self, other: ScopeFlags) -> ScopeFlags
The bitwise and (&) of the bits in two flags values.
sourcepub const fn union(self, other: ScopeFlags) -> ScopeFlags
pub const fn union(self, other: ScopeFlags) -> ScopeFlags
The bitwise or (|) of the bits in two flags values.
sourcepub const fn difference(self, other: ScopeFlags) -> ScopeFlags
pub const fn difference(self, other: ScopeFlags) -> ScopeFlags
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
sourcepub const fn symmetric_difference(self, other: ScopeFlags) -> ScopeFlags
pub const fn symmetric_difference(self, other: ScopeFlags) -> ScopeFlags
The bitwise exclusive-or (^) of the bits in two flags values.
sourcepub const fn complement(self) -> ScopeFlags
pub const fn complement(self) -> ScopeFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
source§impl ScopeFlags
impl ScopeFlags
sourcepub const fn iter(&self) -> Iter<ScopeFlags> ⓘ
pub const fn iter(&self) -> Iter<ScopeFlags> ⓘ
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
sourcepub const fn iter_names(&self) -> IterNames<ScopeFlags> ⓘ
pub const fn iter_names(&self) -> IterNames<ScopeFlags> ⓘ
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
source§impl ScopeFlags
impl ScopeFlags
pub fn with_strict_mode(self, yes: bool) -> ScopeFlags
pub fn is_strict_mode(&self) -> bool
pub fn is_top(&self) -> bool
pub fn is_function(&self) -> bool
pub fn is_class_static_block(&self) -> bool
pub fn is_var(&self) -> bool
pub fn is_set_accessor(&self) -> bool
Trait Implementations§
source§impl Binary for ScopeFlags
impl Binary for ScopeFlags
source§impl BitAnd for ScopeFlags
impl BitAnd for ScopeFlags
source§fn bitand(self, other: ScopeFlags) -> ScopeFlags
fn bitand(self, other: ScopeFlags) -> ScopeFlags
The bitwise and (&) of the bits in two flags values.
§type Output = ScopeFlags
type Output = ScopeFlags
& operator.source§impl BitAndAssign for ScopeFlags
impl BitAndAssign for ScopeFlags
source§fn bitand_assign(&mut self, other: ScopeFlags)
fn bitand_assign(&mut self, other: ScopeFlags)
The bitwise and (&) of the bits in two flags values.
source§impl BitOr for ScopeFlags
impl BitOr for ScopeFlags
source§fn bitor(self, other: ScopeFlags) -> ScopeFlags
fn bitor(self, other: ScopeFlags) -> ScopeFlags
The bitwise or (|) of the bits in two flags values.
§type Output = ScopeFlags
type Output = ScopeFlags
| operator.source§impl BitOrAssign for ScopeFlags
impl BitOrAssign for ScopeFlags
source§fn bitor_assign(&mut self, other: ScopeFlags)
fn bitor_assign(&mut self, other: ScopeFlags)
The bitwise or (|) of the bits in two flags values.
source§impl BitXor for ScopeFlags
impl BitXor for ScopeFlags
source§fn bitxor(self, other: ScopeFlags) -> ScopeFlags
fn bitxor(self, other: ScopeFlags) -> ScopeFlags
The bitwise exclusive-or (^) of the bits in two flags values.
§type Output = ScopeFlags
type Output = ScopeFlags
^ operator.source§impl BitXorAssign for ScopeFlags
impl BitXorAssign for ScopeFlags
source§fn bitxor_assign(&mut self, other: ScopeFlags)
fn bitxor_assign(&mut self, other: ScopeFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
source§impl Clone for ScopeFlags
impl Clone for ScopeFlags
source§fn clone(&self) -> ScopeFlags
fn clone(&self) -> ScopeFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ScopeFlags
impl Debug for ScopeFlags
source§impl Extend<ScopeFlags> for ScopeFlags
impl Extend<ScopeFlags> for ScopeFlags
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ScopeFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ScopeFlags>,
The bitwise or (|) of the bits in each flags value.
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)source§impl Flags for ScopeFlags
impl Flags for ScopeFlags
source§const FLAGS: &'static [Flag<ScopeFlags>] = _
const FLAGS: &'static [Flag<ScopeFlags>] = _
source§fn from_bits_retain(bits: u16) -> ScopeFlags
fn from_bits_retain(bits: u16) -> ScopeFlags
§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self> ⓘ
fn iter_names(&self) -> IterNames<Self> ⓘ
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in two flags values.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert] when value is true or [Flags::remove] when value is false.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in a flags value, truncating the result.source§impl FromIterator<ScopeFlags> for ScopeFlags
impl FromIterator<ScopeFlags> for ScopeFlags
source§fn from_iter<T>(iterator: T) -> ScopeFlagswhere
T: IntoIterator<Item = ScopeFlags>,
fn from_iter<T>(iterator: T) -> ScopeFlagswhere
T: IntoIterator<Item = ScopeFlags>,
The bitwise or (|) of the bits in each flags value.
source§impl IntoIterator for ScopeFlags
impl IntoIterator for ScopeFlags
§type Item = ScopeFlags
type Item = ScopeFlags
§type IntoIter = Iter<ScopeFlags>
type IntoIter = Iter<ScopeFlags>
source§fn into_iter(self) -> <ScopeFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <ScopeFlags as IntoIterator>::IntoIter
source§impl LowerHex for ScopeFlags
impl LowerHex for ScopeFlags
source§impl Not for ScopeFlags
impl Not for ScopeFlags
source§fn not(self) -> ScopeFlags
fn not(self) -> ScopeFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
§type Output = ScopeFlags
type Output = ScopeFlags
! operator.source§impl Octal for ScopeFlags
impl Octal for ScopeFlags
source§impl Sub for ScopeFlags
impl Sub for ScopeFlags
source§fn sub(self, other: ScopeFlags) -> ScopeFlags
fn sub(self, other: ScopeFlags) -> ScopeFlags
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
§type Output = ScopeFlags
type Output = ScopeFlags
- operator.source§impl SubAssign for ScopeFlags
impl SubAssign for ScopeFlags
source§fn sub_assign(&mut self, other: ScopeFlags)
fn sub_assign(&mut self, other: ScopeFlags)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
source§impl UpperHex for ScopeFlags
impl UpperHex for ScopeFlags
impl Copy for ScopeFlags
Auto Trait Implementations§
impl RefUnwindSafe for ScopeFlags
impl Send for ScopeFlags
impl Sync for ScopeFlags
impl Unpin for ScopeFlags
impl UnwindSafe for ScopeFlags
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
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more