Enum aws_smithy_types::Number
source · pub enum Number {
PosInt(u64),
NegInt(i64),
Float(f64),
}
Expand description
A number type that implements Javascript / JSON semantics, modeled on serde_json: https://docs.serde.rs/src/serde_json/number.rs.html#20-22
Variants§
PosInt(u64)
Unsigned 64-bit integer value.
NegInt(i64)
Signed 64-bit integer value. The wrapped value is always negative.
Float(f64)
64-bit floating-point value.
Implementations§
source§impl Number
impl Number
sourcepub fn to_f64_lossy(self) -> f64
pub fn to_f64_lossy(self) -> f64
Converts to an f64
lossily.
Use Number::try_from
to make the conversion only if it is not lossy.
sourcepub fn to_f32_lossy(self) -> f32
pub fn to_f32_lossy(self) -> f32
Converts to an f32
lossily.
Use Number::try_from
to make the conversion only if it is not lossy.
Trait Implementations§
source§impl PartialEq for Number
impl PartialEq for Number
impl Copy for Number
impl StructuralPartialEq for Number
Auto Trait Implementations§
impl Freeze for Number
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnwindSafe for Number
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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<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
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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