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§
source§impl 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§
source§impl Clone for FromSciStringOptions
impl Clone for FromSciStringOptions
source§fn clone(&self) -> FromSciStringOptions
fn clone(&self) -> FromSciStringOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FromSciStringOptions
impl Debug for FromSciStringOptions
source§impl Default for FromSciStringOptions
impl Default for FromSciStringOptions
source§fn default() -> FromSciStringOptions
fn default() -> FromSciStringOptions
Returns the “default value” for a type. Read more
source§impl PartialEq for FromSciStringOptions
impl PartialEq for FromSciStringOptions
impl Copy for FromSciStringOptions
impl Eq for FromSciStringOptions
impl StructuralPartialEq for FromSciStringOptions
Auto Trait Implementations§
impl Freeze for FromSciStringOptions
impl RefUnwindSafe for FromSciStringOptions
impl Send for FromSciStringOptions
impl Sync for FromSciStringOptions
impl Unpin for FromSciStringOptions
impl UnwindSafe for FromSciStringOptions
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more