pub struct Options { /* private fields */ }
Expand description
Options to customize the parsing integers.
§Examples
use lexical_parse_integer::{FromLexicalWithOptions, Options};
use lexical_parse_integer::format::STANDARD;
const OPTIONS: Options = Options::builder()
.no_multi_digit(true)
.build_strict();
let value = "1234";
let result = u64::from_lexical_with_options::<STANDARD>(value.as_bytes(), &OPTIONS);
assert_eq!(result, Ok(1234));
Implementations§
Source§impl Options
impl Options
Sourcepub const fn from_radix(_: u8) -> Self
Available on crate feature power-of-two
only.
pub const fn from_radix(_: u8) -> Self
power-of-two
only.Create the default options for a given radix.
Sourcepub const fn get_no_multi_digit(&self) -> bool
pub const fn get_no_multi_digit(&self) -> bool
Sourcepub fn no_multi_digit(&mut self, no_multi_digit: bool)
👎Deprecated: Setters should have a set_
prefix. Use set_no_multi_digit
instead. Will be removed in 2.0.
pub fn no_multi_digit(&mut self, no_multi_digit: bool)
set_
prefix. Use set_no_multi_digit
instead. Will be removed in 2.0.Set if we disable the use of multi-digit optimizations.
Sourcepub fn set_no_multi_digit(&mut self, no_multi_digit: bool)
👎Deprecated: Options should be treated as immutable, use OptionsBuilder
instead. Will be removed in 2.0.
pub fn set_no_multi_digit(&mut self, no_multi_digit: bool)
OptionsBuilder
instead. Will be removed in 2.0.Set if we disable the use of multi-digit optimizations.
Sourcepub const fn builder() -> OptionsBuilder
pub const fn builder() -> OptionsBuilder
Get OptionsBuilder
as a static function.
Sourcepub const fn rebuild(&self) -> OptionsBuilder
pub const fn rebuild(&self) -> OptionsBuilder
Create OptionsBuilder
using existing values.
Trait Implementations§
Source§impl Ord for Options
impl Ord for Options
Source§impl ParseOptions for Options
impl ParseOptions for Options
Source§impl PartialOrd for Options
impl PartialOrd for Options
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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
Mutably borrows from an owned value. Read more