Enum dynamodb_expression::value::Scalar
source · pub enum Scalar {
String(String),
Num(Num),
Bool(bool),
Binary(Vec<u8>),
Null,
}
Expand description
Variants§
String(String)
DynamoDB string value
Num(Num)
DynamoDB numeric value
Bool(bool)
DynamoDB boolean value
Binary(Vec<u8>)
DynamoDB binary value
Null
DynamoDB null value
Implementations§
source§impl Scalar
impl Scalar
sourcepub fn new_string<T>(value: T) -> Selfwhere
T: Into<String>,
pub fn new_string<T>(value: T) -> Selfwhere T: Into<String>,
Use when you need a string value for DynamoDB.
See also: Value::new_string
sourcepub fn new_num<N>(value: N) -> Selfwhere
N: ToString + Num,
pub fn new_num<N>(value: N) -> Selfwhere N: ToString + Num,
Use when you need a numeric value for DynamoDB.
See also: Scalar::new_num_lower_exp
, Scalar::new_num_upper_exp
,
Value::new_num
, Num
Examples
use dynamodb_expression::Scalar;
let value = Scalar::new_num(2600);
assert_eq!("2600", value.to_string());
let value = Scalar::new_num(2600.0);
assert_eq!("2600", value.to_string());
sourcepub fn new_num_lower_exp<N>(value: N) -> Selfwhere
N: LowerExp + Num,
pub fn new_num_lower_exp<N>(value: N) -> Selfwhere N: LowerExp + Num,
Use when you need a numeric value for DynamoDB in exponent form
(with a lowercase e
).
See also: Scalar::new_num
, Scalar::new_num_upper_exp
,
Value::new_num_lower_exp
, Num
Examples
use dynamodb_expression::Scalar;
let value = Scalar::new_num_lower_exp(2600);
assert_eq!("2.6e3", value.to_string());
let value = Scalar::new_num_lower_exp(2600.0);
assert_eq!("2.6e3", value.to_string());
sourcepub fn new_num_upper_exp<N>(value: N) -> Selfwhere
N: UpperExp + Num,
pub fn new_num_upper_exp<N>(value: N) -> Selfwhere N: UpperExp + Num,
Use when you need a numeric value for DynamoDB in exponent form
(with an uppercase e
).
See also: Scalar::new_num
, Scalar::new_num_lower_exp
,
Value::new_num_upper_exp
, Num
Examples
use dynamodb_expression::Scalar;
let value = Scalar::new_num_upper_exp(2600);
assert_eq!("2.6E3", value.to_string());
let value = Scalar::new_num_upper_exp(2600.0);
assert_eq!("2.6E3", value.to_string());
sourcepub fn new_bool(b: bool) -> Self
pub fn new_bool(b: bool) -> Self
Use when you need a boolean value for DynamoDB.
See also: Value::new_bool
sourcepub fn new_binary<B>(binary: B) -> Selfwhere
B: Into<Vec<u8>>,
pub fn new_binary<B>(binary: B) -> Selfwhere B: Into<Vec<u8>>,
Use when you need a binary value for DynamoDB.
See also: Value::new_binary
sourcepub fn new_null() -> Self
pub fn new_null() -> Self
Use when you need a null value for DynamoDB.
See also: Value::new_null
Trait Implementations§
source§impl FromIterator<u8> for Scalar
impl FromIterator<u8> for Scalar
source§impl Ord for Scalar
impl Ord for Scalar
source§impl PartialEq for Scalar
impl PartialEq for Scalar
source§impl PartialOrd for Scalar
impl PartialOrd for Scalar
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Scalar
impl StructuralEq for Scalar
impl StructuralPartialEq for Scalar
Auto Trait Implementations§
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnwindSafe for Scalar
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.