Enum dynamodb_expression::value::Value
source · pub enum Value {
Scalar(Scalar),
Set(Set),
Map(Map),
List(List),
}
Expand description
A DynamoDB value
Variants§
Implementations§
source§impl Value
impl Value
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: Scalar::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:, Value::new_num_lower_exp
, Value::new_num_upper_exp
,
Scalar::new_num
, Num::new
Examples
use dynamodb_expression::Value;
let value = Value::new_num(2600);
assert_eq!("2600", value.to_string());
let value = Value::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:, Value::new_num
, Value::new_num_upper_exp
,
Scalar::new_num_lower_exp
, Num::new_lower_exp
Examples
use dynamodb_expression::Value;
let value = Value::new_num_lower_exp(2600);
assert_eq!("2.6e3", value.to_string());
let value = Value::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:, Value::new_num
, Value::new_num_lower_exp
,
Scalar::new_num_upper_exp
, Num::new_upper_exp
Examples
use dynamodb_expression::Value;
let value = Value::new_num_upper_exp(2600);
assert_eq!("2.6E3", value.to_string());
let value = Value::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: Scalar::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: Scalar::new_binary
sourcepub fn new_null() -> Self
pub fn new_null() -> Self
Use when you need a null value for DynamoDB.
See also: Scalar::new_null
sourcepub fn new_string_set<T>(string_set: T) -> Selfwhere
T: Into<StringSet>,
pub fn new_string_set<T>(string_set: T) -> Selfwhere T: Into<StringSet>,
See also: Set::new_string_set
, StringSet::new
sourcepub fn new_num_set<T>(num_set: T) -> Selfwhere
T: Into<NumSet>,
pub fn new_num_set<T>(num_set: T) -> Selfwhere T: Into<NumSet>,
See also: Set::new_num_set
, NumSet::new
sourcepub fn new_binary_set<T>(binary_set: T) -> Selfwhere
T: Into<BinarySet>,
pub fn new_binary_set<T>(binary_set: T) -> Selfwhere T: Into<BinarySet>,
See also: Set::new_binary_set
, BinarySet::new
Trait Implementations§
source§impl FromIterator<u8> for Value
impl FromIterator<u8> for Value
source§impl PartialEq for Value
impl PartialEq for Value
impl Eq for Value
impl StructuralEq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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.