Struct lexical_core::ParseFloatOptionsBuilder
source · pub struct ParseFloatOptionsBuilder { /* private fields */ }
Expand description
Builder for Options
.
Implementations§
source§impl OptionsBuilder
impl OptionsBuilder
sourcepub const fn new() -> OptionsBuilder
pub const fn new() -> OptionsBuilder
Create new options builder with default options.
sourcepub const fn get_lossy(&self) -> bool
pub const fn get_lossy(&self) -> bool
Get if we disable the use of arbitrary-precision arithmetic.
sourcepub const fn get_exponent(&self) -> u8
pub const fn get_exponent(&self) -> u8
Get the character to designate the exponent component of a float.
sourcepub const fn get_decimal_point(&self) -> u8
pub const fn get_decimal_point(&self) -> u8
Get the character to separate the integer from the fraction components.
sourcepub const fn get_nan_string(&self) -> Option<&'static [u8]>
pub const fn get_nan_string(&self) -> Option<&'static [u8]>
Get the string representation for NaN
.
sourcepub const fn get_inf_string(&self) -> Option<&'static [u8]>
pub const fn get_inf_string(&self) -> Option<&'static [u8]>
Get the short string representation for Infinity
.
sourcepub const fn get_infinity_string(&self) -> Option<&'static [u8]>
pub const fn get_infinity_string(&self) -> Option<&'static [u8]>
Get the long string representation for Infinity
.
sourcepub const fn lossy(self, lossy: bool) -> OptionsBuilder
pub const fn lossy(self, lossy: bool) -> OptionsBuilder
Set if we disable the use of arbitrary-precision arithmetic.
sourcepub const fn exponent(self, exponent: u8) -> OptionsBuilder
pub const fn exponent(self, exponent: u8) -> OptionsBuilder
Set the character to designate the exponent component of a float.
sourcepub const fn decimal_point(self, decimal_point: u8) -> OptionsBuilder
pub const fn decimal_point(self, decimal_point: u8) -> OptionsBuilder
Set the character to separate the integer from the fraction components.
sourcepub const fn nan_string(
self,
nan_string: Option<&'static [u8]>,
) -> OptionsBuilder
pub const fn nan_string( self, nan_string: Option<&'static [u8]>, ) -> OptionsBuilder
Set the string representation for NaN
.
sourcepub const fn inf_string(
self,
inf_string: Option<&'static [u8]>,
) -> OptionsBuilder
pub const fn inf_string( self, inf_string: Option<&'static [u8]>, ) -> OptionsBuilder
Set the short string representation for Infinity
.
sourcepub const fn infinity_string(
self,
infinity_string: Option<&'static [u8]>,
) -> OptionsBuilder
pub const fn infinity_string( self, infinity_string: Option<&'static [u8]>, ) -> OptionsBuilder
Set the long string representation for Infinity
.
sourcepub const fn nan_str_is_valid(&self) -> bool
pub const fn nan_str_is_valid(&self) -> bool
Determine if nan_str
is valid.
sourcepub const fn inf_str_is_valid(&self) -> bool
pub const fn inf_str_is_valid(&self) -> bool
Determine if inf_str
is valid.
sourcepub const fn infinity_string_is_valid(&self) -> bool
pub const fn infinity_string_is_valid(&self) -> bool
Determine if infinity_string
is valid.
sourcepub const fn build_unchecked(&self) -> Options
pub const fn build_unchecked(&self) -> Options
Build the Options struct without validation.
§Panics
This is completely safe, however, misusing this, especially
the nan_string
, inf_string
, and infinity_string
could
panic at runtime. Always use [MAX_SPECIAL_STRING_LENGTH
] and
check if Self::is_valid
prior to using a created format string.
Trait Implementations§
source§impl Clone for OptionsBuilder
impl Clone for OptionsBuilder
source§fn clone(&self) -> OptionsBuilder
fn clone(&self) -> OptionsBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OptionsBuilder
impl Debug for OptionsBuilder
source§impl Default for OptionsBuilder
impl Default for OptionsBuilder
source§fn default() -> OptionsBuilder
fn default() -> OptionsBuilder
source§impl Ord for OptionsBuilder
impl Ord for OptionsBuilder
source§fn cmp(&self, other: &OptionsBuilder) -> Ordering
fn cmp(&self, other: &OptionsBuilder) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for OptionsBuilder
impl PartialEq for OptionsBuilder
source§impl PartialOrd for OptionsBuilder
impl PartialOrd for OptionsBuilder
impl Eq for OptionsBuilder
impl StructuralPartialEq for OptionsBuilder
Auto Trait Implementations§
impl Freeze for OptionsBuilder
impl RefUnwindSafe for OptionsBuilder
impl Send for OptionsBuilder
impl Sync for OptionsBuilder
impl Unpin for OptionsBuilder
impl UnwindSafe for OptionsBuilder
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
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)
clone_to_uninit
)