Struct lexical_core::ParseFloatOptions
source · pub struct ParseFloatOptions { /* private fields */ }
Expand description
Options to customize parsing floats.
§Examples
use lexical_parse_float::Options;
let options = Options::builder()
.lossy(true)
.nan_string(Some(b"NaN"))
.inf_string(Some(b"Inf"))
.infinity_string(Some(b"Infinity"))
.build()
.unwrap();
Implementations§
source§impl Options
impl Options
sourcepub const fn exponent(&self) -> u8
pub const fn exponent(&self) -> u8
Get the character to designate the exponent component of a float.
sourcepub const fn decimal_point(&self) -> u8
pub const fn decimal_point(&self) -> u8
Get the character to separate the integer from the fraction components.
sourcepub const fn nan_string(&self) -> Option<&'static [u8]>
pub const fn nan_string(&self) -> Option<&'static [u8]>
Get the string representation for NaN
.
sourcepub const fn inf_string(&self) -> Option<&'static [u8]>
pub const fn inf_string(&self) -> Option<&'static [u8]>
Get the short string representation for Infinity
.
sourcepub const fn infinity_string(&self) -> Option<&'static [u8]>
pub const fn infinity_string(&self) -> Option<&'static [u8]>
Get the long string representation for Infinity
.
sourcepub fn set_lossy(&mut self, lossy: bool)
pub fn set_lossy(&mut self, lossy: bool)
Set if we disable the use of arbitrary-precision arithmetic.
sourcepub fn set_exponent(&mut self, exponent: u8)
pub fn set_exponent(&mut self, exponent: u8)
Set the character to designate the exponent component of a float.
sourcepub fn set_decimal_point(&mut self, decimal_point: u8)
pub fn set_decimal_point(&mut self, decimal_point: u8)
Set the character to separate the integer from the fraction components.
sourcepub fn set_nan_string(&mut self, nan_string: Option<&'static [u8]>)
pub fn set_nan_string(&mut self, nan_string: Option<&'static [u8]>)
Set the string representation for NaN
.
sourcepub fn set_inf_string(&mut self, inf_string: Option<&'static [u8]>)
pub fn set_inf_string(&mut self, inf_string: Option<&'static [u8]>)
Set the short string representation for Infinity
sourcepub fn set_infinity_string(&mut self, infinity_string: Option<&'static [u8]>)
pub fn set_infinity_string(&mut self, infinity_string: Option<&'static [u8]>)
Set the long string representation for Infinity
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)