pub enum Condition {
    AttributeExists(AttributeExists),
    AttributeNotExists(AttributeNotExists),
    AttributeType(AttributeType),
    BeginsWith(BeginsWith),
    Between(Between),
    Contains(Contains),
    In(In),
    Not(Not),
    And(And),
    Or(Or),
    Comparison(Comparison),
    Parenthetical(Parenthetical),
}
Expand description

Represents a logical condition in a DynamoDB expression.

You will usually create these using the methods on Path.

Variants§

§

AttributeExists(AttributeExists)

§

AttributeNotExists(AttributeNotExists)

§

AttributeType(AttributeType)

§

BeginsWith(BeginsWith)

§

Between(Between)

§

Contains(Contains)

§

In(In)

§

Not(Not)

§

And(And)

§

Or(Or)

§

Comparison(Comparison)

§

Parenthetical(Parenthetical)

Implementations§

source§

impl Condition

source

pub fn and<R>(self, right: R) -> Selfwhere R: Into<Condition>,

A DynamoDB logical AND condition.

use dynamodb_expression::Path;

let a = Path::new_name("a");
let b = Path::new_name("b");
let c = Path::new_name("c");
let d = Path::new_name("d");

let condition = a.greater_than(b).and(c.less_than(d));
assert_eq!("a > b AND c < d", condition.to_string());
source

pub fn or<R>(self, right: R) -> Selfwhere R: Into<Condition>,

A DynamoDB logical OR condition.

use dynamodb_expression::Path;

let a = Path::new_name("a");
let b = Path::new_name("b");
let c = Path::new_name("c");
let d = Path::new_name("d");

let condition = a.greater_than(b).or(c.less_than(d));
assert_eq!("a > b OR c < d", condition.to_string());
source

pub fn not(self) -> Self

A DynamoDB logical NOT condition.

use dynamodb_expression::Path;

let a = Path::new_name("a");
let b = Path::new_name("b");

let condition = a.greater_than(b).not();
assert_eq!("NOT a > b", condition.to_string());
source

pub fn parenthesize(self) -> Self

Wraps a condition in parentheses.

use dynamodb_expression::Path;

let a = Path::new_name("a");
let b = Path::new_name("b");
let c = Path::new_name("c");
let d = Path::new_name("d");

let condition = a.greater_than(b).parenthesize().and(c.less_than(d).parenthesize());
assert_eq!("(a > b) AND (c < d)", condition.to_string());

Trait Implementations§

source§

impl Clone for Condition

source§

fn clone(&self) -> Condition

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 Condition

source§

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

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

impl Display for Condition

source§

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

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

impl From<And> for Condition

source§

fn from(condition: And) -> Self

Converts to this type from the input type.
source§

impl From<AttributeExists> for Condition

source§

fn from(condition: AttributeExists) -> Self

Converts to this type from the input type.
source§

impl From<AttributeNotExists> for Condition

source§

fn from(condition: AttributeNotExists) -> Self

Converts to this type from the input type.
source§

impl From<AttributeType> for Condition

source§

fn from(condition: AttributeType) -> Self

Converts to this type from the input type.
source§

impl From<BeginsWith> for Condition

source§

fn from(condition: BeginsWith) -> Self

Converts to this type from the input type.
source§

impl From<Between> for Condition

source§

fn from(condition: Between) -> Self

Converts to this type from the input type.
source§

impl From<Comparison> for Condition

source§

fn from(condition: Comparison) -> Self

Converts to this type from the input type.
source§

impl From<Condition> for String

source§

fn from(condition: Condition) -> Self

Converts to this type from the input type.
source§

impl From<Contains> for Condition

source§

fn from(condition: Contains) -> Self

Converts to this type from the input type.
source§

impl From<In> for Condition

source§

fn from(condition: In) -> Self

Converts to this type from the input type.
source§

impl From<Not> for Condition

source§

fn from(condition: Not) -> Self

Converts to this type from the input type.
source§

impl From<Or> for Condition

source§

fn from(condition: Or) -> Self

Converts to this type from the input type.
source§

impl From<Parenthetical> for Condition

source§

fn from(condition: Parenthetical) -> Self

Converts to this type from the input type.
source§

impl Not for Condition

source§

fn not(self) -> Self::Output

A DynamoDB logical NOT condition.

use dynamodb_expression::Path;

let a = Path::new_name("a");
let b = Path::new_name("b");

let condition = !a.greater_than(b);
assert_eq!("NOT a > b", condition.to_string());
§

type Output = Condition

The resulting type after applying the ! operator.
source§

impl PartialEq for Condition

source§

fn eq(&self, other: &Condition) -> 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 Eq for Condition

source§

impl StructuralEq for Condition

source§

impl StructuralPartialEq for Condition

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere 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 Qwhere 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 Twhere 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 Unsharedwhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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