pub struct NumberParserSettings {
pub permit_underscores: bool,
pub permit_hexadecimal: bool,
pub permit_octal: bool,
pub permit_binary: bool,
pub permit_plus: bool,
pub hexadecimal_indicator: Vec<char>,
pub octal_indicator: Vec<char>,
pub binary_indicator: Vec<char>,
pub decimal_only_floats: bool,
pub permit_empty_whole: bool,
pub permit_empty_fraction: bool,
pub permit_leading_zero: bool,
}
Expand description
Provide the number parser configuration. You will seldom use this directly.
Instead, reference the current settings through a NumberParser
instance.
Fields§
§permit_underscores: bool
Allow underscores in numbers. If this is true, then arbitrary underscores can occur in numbers, and these are dropped during parsing. If false, then underscores are not permitted.
permit_hexadecimal: bool
If true, methods that do not explicitly specify a radix will try to detect and parse hexadecimal numbers.
permit_octal: bool
If true, methods that do not explicitly specify a radix will try to detect and parse octal numbers.
permit_binary: bool
If true, methods that do not explicitly specify a radix will try to detect and parse binary numbers.
permit_plus: bool
If true, allow a number to start with a plus sign.
hexadecimal_indicator: Vec<char>
Specify the characters that indicate a hexadecimal value.
octal_indicator: Vec<char>
Specify the characters that indicate an octal value.
binary_indicator: Vec<char>
Specify the characters that indicate a binary value.
decimal_only_floats: bool
If true, floating point numbers can be in non-decimal radix.
permit_empty_whole: bool
If true, permit an empty whole part. That is, .15
is legal.
permit_empty_fraction: bool
If true, permit an empty fractional part. That is, 15.
is legal.
permit_leading_zero: bool
If true, permit a leading zero for a non-zero whole. That is, 01.5
is legal.
NB: This only applies to decimal numbers, as leading zeros are common and expected in other bases.
Implementations§
Trait Implementations§
Source§impl Clone for NumberParserSettings
impl Clone for NumberParserSettings
Source§fn clone(&self) -> NumberParserSettings
fn clone(&self) -> NumberParserSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more