NumberStyles
struct · ferroui-base · v0.5.0
struct NumberStyles
The styles permitted in the text of a number that is parsed.
Members
NONEALLOW_LEADING_WHITEALLOW_TRAILING_WHITEALLOW_LEADING_SIGNALLOW_TRAILING_SIGNALLOW_PARENTHESESALLOW_DECIMAL_POINTALLOW_THOUSANDSALLOW_EXPONENTALLOW_CURRENCY_SYMBOLALLOW_HEX_SPECIFIERALLOW_BINARY_SPECIFIERINTEGERHEX_NUMBERBINARY_NUMBERNUMBERFLOATCURRENCYANYemptyallbitsfrom_bitsfrom_bits_truncatefrom_bits_retainfrom_nameis_emptyis_allintersectscontainsinsertremovetogglesetintersectionuniondifferencesymmetric_differencecomplementiteriter_names
NONE
const NONE: Self
No style elements: decimal digits only.
ALLOW_LEADING_WHITE
const ALLOW_LEADING_WHITE: Self
White space may come first.
ALLOW_TRAILING_WHITE
const ALLOW_TRAILING_WHITE: Self
White space may come last.
ALLOW_LEADING_SIGN
const ALLOW_LEADING_SIGN: Self
A sign may come first.
ALLOW_TRAILING_SIGN
const ALLOW_TRAILING_SIGN: Self
A sign may come last.
ALLOW_PARENTHESES
const ALLOW_PARENTHESES: Self
One pair of parentheses may enclose the number, which is then negative.
ALLOW_DECIMAL_POINT
const ALLOW_DECIMAL_POINT: Self
A decimal point is permitted.
ALLOW_THOUSANDS
const ALLOW_THOUSANDS: Self
Group separators are permitted.
ALLOW_EXPONENT
const ALLOW_EXPONENT: Self
An exponent (E or e, an optional sign, digits) is permitted.
ALLOW_CURRENCY_SYMBOL
const ALLOW_CURRENCY_SYMBOL: Self
A currency symbol is permitted.
ALLOW_HEX_SPECIFIER
const ALLOW_HEX_SPECIFIER: Self
The text is a hexadecimal number.
ALLOW_BINARY_SPECIFIER
const ALLOW_BINARY_SPECIFIER: Self
The text is a binary number.
INTEGER
const INTEGER: Self
Leading and trailing white space and a leading sign.
HEX_NUMBER
const HEX_NUMBER: Self
Leading and trailing white space and hexadecimal digits.
BINARY_NUMBER
const BINARY_NUMBER: Self
Leading and trailing white space and binary digits.
NUMBER
const NUMBER: Self
White space, a leading or trailing sign, a decimal point and group separators.
FLOAT
const FLOAT: Self
White space, a leading sign, a decimal point and an exponent.
CURRENCY
const CURRENCY: Self
Every style except the exponent and the hexadecimal and binary specifiers.
ANY
const ANY: Self
Every style except the hexadecimal and binary specifiers.
empty
const fn empty() -> Self
Get a flags value with all bits unset.
all
const fn all() -> Self
Get a flags value with all known bits set.
bits
const fn bits(self: &Self) -> i32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
from_bits
const fn from_bits(bits: i32) -> $crate::__private::core::option::Option<Self>
Convert from a bits value.
This method will return None if any unknown bits are set.
from_bits_truncate
const fn from_bits_truncate(bits: i32) -> Self
Convert from a bits value, unsetting any unknown bits.
from_bits_retain
const fn from_bits_retain(bits: i32) -> Self
Convert from a bits value exactly.
from_name
fn from_name(name: &str) -> $crate::__private::core::option::Option<Self>
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.
is_empty
const fn is_empty(self: &Self) -> bool
Whether all bits in self are unset.
is_all
const fn is_all(self: &Self) -> bool
Whether all known bits in this flags value are set.
intersects
const fn intersects(self: &Self, other: Self) -> bool
Whether any set bits in other are also set in self.
contains
const fn contains(self: &Self, other: Self) -> bool
Whether all set bits in other are also set in self.
insert
fn insert(self: &mut Self, other: Self)
The bitwise or (|) of the bits in self and other.
remove
fn remove(self: &mut Self, other: Self)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won't truncate other, but the ! operator will.
toggle
fn toggle(self: &mut Self, other: Self)
The bitwise exclusive-or (^) of the bits in self and other.
set
fn set(self: &mut Self, other: Self, value: bool)
Call insert when value is true or remove when value is false.
intersection
const fn intersection(self: Self, other: Self) -> Self
The bitwise and (&) of the bits in self and other.
union
const fn union(self: Self, other: Self) -> Self
The bitwise or (|) of the bits in self and other.
difference
const fn difference(self: Self, other: Self) -> Self
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won't truncate other, but the ! operator will.
symmetric_difference
const fn symmetric_difference(self: Self, other: Self) -> Self
The bitwise exclusive-or (^) of the bits in self and other.
complement
const fn complement(self: Self) -> Self
The bitwise negation (!) of the bits in self, truncating the result.
iter
const fn iter(self: &Self) -> $crate::iter::Iter<NumberStyles>
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.
iter_names
const fn iter_names(self: &Self) -> $crate::iter::IterNames<NumberStyles>
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeResourceKeyObjectPropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneCopyDebugDefaultStructuralPartialEqPartialEqEqHashFlagsPublicFlagsBinaryOctalLowerHexUpperHexBitOrBitOrAssignBitXorBitXorAssignBitAndBitAndAssignSubSubAssignNotExtend<NumberStyles>FromIterator<NumberStyles>IntoIteratorMarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.