Struct dynamodb_expression::value::Num
source · 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
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Num
impl StructuralEq for Num
impl StructuralPartialEq for Num
Auto Trait Implementations§
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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>
Creates a shared type from an unshared type.