Struct lexical_parse_float::options::Options
source · [−]pub struct Options { /* 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
sourceimpl Options
impl Options
sourcepub const fn from_radix(radix: u8) -> Self
pub const fn from_radix(radix: u8) -> Self
Create the default options for a given radix.
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 unsafe fn set_lossy(&mut self, lossy: bool)
pub unsafe fn set_lossy(&mut self, lossy: bool)
Set if we disable the use of arbitrary-precision arithmetic.
Safety
Always safe, just marked as unsafe for API compatibility.
sourcepub unsafe fn set_exponent(&mut self, exponent: u8)
pub unsafe fn set_exponent(&mut self, exponent: u8)
Set the character to designate the exponent component of a float.
Safety
Always safe, but may produce invalid output if the exponent is not a valid ASCII character.
sourcepub unsafe fn set_decimal_point(&mut self, decimal_point: u8)
pub unsafe fn set_decimal_point(&mut self, decimal_point: u8)
Set the character to separate the integer from the fraction components.
Safety
Always safe, but may produce invalid output if the decimal point is not a valid ASCII character.
sourcepub unsafe fn set_nan_string(&mut self, nan_string: Option<&'static [u8]>)
pub unsafe fn set_nan_string(&mut self, nan_string: Option<&'static [u8]>)
Set the string representation for NaN
.
Unsafe, use the builder API for option validation.
Safety
Always safe, just marked as unsafe for API compatibility.
sourcepub unsafe fn set_inf_string(&mut self, inf_string: Option<&'static [u8]>)
pub unsafe fn set_inf_string(&mut self, inf_string: Option<&'static [u8]>)
Set the short string representation for Infinity
Unsafe, use the builder API for option validation.
Safety
Always safe, just marked as unsafe for API compatibility.
sourcepub unsafe fn set_infinity_string(
&mut self,
infinity_string: Option<&'static [u8]>
)
pub unsafe fn set_infinity_string(
&mut self,
infinity_string: Option<&'static [u8]>
)
Set the long string representation for Infinity
Unsafe, use the builder API for option validation.
Safety
Always safe, just marked as unsafe for API compatibility.
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
sourceimpl Ord for Options
impl Ord for Options
sourceimpl ParseOptions for Options
impl ParseOptions for Options
sourceimpl PartialOrd<Options> for Options
impl PartialOrd<Options> for Options
sourcefn partial_cmp(&self, other: &Options) -> Option<Ordering>
fn partial_cmp(&self, other: &Options) -> 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
impl Eq for Options
impl StructuralEq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more