Struct malachite_base::num::conversion::string::options::FromSciStringOptions
source · [−]pub struct FromSciStringOptions { /* private fields */ }
Expand description
A struct
determining how a number should be parsed from a “scientific” string.
-
The base must be between 2 and 36, inclusive. The characters representing the digits may be
'0'
through'9'
and either'a'
through'z'
or'A'
through'Z'
. The default base is 10. -
The rounding mode determines how the output should be rounded, in case the output type can’t represent all possible input strings. The default rounding mode is
Nearest
.
Implementations
sourceimpl FromSciStringOptions
impl FromSciStringOptions
sourcepub const fn get_base(&self) -> u8
pub const fn get_base(&self) -> u8
Returns the base to be used in the conversion. It is always between 2 and 36, inclusive.
sourcepub const fn get_rounding_mode(&self) -> RoundingMode
pub const fn get_rounding_mode(&self) -> RoundingMode
Returns the rounding mode to be used in the conversion.
sourcepub fn set_base(&mut self, base: u8)
pub fn set_base(&mut self, base: u8)
Sets the base to be used in the conversion.
Panics
Panics if base
is less than 2 or greater than 36.
sourcepub fn set_rounding_mode(&mut self, rm: RoundingMode)
pub fn set_rounding_mode(&mut self, rm: RoundingMode)
Sets the rounding mode to be used in the conversion.
Trait Implementations
sourceimpl Clone for FromSciStringOptions
impl Clone for FromSciStringOptions
sourcefn clone(&self) -> FromSciStringOptions
fn clone(&self) -> FromSciStringOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FromSciStringOptions
impl Debug for FromSciStringOptions
sourceimpl Default for FromSciStringOptions
impl Default for FromSciStringOptions
sourcefn default() -> FromSciStringOptions
fn default() -> FromSciStringOptions
Returns the “default value” for a type. Read more
sourceimpl PartialEq<FromSciStringOptions> for FromSciStringOptions
impl PartialEq<FromSciStringOptions> for FromSciStringOptions
sourcefn eq(&self, other: &FromSciStringOptions) -> bool
fn eq(&self, other: &FromSciStringOptions) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &FromSciStringOptions) -> bool
fn ne(&self, other: &FromSciStringOptions) -> bool
This method tests for !=
.
impl Copy for FromSciStringOptions
impl Eq for FromSciStringOptions
impl StructuralEq for FromSciStringOptions
impl StructuralPartialEq for FromSciStringOptions
Auto Trait Implementations
impl RefUnwindSafe for FromSciStringOptions
impl Send for FromSciStringOptions
impl Sync for FromSciStringOptions
impl Unpin for FromSciStringOptions
impl UnwindSafe for FromSciStringOptions
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