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) -> Self
pub fn new_string<T>(value: T) -> Self
Use when you need a string value for DynamoDB.
See also: Scalar::new_string
sourcepub fn new_num<N>(value: N) -> Self
pub fn new_num<N>(value: N) -> Self
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) -> Self
pub fn new_num_lower_exp<N>(value: N) -> Self
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) -> Self
pub fn new_num_upper_exp<N>(value: N) -> Self
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) -> Self
pub fn new_binary<B>(binary: B) -> Self
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) -> Self
pub fn new_string_set<T>(string_set: T) -> Self
See also: Set::new_string_set
, StringSet::new
sourcepub fn new_num_set<T>(num_set: T) -> Self
pub fn new_num_set<T>(num_set: T) -> Self
See also: Set::new_num_set
, NumSet::new
sourcepub fn new_binary_set<T>(binary_set: T) -> Self
pub fn new_binary_set<T>(binary_set: T) -> Self
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
source§impl TryFrom<AttributeValue> for Value
impl TryFrom<AttributeValue> for Value
source§fn try_from(value: AttributeValue) -> Result<Self, Self::Error>
fn try_from(value: AttributeValue) -> Result<Self, Self::Error>
This will only return an error if a new AttributeValue
variant is
added to the AWS DynamoDB SDK and isn’t supported yet.
§type Error = UnknownAttributeValueError
type Error = UnknownAttributeValueError
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 Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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
key
and return true
if they are equal.