Struct swc_core::visit::swc_ecma_ast::ListFormat
source · [−]pub struct ListFormat { /* private fields */ }
visit
only.Expand description
Represents the formatting rule for a list of nodes.
Implementations
sourceimpl ListFormat
impl ListFormat
sourcepub const None: ListFormat = Self{ bits: 0,}
Available on crate feature ast
only.
pub const None: ListFormat = Self{ bits: 0,}
ast
only.Default value.
sourcepub const fn empty() -> ListFormat
Available on crate feature ast
only.
pub const fn empty() -> ListFormat
ast
only.Returns an empty set of flags.
sourcepub const fn all() -> ListFormat
Available on crate feature ast
only.
pub const fn all() -> ListFormat
ast
only.Returns the set containing all flags.
sourcepub const fn bits(&self) -> u32
Available on crate feature ast
only.
pub const fn bits(&self) -> u32
ast
only.Returns the raw value of the flags currently stored.
sourcepub const fn from_bits(bits: u32) -> Option<ListFormat>
Available on crate feature ast
only.
pub const fn from_bits(bits: u32) -> Option<ListFormat>
ast
only.Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u32) -> ListFormat
Available on crate feature ast
only.
pub const fn from_bits_truncate(bits: u32) -> ListFormat
ast
only.Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> ListFormat
Available on crate feature ast
only.
pub const unsafe fn from_bits_unchecked(bits: u32) -> ListFormat
ast
only.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 is_empty(&self) -> bool
Available on crate feature ast
only.
pub const fn is_empty(&self) -> bool
ast
only.Returns true
if no flags are currently stored.
sourcepub const fn is_all(&self) -> bool
Available on crate feature ast
only.
pub const fn is_all(&self) -> bool
ast
only.Returns true
if all flags are currently set.
sourcepub const fn intersects(&self, other: ListFormat) -> bool
Available on crate feature ast
only.
pub const fn intersects(&self, other: ListFormat) -> bool
ast
only.Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: ListFormat) -> bool
Available on crate feature ast
only.
pub const fn contains(&self, other: ListFormat) -> bool
ast
only.Returns true
if all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: ListFormat)
Available on crate feature ast
only.
pub fn insert(&mut self, other: ListFormat)
ast
only.Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: ListFormat)
Available on crate feature ast
only.
pub fn remove(&mut self, other: ListFormat)
ast
only.Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: ListFormat)
Available on crate feature ast
only.
pub fn toggle(&mut self, other: ListFormat)
ast
only.Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: ListFormat, value: bool)
Available on crate feature ast
only.
pub fn set(&mut self, other: ListFormat, value: bool)
ast
only.Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: ListFormat) -> ListFormat
Available on crate feature ast
only.
pub const fn intersection(self, other: ListFormat) -> ListFormat
ast
only.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: ListFormat) -> ListFormat
Available on crate feature ast
only.
pub const fn union(self, other: ListFormat) -> ListFormat
ast
only.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: ListFormat) -> ListFormat
Available on crate feature ast
only.
pub const fn difference(self, other: ListFormat) -> ListFormat
ast
only.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: ListFormat) -> ListFormat
Available on crate feature ast
only.
pub const fn symmetric_difference(self, other: ListFormat) -> ListFormat
ast
only.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) -> ListFormat
Available on crate feature ast
only.
pub const fn complement(self) -> ListFormat
ast
only.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
.
sourceimpl ListFormat
impl ListFormat
sourcepub const SingleLine: ListFormat = ListFormat{ bits: 0,}
Available on crate feature ast
only.
pub const SingleLine: ListFormat = ListFormat{ bits: 0,}
ast
only.Prints the list on a single line (default).
sourcepub const MultiLine: ListFormat = ListFormat{ bits: 1 << 0,}
Available on crate feature ast
only.
pub const MultiLine: ListFormat = ListFormat{ bits: 1 << 0,}
ast
only.Prints the list on multiple lines.
sourcepub const PreserveLines: ListFormat = ListFormat{ bits: 1 << 1,}
Available on crate feature ast
only.
pub const PreserveLines: ListFormat = ListFormat{ bits: 1 << 1,}
ast
only.Prints the list using line preservation if possible.
pub const LinesMask: ListFormat = ListFormat{ bits: Self::SingleLine.bits | (Self::MultiLine.bits | Self::PreserveLines.bits),}
ast
only.sourceimpl ListFormat
impl ListFormat
sourcepub const NotDelimited: ListFormat = ListFormat{ bits: 0,}
Available on crate feature ast
only.
pub const NotDelimited: ListFormat = ListFormat{ bits: 0,}
ast
only.There is no delimiter between list items (default).
sourcepub const BarDelimited: ListFormat = ListFormat{ bits: 1 << 2,}
Available on crate feature ast
only.
pub const BarDelimited: ListFormat = ListFormat{ bits: 1 << 2,}
ast
only.Each list item is space-and-bar (“ |“) delimited.
sourcepub const AmpersandDelimited: ListFormat = ListFormat{ bits: 1 << 3,}
Available on crate feature ast
only.
pub const AmpersandDelimited: ListFormat = ListFormat{ bits: 1 << 3,}
ast
only.Each list item is space-and-ampersand (“ &“) delimited.
sourcepub const CommaDelimited: ListFormat = ListFormat{ bits: 1 << 4,}
Available on crate feature ast
only.
pub const CommaDelimited: ListFormat = ListFormat{ bits: 1 << 4,}
ast
only.Each list item is comma (“,”) delimited.
pub const DelimitersMask: ListFormat = ListFormat{ bits: Self::BarDelimited.bits | (Self::AmpersandDelimited.bits | Self::CommaDelimited.bits),}
ast
only.sourceimpl ListFormat
impl ListFormat
sourcepub const AllowTrailingComma: ListFormat = ListFormat{ bits: 1 << 5,}
Available on crate feature ast
only.
pub const AllowTrailingComma: ListFormat = ListFormat{ bits: 1 << 5,}
ast
only.Write a trailing comma (“,”) if present.
sourceimpl ListFormat
impl ListFormat
sourcepub const Indented: ListFormat = ListFormat{ bits: 1 << 6,}
Available on crate feature ast
only.
pub const Indented: ListFormat = ListFormat{ bits: 1 << 6,}
ast
only.The list should be indented.
sourcepub const SpaceBetweenBraces: ListFormat = ListFormat{ bits: 1 << 7,}
Available on crate feature ast
only.
pub const SpaceBetweenBraces: ListFormat = ListFormat{ bits: 1 << 7,}
ast
only.Inserts a space after the opening brace and before the closing brace.
sourcepub const SpaceBetweenSiblings: ListFormat = ListFormat{ bits: 1 << 8,}
Available on crate feature ast
only.
pub const SpaceBetweenSiblings: ListFormat = ListFormat{ bits: 1 << 8,}
ast
only.Inserts a space between each sibling node.
sourceimpl ListFormat
impl ListFormat
sourcepub const Braces: ListFormat = ListFormat{ bits: 1 << 9,}
Available on crate feature ast
only.
pub const Braces: ListFormat = ListFormat{ bits: 1 << 9,}
ast
only.The list is surrounded by “{” and “}”.
sourcepub const Parenthesis: ListFormat = ListFormat{ bits: 1 << 10,}
Available on crate feature ast
only.
pub const Parenthesis: ListFormat = ListFormat{ bits: 1 << 10,}
ast
only.The list is surrounded by “(” and “)”.
sourcepub const AngleBrackets: ListFormat = ListFormat{ bits: 1 << 11,}
Available on crate feature ast
only.
pub const AngleBrackets: ListFormat = ListFormat{ bits: 1 << 11,}
ast
only.The list is surrounded by “<” and “>”.
sourcepub const SquareBrackets: ListFormat = ListFormat{ bits: 1 << 12,}
Available on crate feature ast
only.
pub const SquareBrackets: ListFormat = ListFormat{ bits: 1 << 12,}
ast
only.The list is surrounded by “[” and “]”.
pub const BracketsMask: ListFormat = ListFormat{ bits: Self::Braces.bits | (Self::Parenthesis.bits | (Self::AngleBrackets.bits | Self::SquareBrackets.bits)),}
ast
only.sourceimpl ListFormat
impl ListFormat
sourcepub const OptionalIfUndefined: ListFormat = ListFormat{ bits: 1 << 13,}
Available on crate feature ast
only.
pub const OptionalIfUndefined: ListFormat = ListFormat{ bits: 1 << 13,}
ast
only.Do not emit brackets if the list is undefined.
sourcepub const OptionalIfEmpty: ListFormat = ListFormat{ bits: 1 << 14,}
Available on crate feature ast
only.
pub const OptionalIfEmpty: ListFormat = ListFormat{ bits: 1 << 14,}
ast
only.Do not emit brackets if the list is empty.
pub const Optional: ListFormat = ListFormat{ bits: Self::OptionalIfUndefined.bits | Self::OptionalIfEmpty.bits,}
ast
only.sourceimpl ListFormat
impl ListFormat
sourcepub const PreferNewLine: ListFormat = ListFormat{ bits: 1 << 15,}
Available on crate feature ast
only.
pub const PreferNewLine: ListFormat = ListFormat{ bits: 1 << 15,}
ast
only.Prefer adding a LineTerminator between synthesized nodes.
sourcepub const NoTrailingNewLine: ListFormat = ListFormat{ bits: 1 << 16,}
Available on crate feature ast
only.
pub const NoTrailingNewLine: ListFormat = ListFormat{ bits: 1 << 16,}
ast
only.Do not emit a trailing NewLine for a MultiLine list.
sourcepub const NoInterveningComments: ListFormat = ListFormat{ bits: 1 << 17,}
Available on crate feature ast
only.
pub const NoInterveningComments: ListFormat = ListFormat{ bits: 1 << 17,}
ast
only.Do not emit comments between each node
sourcepub const NoSpaceIfEmpty: ListFormat = ListFormat{ bits: 1 << 18,}
Available on crate feature ast
only.
pub const NoSpaceIfEmpty: ListFormat = ListFormat{ bits: 1 << 18,}
ast
only.If the literal is empty, do not add spaces between braces.
pub const SingleElement: ListFormat = ListFormat{ bits: 1 << 19,}
ast
only.pub const ForceTrailingComma: ListFormat = ListFormat{ bits: 1 << 20,}
ast
only.sourceimpl ListFormat
impl ListFormat
pub const CanSkipTrailingComma: ListFormat = ListFormat{ bits: 1 << 21,}
ast
only.sourceimpl ListFormat
impl ListFormat
pub const Modifiers: ListFormat = ListFormat{ bits: Self::SingleLine.bits | (Self::SpaceBetweenSiblings.bits | Self::NoInterveningComments.bits),}
ast
only.pub const HeritageClauses: ListFormat = ListFormat{ bits: Self::SingleLine.bits | Self::SpaceBetweenSiblings.bits,}
ast
only.pub const SingleLineTypeLiteralMembers: ListFormat = ListFormat{ bits: Self::SingleLine.bits | (Self::SpaceBetweenBraces.bits | (Self::SpaceBetweenSiblings.bits | Self::Indented.bits)),}
ast
only.pub const MultiLineTypeLiteralMembers: ListFormat = ListFormat{ bits: Self::MultiLine.bits | Self::Indented.bits,}
ast
only.pub const TupleTypeElements: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::SingleLine.bits | Self::Indented.bits)),}
ast
only.pub const UnionTypeConstituents: ListFormat = ListFormat{ bits: Self::BarDelimited.bits | (Self::SpaceBetweenSiblings.bits | Self::SingleLine.bits),}
ast
only.pub const IntersectionTypeConstituents: ListFormat = ListFormat{ bits: Self::AmpersandDelimited.bits | (Self::SpaceBetweenSiblings.bits | Self::SingleLine.bits),}
ast
only.pub const ObjectBindingPatternElements: ListFormat = ListFormat{ bits: Self::SingleLine.bits | (Self::AllowTrailingComma.bits | (Self::SpaceBetweenBraces.bits | (Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | Self::NoSpaceIfEmpty.bits)))),}
ast
only.pub const ArrayBindingPatternElements: ListFormat = ListFormat{ bits: Self::SingleLine.bits | (Self::AllowTrailingComma.bits | (Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | Self::NoSpaceIfEmpty.bits))),}
ast
only.pub const ObjectLiteralExpressionProperties: ListFormat = ListFormat{ bits: Self::MultiLine.bits | (Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::SpaceBetweenBraces.bits | (Self::Indented.bits | (Self::Braces.bits | Self::NoSpaceIfEmpty.bits))))),}
ast
only.pub const ArrayLiteralExpressionElements: ListFormat = ListFormat{ bits: Self::PreserveLines.bits | (Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::AllowTrailingComma.bits | (Self::Indented.bits | Self::SquareBrackets.bits)))),}
ast
only.pub const CommaListElements: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | Self::SingleLine.bits),}
ast
only.pub const CallExpressionArguments: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::SingleLine.bits | Self::Parenthesis.bits)),}
ast
only.pub const NewExpressionArguments: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::SingleLine.bits | (Self::Parenthesis.bits | Self::OptionalIfUndefined.bits))),}
ast
only.pub const TemplateExpressionSpans: ListFormat = ListFormat{ bits: Self::SingleLine.bits | Self::NoInterveningComments.bits,}
ast
only.pub const SingleLineBlockStatements: ListFormat = ListFormat{ bits: Self::SpaceBetweenBraces.bits | (Self::SpaceBetweenSiblings.bits | Self::SingleLine.bits),}
ast
only.pub const MultiLineBlockStatements: ListFormat = ListFormat{ bits: Self::Indented.bits | Self::MultiLine.bits,}
ast
only.pub const VariableDeclarationList: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | Self::SingleLine.bits),}
ast
only.pub const SingleLineFunctionBodyStatements: ListFormat = ListFormat{ bits: Self::SingleLine.bits | (Self::SpaceBetweenSiblings.bits | Self::SpaceBetweenBraces.bits),}
ast
only.pub const MultiLineFunctionBodyStatements: ListFormat = ListFormat{ bits: Self::MultiLine.bits,}
ast
only.pub const ClassHeritageClauses: ListFormat = ListFormat{ bits: Self::SingleLine.bits | Self::SpaceBetweenSiblings.bits,}
ast
only.pub const ClassMembers: ListFormat = ListFormat{ bits: Self::Indented.bits | Self::MultiLine.bits,}
ast
only.pub const InterfaceMembers: ListFormat = ListFormat{ bits: Self::Indented.bits | Self::MultiLine.bits,}
ast
only.pub const EnumMembers: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::Indented.bits | Self::MultiLine.bits),}
ast
only.pub const CaseBlockClauses: ListFormat = ListFormat{ bits: Self::Indented.bits | Self::MultiLine.bits,}
ast
only.pub const NamedImportsOrExportsElements: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::AllowTrailingComma.bits | (Self::SingleLine.bits | Self::SpaceBetweenBraces.bits))),}
ast
only.pub const JsxElementOrFragmentChildren: ListFormat = ListFormat{ bits: Self::SingleLine.bits | Self::NoInterveningComments.bits,}
ast
only.pub const JsxElementAttributes: ListFormat = ListFormat{ bits: Self::SingleLine.bits | (Self::SpaceBetweenSiblings.bits | Self::NoInterveningComments.bits),}
ast
only.pub const CaseOrDefaultClauseStatements: ListFormat = ListFormat{ bits: Self::Indented.bits | (Self::MultiLine.bits | (Self::NoTrailingNewLine.bits | Self::OptionalIfEmpty.bits)),}
ast
only.pub const HeritageClauseTypes: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | Self::SingleLine.bits),}
ast
only.pub const SourceFileStatements: ListFormat = ListFormat{ bits: Self::MultiLine.bits | Self::NoTrailingNewLine.bits,}
ast
only.pub const Decorators: ListFormat = ListFormat{ bits: Self::MultiLine.bits | Self::Optional.bits,}
ast
only.pub const TypeArguments: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::SingleLine.bits | (Self::AngleBrackets.bits | Self::Optional.bits))),}
ast
only.pub const TypeParameters: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::SingleLine.bits | (Self::AngleBrackets.bits | Self::Optional.bits))),}
ast
only.pub const Parameters: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::SingleLine.bits | Self::Parenthesis.bits)),}
ast
only.pub const IndexSignatureParameters: ListFormat = ListFormat{ bits: Self::CommaDelimited.bits | (Self::SpaceBetweenSiblings.bits | (Self::SingleLine.bits | (Self::Indented.bits | Self::SquareBrackets.bits))),}
ast
only.sourceimpl ListFormat
impl ListFormat
pub fn opening_bracket(self) -> &'static str
ast
only.pub fn closing_bracket(self) -> &'static str
ast
only.Trait Implementations
sourceimpl Binary for ListFormat
impl Binary for ListFormat
sourceimpl BitAnd<ListFormat> for ListFormat
impl BitAnd<ListFormat> for ListFormat
sourcefn bitand(self, other: ListFormat) -> ListFormat
fn bitand(self, other: ListFormat) -> ListFormat
Returns the intersection between the two sets of flags.
type Output = ListFormat
type Output = ListFormat
The resulting type after applying the &
operator.
sourceimpl BitAndAssign<ListFormat> for ListFormat
impl BitAndAssign<ListFormat> for ListFormat
sourcefn bitand_assign(&mut self, other: ListFormat)
fn bitand_assign(&mut self, other: ListFormat)
Disables all flags disabled in the set.
sourceimpl BitOr<ListFormat> for ListFormat
impl BitOr<ListFormat> for ListFormat
sourcefn bitor(self, other: ListFormat) -> ListFormat
fn bitor(self, other: ListFormat) -> ListFormat
Returns the union of the two sets of flags.
type Output = ListFormat
type Output = ListFormat
The resulting type after applying the |
operator.
sourceimpl BitOrAssign<ListFormat> for ListFormat
impl BitOrAssign<ListFormat> for ListFormat
sourcefn bitor_assign(&mut self, other: ListFormat)
fn bitor_assign(&mut self, other: ListFormat)
Adds the set of flags.
sourceimpl BitXor<ListFormat> for ListFormat
impl BitXor<ListFormat> for ListFormat
sourcefn bitxor(self, other: ListFormat) -> ListFormat
fn bitxor(self, other: ListFormat) -> ListFormat
Returns the left flags, but with all the right flags toggled.
type Output = ListFormat
type Output = ListFormat
The resulting type after applying the ^
operator.
sourceimpl BitXorAssign<ListFormat> for ListFormat
impl BitXorAssign<ListFormat> for ListFormat
sourcefn bitxor_assign(&mut self, other: ListFormat)
fn bitxor_assign(&mut self, other: ListFormat)
Toggles the set of flags.
sourceimpl Clone for ListFormat
impl Clone for ListFormat
sourcefn clone(&self) -> ListFormat
fn clone(&self) -> ListFormat
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ListFormat
impl Debug for ListFormat
sourceimpl Extend<ListFormat> for ListFormat
impl Extend<ListFormat> for ListFormat
sourcefn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = ListFormat>,
fn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = ListFormat>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<ListFormat> for ListFormat
impl FromIterator<ListFormat> for ListFormat
sourcefn from_iter<T>(iterator: T) -> ListFormat where
T: IntoIterator<Item = ListFormat>,
fn from_iter<T>(iterator: T) -> ListFormat where
T: IntoIterator<Item = ListFormat>,
Creates a value from an iterator. Read more
sourceimpl Hash for ListFormat
impl Hash for ListFormat
sourceimpl LowerHex for ListFormat
impl LowerHex for ListFormat
sourceimpl Not for ListFormat
impl Not for ListFormat
sourcefn not(self) -> ListFormat
fn not(self) -> ListFormat
Returns the complement of this set of flags.
type Output = ListFormat
type Output = ListFormat
The resulting type after applying the !
operator.
sourceimpl Octal for ListFormat
impl Octal for ListFormat
sourceimpl Ord for ListFormat
impl Ord for ListFormat
sourcefn cmp(&self, other: &ListFormat) -> Ordering
fn cmp(&self, other: &ListFormat) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<ListFormat> for ListFormat
impl PartialEq<ListFormat> for ListFormat
sourcefn eq(&self, other: &ListFormat) -> bool
fn eq(&self, other: &ListFormat) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialOrd<ListFormat> for ListFormat
impl PartialOrd<ListFormat> for ListFormat
sourcefn partial_cmp(&self, other: &ListFormat) -> Option<Ordering>
fn partial_cmp(&self, other: &ListFormat) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Sub<ListFormat> for ListFormat
impl Sub<ListFormat> for ListFormat
sourcefn sub(self, other: ListFormat) -> ListFormat
fn sub(self, other: ListFormat) -> ListFormat
Returns the set difference of the two sets of flags.
type Output = ListFormat
type Output = ListFormat
The resulting type after applying the -
operator.
sourceimpl SubAssign<ListFormat> for ListFormat
impl SubAssign<ListFormat> for ListFormat
sourcefn sub_assign(&mut self, other: ListFormat)
fn sub_assign(&mut self, other: ListFormat)
Disables all flags enabled in the set.
sourceimpl UpperHex for ListFormat
impl UpperHex for ListFormat
impl Copy for ListFormat
impl Eq for ListFormat
impl StructuralEq for ListFormat
impl StructuralPartialEq for ListFormat
Auto Trait Implementations
impl RefUnwindSafe for ListFormat
impl Send for ListFormat
impl Sync for ListFormat
impl Unpin for ListFormat
impl UnwindSafe for ListFormat
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ImplicitClone for T where
T: Clone,
impl<T> ImplicitClone for T where
T: Clone,
sourcefn clone_quote_var(&self) -> Self
fn clone_quote_var(&self) -> Self
quote
only.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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,
Set the foreground color generically Read more
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self> where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self> where
C: Color,
Set the background color generically. Read more
fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
Change the foreground color to black
fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
Change the background color to black
fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
Change the foreground color to red
fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
Change the background color to red
fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
Change the foreground color to green
fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
Change the background color to green
fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
Change the foreground color to yellow
fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
Change the background color to yellow
fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
Change the foreground color to blue
fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
Change the background color to blue
fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Change the foreground color to magenta
fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Change the background color to magenta
fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Change the foreground color to purple
fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Change the background color to purple
fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
Change the foreground color to cyan
fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
Change the background color to cyan
fn white(&'a self) -> FgColorDisplay<'a, White, Self>
fn white(&'a self) -> FgColorDisplay<'a, White, Self>
Change the foreground color to white
fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
Change the background color to white
fn default_color(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color(&'a self) -> FgColorDisplay<'a, Default, Self>
Change the foreground color to the terminal default
fn on_default_color(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color(&'a self) -> BgColorDisplay<'a, Default, Self>
Change the background color to the terminal default
fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
Change the foreground color to bright black
fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
Change the background color to bright black
fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
Change the foreground color to bright red
fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
Change the background color to bright red
fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
Change the foreground color to bright green
fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
Change the background color to bright green
fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
Change the foreground color to bright yellow
fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
Change the background color to bright yellow
fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
Change the foreground color to bright blue
fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
Change the background color to bright blue
fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Change the foreground color to bright magenta
fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Change the background color to bright magenta
fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Change the foreground color to bright purple
fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Change the background color to bright purple
fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
Change the foreground color to bright cyan
fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
Change the background color to bright cyan
fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
Change the foreground color to bright white
fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
Change the background color to bright white
fn bold(&'a self) -> BoldDisplay<'a, Self>
fn bold(&'a self) -> BoldDisplay<'a, Self>
Make the text bold
fn dimmed(&'a self) -> DimDisplay<'a, Self>
fn dimmed(&'a self) -> DimDisplay<'a, Self>
Make the text dim
fn italic(&'a self) -> ItalicDisplay<'a, Self>
fn italic(&'a self) -> ItalicDisplay<'a, Self>
Make the text italicized
fn underline(&'a self) -> UnderlineDisplay<'a, Self>
fn underline(&'a self) -> UnderlineDisplay<'a, Self>
Make the text italicized
fn blink(&'a self) -> BlinkDisplay<'a, Self>
fn blink(&'a self) -> BlinkDisplay<'a, Self>
Make the text blink
fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
Make the text blink (but fast!)
fn reversed(&'a self) -> ReversedDisplay<'a, Self>
fn reversed(&'a self) -> ReversedDisplay<'a, Self>
Swap the foreground and background colors
Hide the text
fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
Cross out the text
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self> where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self> where
Color: DynColor,
Set the foreground color at runtime. Only use if you do not know which color will be used at
compile-time. If the color is constant, use either 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,
Set the background color at runtime. Only use if you do not know what color to use at
compile-time. If the color is constant, use either OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more
fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the foreground color to a specific RGB value.
fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the background color to a specific RGB value.
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Sets the foreground color to an RGB value.
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Sets the background color to an RGB value.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more