Struct swc_ecma_transforms::feature::FeatureFlag
source · [−]pub struct FeatureFlag { /* private fields */ }
Implementations
sourceimpl FeatureFlag
impl FeatureFlag
sourcepub const TemplateLiterals: FeatureFlag = Self{ bits: 1 << 0,}
pub const TemplateLiterals: FeatureFlag = Self{ bits: 1 << 0,}
transform-template-literals
sourcepub const Literals: FeatureFlag = Self{ bits: 1 << 1,}
pub const Literals: FeatureFlag = Self{ bits: 1 << 1,}
transform-literals
sourcepub const FunctionName: FeatureFlag = Self{ bits: 1 << 2,}
pub const FunctionName: FeatureFlag = Self{ bits: 1 << 2,}
transform-function-name
sourcepub const ArrowFunctions: FeatureFlag = Self{ bits: 1 << 3,}
pub const ArrowFunctions: FeatureFlag = Self{ bits: 1 << 3,}
transform-arrow-functions
sourcepub const BlockScopedFunctions: FeatureFlag = Self{ bits: 1 << 4,}
pub const BlockScopedFunctions: FeatureFlag = Self{ bits: 1 << 4,}
transform-block-scoped-functions
sourcepub const Classes: FeatureFlag = Self{ bits: 1 << 5,}
pub const Classes: FeatureFlag = Self{ bits: 1 << 5,}
transform-classes
sourcepub const ObjectSuper: FeatureFlag = Self{ bits: 1 << 6,}
pub const ObjectSuper: FeatureFlag = Self{ bits: 1 << 6,}
transform-object-super
sourcepub const ShorthandProperties: FeatureFlag = Self{ bits: 1 << 7,}
pub const ShorthandProperties: FeatureFlag = Self{ bits: 1 << 7,}
transform-shorthand-properties
sourcepub const DuplicateKeys: FeatureFlag = Self{ bits: 1 << 8,}
pub const DuplicateKeys: FeatureFlag = Self{ bits: 1 << 8,}
transform-duplicate-keys
sourcepub const ComputedProperties: FeatureFlag = Self{ bits: 1 << 9,}
pub const ComputedProperties: FeatureFlag = Self{ bits: 1 << 9,}
transform-computed-properties
sourcepub const ForOf: FeatureFlag = Self{ bits: 1 << 10,}
pub const ForOf: FeatureFlag = Self{ bits: 1 << 10,}
transform-for-of
sourcepub const StickyRegex: FeatureFlag = Self{ bits: 1 << 11,}
pub const StickyRegex: FeatureFlag = Self{ bits: 1 << 11,}
transform-sticky-regex
sourcepub const DotAllRegex: FeatureFlag = Self{ bits: 1 << 12,}
pub const DotAllRegex: FeatureFlag = Self{ bits: 1 << 12,}
transform-dotall-regex
sourcepub const UnicodeRegex: FeatureFlag = Self{ bits: 1 << 13,}
pub const UnicodeRegex: FeatureFlag = Self{ bits: 1 << 13,}
transform-unicode-regex
sourcepub const Spread: FeatureFlag = Self{ bits: 1 << 14,}
pub const Spread: FeatureFlag = Self{ bits: 1 << 14,}
transform-spread
sourcepub const Parameters: FeatureFlag = Self{ bits: 1 << 15,}
pub const Parameters: FeatureFlag = Self{ bits: 1 << 15,}
transform-parameters
sourcepub const Destructuring: FeatureFlag = Self{ bits: 1 << 16,}
pub const Destructuring: FeatureFlag = Self{ bits: 1 << 16,}
transform-destructuring
sourcepub const BlockScoping: FeatureFlag = Self{ bits: 1 << 17,}
pub const BlockScoping: FeatureFlag = Self{ bits: 1 << 17,}
transform-block-scoping
sourcepub const TypeOfSymbol: FeatureFlag = Self{ bits: 1 << 18,}
pub const TypeOfSymbol: FeatureFlag = Self{ bits: 1 << 18,}
transform-typeof-symbol
sourcepub const NewTarget: FeatureFlag = Self{ bits: 1 << 19,}
pub const NewTarget: FeatureFlag = Self{ bits: 1 << 19,}
transform-new-target
sourcepub const Regenerator: FeatureFlag = Self{ bits: 1 << 20,}
pub const Regenerator: FeatureFlag = Self{ bits: 1 << 20,}
transform-regenerator
sourcepub const ExponentiationOperator: FeatureFlag = Self{ bits: 1 << 21,}
pub const ExponentiationOperator: FeatureFlag = Self{ bits: 1 << 21,}
transform-exponentiation-operator
sourcepub const AsyncToGenerator: FeatureFlag = Self{ bits: 1 << 22,}
pub const AsyncToGenerator: FeatureFlag = Self{ bits: 1 << 22,}
transform-async-to-generator
sourcepub const AsyncGeneratorFunctions: FeatureFlag = Self{ bits: 1 << 23,}
pub const AsyncGeneratorFunctions: FeatureFlag = Self{ bits: 1 << 23,}
proposal-async-generator-functions
sourcepub const ObjectRestSpread: FeatureFlag = Self{ bits: 1 << 24,}
pub const ObjectRestSpread: FeatureFlag = Self{ bits: 1 << 24,}
proposal-object-rest-spread
sourcepub const UnicodePropertyRegex: FeatureFlag = Self{ bits: 1 << 25,}
pub const UnicodePropertyRegex: FeatureFlag = Self{ bits: 1 << 25,}
proposal-unicode-property-regex
sourcepub const JsonStrings: FeatureFlag = Self{ bits: 1 << 26,}
pub const JsonStrings: FeatureFlag = Self{ bits: 1 << 26,}
proposal-json-strings
sourcepub const OptionalCatchBinding: FeatureFlag = Self{ bits: 1 << 27,}
pub const OptionalCatchBinding: FeatureFlag = Self{ bits: 1 << 27,}
proposal-optional-catch-binding
sourcepub const NamedCapturingGroupsRegex: FeatureFlag = Self{ bits: 1 << 28,}
pub const NamedCapturingGroupsRegex: FeatureFlag = Self{ bits: 1 << 28,}
transform-named-capturing-groups-regex
sourcepub const MemberExpressionLiterals: FeatureFlag = Self{ bits: 1 << 29,}
pub const MemberExpressionLiterals: FeatureFlag = Self{ bits: 1 << 29,}
transform-member-expression-literals
sourcepub const PropertyLiterals: FeatureFlag = Self{ bits: 1 << 30,}
pub const PropertyLiterals: FeatureFlag = Self{ bits: 1 << 30,}
transform-property-literals
sourcepub const ReservedWords: FeatureFlag = Self{ bits: 1 << 31,}
pub const ReservedWords: FeatureFlag = Self{ bits: 1 << 31,}
transform-reserved-words
sourcepub const ExportNamespaceFrom: FeatureFlag = Self{ bits: 1 << 32,}
pub const ExportNamespaceFrom: FeatureFlag = Self{ bits: 1 << 32,}
proposal-export-namespace-from
sourcepub const NullishCoalescing: FeatureFlag = Self{ bits: 1 << 33,}
pub const NullishCoalescing: FeatureFlag = Self{ bits: 1 << 33,}
proposal-nullish-coalescing-operator
sourcepub const LogicalAssignmentOperators: FeatureFlag = Self{ bits: 1 << 34,}
pub const LogicalAssignmentOperators: FeatureFlag = Self{ bits: 1 << 34,}
proposal-logical-assignment-operators
sourcepub const OptionalChaining: FeatureFlag = Self{ bits: 1 << 35,}
pub const OptionalChaining: FeatureFlag = Self{ bits: 1 << 35,}
proposal-optional-chaining
sourcepub const ClassProperties: FeatureFlag = Self{ bits: 1 << 36,}
pub const ClassProperties: FeatureFlag = Self{ bits: 1 << 36,}
proposal-class-properties
sourcepub const NumericSeparator: FeatureFlag = Self{ bits: 1 << 37,}
pub const NumericSeparator: FeatureFlag = Self{ bits: 1 << 37,}
proposal-numeric-separator
sourcepub const PrivateMethods: FeatureFlag = Self{ bits: 1 << 38,}
pub const PrivateMethods: FeatureFlag = Self{ bits: 1 << 38,}
proposal-private-methods
sourcepub const ClassStaticBlock: FeatureFlag = Self{ bits: 1 << 39,}
pub const ClassStaticBlock: FeatureFlag = Self{ bits: 1 << 39,}
proposal-class-static-block
sourcepub const PrivatePropertyInObject: FeatureFlag = Self{ bits: 1 << 40,}
pub const PrivatePropertyInObject: FeatureFlag = Self{ bits: 1 << 40,}
proposal-private-property-in-object
sourcepub const UnicodeEscapes: FeatureFlag = Self{ bits: 1 << 41,}
pub const UnicodeEscapes: FeatureFlag = Self{ bits: 1 << 41,}
transform-unicode-escapes
sourcepub const BugfixAsyncArrowsInClass: FeatureFlag = Self{ bits: 1 << 42,}
pub const BugfixAsyncArrowsInClass: FeatureFlag = Self{ bits: 1 << 42,}
bugfix/transform-async-arrows-in-class
sourcepub const BugfixEdgeDefaultParam: FeatureFlag = Self{ bits: 1 << 43,}
pub const BugfixEdgeDefaultParam: FeatureFlag = Self{ bits: 1 << 43,}
bugfix/transform-edge-default-parameters
sourcepub const BugfixTaggedTemplateCaching: FeatureFlag = Self{ bits: 1 << 44,}
pub const BugfixTaggedTemplateCaching: FeatureFlag = Self{ bits: 1 << 44,}
bugfix/transform-tagged-template-caching
sourcepub const BugfixSafariIdDestructuringCollisionInFunctionExpression: FeatureFlag = Self{ bits: 1 << 45,}
pub const BugfixSafariIdDestructuringCollisionInFunctionExpression: FeatureFlag = Self{ bits: 1 << 45,}
bugfix/transform-safari-id-destructuring-collision-in-function-expression
sourcepub const BugfixTransformEdgeFunctionName: FeatureFlag = Self{ bits: 1 << 46,}
pub const BugfixTransformEdgeFunctionName: FeatureFlag = Self{ bits: 1 << 46,}
bugfix/transform-edge-function-name
sourcepub const BugfixTransformSafariBlockShadowing: FeatureFlag = Self{ bits: 1 << 47,}
pub const BugfixTransformSafariBlockShadowing: FeatureFlag = Self{ bits: 1 << 47,}
bugfix/transform-safari-block-shadowing
sourcepub const BugfixTransformSafariForShadowing: FeatureFlag = Self{ bits: 1 << 48,}
pub const BugfixTransformSafariForShadowing: FeatureFlag = Self{ bits: 1 << 48,}
bugfix/transform-safari-for-shadowing
sourcepub const BugfixTransformV8SpreadParametersInOptionalChaining: FeatureFlag = Self{ bits: 1 << 49,}
pub const BugfixTransformV8SpreadParametersInOptionalChaining: FeatureFlag = Self{ bits: 1 << 49,}
bugfix/transform-v8-spread-parameters-in-optional-chaining
sourcepub const fn empty() -> FeatureFlag
pub const fn empty() -> FeatureFlag
Returns an empty set of flags.
sourcepub const fn all() -> FeatureFlag
pub const fn all() -> FeatureFlag
Returns the set containing all flags.
sourcepub const fn from_bits(bits: u64) -> Option<FeatureFlag>
pub const fn from_bits(bits: u64) -> Option<FeatureFlag>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u64) -> FeatureFlag
pub const fn from_bits_truncate(bits: u64) -> FeatureFlag
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u64) -> FeatureFlag
pub const unsafe fn from_bits_unchecked(bits: u64) -> FeatureFlag
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
sourcepub const fn intersects(&self, other: FeatureFlag) -> bool
pub const fn intersects(&self, other: FeatureFlag) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: FeatureFlag) -> bool
pub const fn contains(&self, other: FeatureFlag) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: FeatureFlag)
pub fn insert(&mut self, other: FeatureFlag)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: FeatureFlag)
pub fn remove(&mut self, other: FeatureFlag)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: FeatureFlag)
pub fn toggle(&mut self, other: FeatureFlag)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: FeatureFlag, value: bool)
pub fn set(&mut self, other: FeatureFlag, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: FeatureFlag) -> FeatureFlag
pub const fn intersection(self, other: FeatureFlag) -> FeatureFlag
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
sourcepub const fn union(self, other: FeatureFlag) -> FeatureFlag
pub const fn union(self, other: FeatureFlag) -> FeatureFlag
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
sourcepub const fn difference(self, other: FeatureFlag) -> FeatureFlag
pub const fn difference(self, other: FeatureFlag) -> FeatureFlag
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
sourcepub const fn symmetric_difference(self, other: FeatureFlag) -> FeatureFlag
pub const fn symmetric_difference(self, other: FeatureFlag) -> FeatureFlag
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
sourcepub const fn complement(self) -> FeatureFlag
pub const fn complement(self) -> FeatureFlag
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations
sourceimpl Binary for FeatureFlag
impl Binary for FeatureFlag
sourceimpl BitAnd<FeatureFlag> for FeatureFlag
impl BitAnd<FeatureFlag> for FeatureFlag
sourcefn bitand(self, other: FeatureFlag) -> FeatureFlag
fn bitand(self, other: FeatureFlag) -> FeatureFlag
Returns the intersection between the two sets of flags.
type Output = FeatureFlag
type Output = FeatureFlag
&
operator.sourceimpl BitAndAssign<FeatureFlag> for FeatureFlag
impl BitAndAssign<FeatureFlag> for FeatureFlag
sourcefn bitand_assign(&mut self, other: FeatureFlag)
fn bitand_assign(&mut self, other: FeatureFlag)
Disables all flags disabled in the set.
sourceimpl BitOr<FeatureFlag> for FeatureFlag
impl BitOr<FeatureFlag> for FeatureFlag
sourcefn bitor(self, other: FeatureFlag) -> FeatureFlag
fn bitor(self, other: FeatureFlag) -> FeatureFlag
Returns the union of the two sets of flags.
type Output = FeatureFlag
type Output = FeatureFlag
|
operator.sourceimpl BitOrAssign<FeatureFlag> for FeatureFlag
impl BitOrAssign<FeatureFlag> for FeatureFlag
sourcefn bitor_assign(&mut self, other: FeatureFlag)
fn bitor_assign(&mut self, other: FeatureFlag)
Adds the set of flags.
sourceimpl BitXor<FeatureFlag> for FeatureFlag
impl BitXor<FeatureFlag> for FeatureFlag
sourcefn bitxor(self, other: FeatureFlag) -> FeatureFlag
fn bitxor(self, other: FeatureFlag) -> FeatureFlag
Returns the left flags, but with all the right flags toggled.
type Output = FeatureFlag
type Output = FeatureFlag
^
operator.sourceimpl BitXorAssign<FeatureFlag> for FeatureFlag
impl BitXorAssign<FeatureFlag> for FeatureFlag
sourcefn bitxor_assign(&mut self, other: FeatureFlag)
fn bitxor_assign(&mut self, other: FeatureFlag)
Toggles the set of flags.
sourceimpl Clone for FeatureFlag
impl Clone for FeatureFlag
sourcefn clone(&self) -> FeatureFlag
fn clone(&self) -> FeatureFlag
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for FeatureFlag
impl Debug for FeatureFlag
sourceimpl Default for FeatureFlag
impl Default for FeatureFlag
sourcefn default() -> FeatureFlag
fn default() -> FeatureFlag
sourceimpl Extend<FeatureFlag> for FeatureFlag
impl Extend<FeatureFlag> for FeatureFlag
sourcefn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = FeatureFlag>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = FeatureFlag>,
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)sourceimpl FromIterator<FeatureFlag> for FeatureFlag
impl FromIterator<FeatureFlag> for FeatureFlag
sourcefn from_iter<T>(iterator: T) -> FeatureFlagwhere
T: IntoIterator<Item = FeatureFlag>,
fn from_iter<T>(iterator: T) -> FeatureFlagwhere
T: IntoIterator<Item = FeatureFlag>,
sourceimpl Hash for FeatureFlag
impl Hash for FeatureFlag
sourceimpl LowerHex for FeatureFlag
impl LowerHex for FeatureFlag
sourceimpl Not for FeatureFlag
impl Not for FeatureFlag
sourcefn not(self) -> FeatureFlag
fn not(self) -> FeatureFlag
Returns the complement of this set of flags.
type Output = FeatureFlag
type Output = FeatureFlag
!
operator.sourceimpl Octal for FeatureFlag
impl Octal for FeatureFlag
sourceimpl Ord for FeatureFlag
impl Ord for FeatureFlag
sourcefn cmp(&self, other: &FeatureFlag) -> Ordering
fn cmp(&self, other: &FeatureFlag) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialEq<FeatureFlag> for FeatureFlag
impl PartialEq<FeatureFlag> for FeatureFlag
sourcefn eq(&self, other: &FeatureFlag) -> bool
fn eq(&self, other: &FeatureFlag) -> bool
sourceimpl PartialOrd<FeatureFlag> for FeatureFlag
impl PartialOrd<FeatureFlag> for FeatureFlag
sourcefn partial_cmp(&self, other: &FeatureFlag) -> Option<Ordering>
fn partial_cmp(&self, other: &FeatureFlag) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl Sub<FeatureFlag> for FeatureFlag
impl Sub<FeatureFlag> for FeatureFlag
sourcefn sub(self, other: FeatureFlag) -> FeatureFlag
fn sub(self, other: FeatureFlag) -> FeatureFlag
Returns the set difference of the two sets of flags.
type Output = FeatureFlag
type Output = FeatureFlag
-
operator.sourceimpl SubAssign<FeatureFlag> for FeatureFlag
impl SubAssign<FeatureFlag> for FeatureFlag
sourcefn sub_assign(&mut self, other: FeatureFlag)
fn sub_assign(&mut self, other: FeatureFlag)
Disables all flags enabled in the set.
sourceimpl UpperHex for FeatureFlag
impl UpperHex for FeatureFlag
impl Copy for FeatureFlag
impl Eq for FeatureFlag
impl StructuralEq for FeatureFlag
impl StructuralPartialEq for FeatureFlag
Auto Trait Implementations
impl RefUnwindSafe for FeatureFlag
impl Send for FeatureFlag
impl Sync for FeatureFlag
impl Unpin for FeatureFlag
impl UnwindSafe for FeatureFlag
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.