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§
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: 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
)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
)