pub struct Num { /* private fields */ }
Expand description
A DynamoDB numeric value.
See also: Scalar::new_num
, Value::new_num
,
Scalar::new_num_lower_exp
, Value::new_num_lower_exp
,
Scalar::new_num_upper_exp
, Value::new_num_upper_exp
§Examples
use dynamodb_expression::value::Num;
let value = Num::new(2600);
assert_eq!("2600", value.to_string());
let value = Num::new_lower_exp(2600);
assert_eq!("2.6e3", value.to_string());
let value = Num::new_upper_exp(2600);
assert_eq!("2.6E3", value.to_string());
let value = Num::new(2600.0);
assert_eq!("2600", value.to_string());
let value = Num::new_lower_exp(2600.0);
assert_eq!("2.6e3", value.to_string());
let value = Num::new_upper_exp(2600.0);
assert_eq!("2.6E3", value.to_string());
Implementations§
Source§impl Num
impl Num
Sourcepub fn new<T>(value: T) -> Self
pub fn new<T>(value: T) -> Self
Creates a DynamoDB numeric value.
See also: Num::new_lower_exp
, Num::new_upper_exp
, Scalar::new_num
,
Value::new_num
§Examples
use dynamodb_expression::value::Num;
let value = Num::new(2600);
assert_eq!("2600", value.to_string());
let value = Num::new(2600.0);
assert_eq!("2600", value.to_string());
Sourcepub fn new_lower_exp<T>(value: T) -> Self
pub fn new_lower_exp<T>(value: T) -> Self
Creates a DynamoDB numeric value.
See also: Num::new
, Num::new_upper_exp
, Scalar::new_num_lower_exp
,
Value::new_num_lower_exp
§Examples
use dynamodb_expression::value::Num;
let value = Num::new_lower_exp(2600);
assert_eq!("2.6e3", value.to_string());
let value = Num::new_lower_exp(2600.0);
assert_eq!("2.6e3", value.to_string());
Sourcepub fn new_upper_exp<T>(value: T) -> Self
pub fn new_upper_exp<T>(value: T) -> Self
Creates a DynamoDB numeric value.
See also: Num::new
, Num::new_lower_exp
, Scalar::new_num_upper_exp
,
Value::new_num_upper_exp
§Examples
use dynamodb_expression::value::Num;
let value = Num::new_upper_exp(2600);
assert_eq!("2.6E3", value.to_string());
let value = Num::new_upper_exp(2600.0);
assert_eq!("2.6E3", value.to_string());
Trait Implementations§
Source§impl Ord for Num
impl Ord for Num
Source§impl PartialOrd for Num
impl PartialOrd for Num
impl Eq for Num
impl StructuralPartialEq for Num
Auto Trait Implementations§
impl Freeze for Num
impl RefUnwindSafe for Num
impl Send for Num
impl Sync for Num
impl Unpin for Num
impl UnwindSafe for Num
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreCreates a shared type from an unshared type.