pub enum Value {
    Scalar(Scalar),
    Set(Set),
    Map(Map),
    List(List),
}
Expand description

A DynamoDB value

Variants§

§

Scalar(Scalar)

§

Set(Set)

§

Map(Map)

§

List(List)

Implementations§

source§

impl Value

source

pub fn new_string<T>(value: T) -> Self
where T: Into<String>,

Use when you need a string value for DynamoDB.

See also: Scalar::new_string

source

pub fn new_num<N>(value: N) -> Self
where 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());
source

pub fn new_num_lower_exp<N>(value: N) -> Self
where 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());
source

pub fn new_num_upper_exp<N>(value: N) -> Self
where 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());
source

pub fn new_bool(b: bool) -> Self

Use when you need a boolean value for DynamoDB.

See also: Scalar::new_bool

source

pub fn new_binary<B>(binary: B) -> Self
where B: Into<Vec<u8>>,

Use when you need a binary value for DynamoDB.

See also: Scalar::new_binary

source

pub fn new_null() -> Self

Use when you need a null value for DynamoDB.

See also: Scalar::new_null

source

pub fn new_string_set<T>(string_set: T) -> Self
where T: Into<StringSet>,

source

pub fn new_num_set<T>(num_set: T) -> Self
where T: Into<NumSet>,

source

pub fn new_binary_set<T>(binary_set: T) -> Self
where T: Into<BinarySet>,

source

pub fn new_map<T>(map: T) -> Self
where T: Into<Map>,

See also: Map::new

source

pub fn new_list<T>(list: T) -> Self
where T: Into<List>,

See also: List::new

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&&str> for Value

source§

fn from(value: &&str) -> Self

Converts to this type from the input type.
source§

impl From<&String> for Value

source§

fn from(value: &String) -> Self

Converts to this type from the input type.
source§

impl From<&str> for Value

source§

fn from(value: &str) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<[u8; N]> for Value

source§

fn from(value: [u8; N]) -> Self

Converts to this type from the input type.
source§

impl From<()> for Value

source§

fn from(value: ()) -> Self

Converts to this type from the input type.
source§

impl From<BinarySet> for Value

source§

fn from(string_set: BinarySet) -> Self

Converts to this type from the input type.
source§

impl From<List> for Value

source§

fn from(list: List) -> Self

Converts to this type from the input type.
source§

impl From<Map> for Value

source§

fn from(map: Map) -> Self

Converts to this type from the input type.
source§

impl From<Num> for Value

source§

fn from(value: Num) -> Self

Converts to this type from the input type.
source§

impl From<NumSet> for Value

source§

fn from(num_set: NumSet) -> Self

Converts to this type from the input type.
source§

impl From<Scalar> for Value

source§

fn from(value: Scalar) -> Self

Converts to this type from the input type.
source§

impl From<Set> for Value

source§

fn from(set: Set) -> Self

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl From<StringSet> for Value

source§

fn from(string_set: StringSet) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Value

source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl FromIterator<u8> for Value

source§

fn from_iter<T>(iter: T) -> Self
where T: IntoIterator<Item = u8>,

Creates a value from an iterator. Read more
source§

impl Hash for Value

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<AttributeValue> for Value

source§

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.

See: UnknownAttributeValueError, AttributeValue::Unknown

§

type Error = UnknownAttributeValueError

The type returned in the event of a conversion error.
source§

impl Eq for Value

source§

impl StructuralEq for Value

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more