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
impl Condition
Sourcepub fn and<R>(self, right: R) -> Self
pub fn and<R>(self, right: R) -> Self
A DynamoDB logical AND condition.
See also: And
use dynamodb_expression::Path;
let a = "a".parse::<Path>()?;
let b = "b".parse::<Path>()?;
let c = "c".parse::<Path>()?;
let d = "d".parse::<Path>()?;
let condition = a.greater_than(b).and(c.less_than(d));
assert_eq!("a > b AND c < d", condition.to_string());Sourcepub fn or<R>(self, right: R) -> Self
pub fn or<R>(self, right: R) -> Self
A DynamoDB logical OR condition.
See also: Or
use dynamodb_expression::Path;
let a = "a".parse::<Path>()?;
let b = "b".parse::<Path>()?;
let c = "c".parse::<Path>()?;
let d = "d".parse::<Path>()?;
let condition = a.greater_than(b).or(c.less_than(d));
assert_eq!("a > b OR c < d", condition.to_string());Sourcepub fn not(self) -> Self
pub fn not(self) -> Self
A DynamoDB logical NOT condition.
See also: Not
use dynamodb_expression::Path;
let a = "a".parse::<Path>()?;
let b = "b".parse::<Path>()?;
let condition = a.greater_than(b).not();
assert_eq!("NOT a > b", condition.to_string());Sourcepub fn parenthesize(self) -> Self
pub fn parenthesize(self) -> Self
Wraps a condition in parentheses.
See also: Parenthetical
use dynamodb_expression::Path;
let a = "a".parse::<Path>()?;
let b = "b".parse::<Path>()?;
let c = "c".parse::<Path>()?;
let d = "d".parse::<Path>()?;
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 From<AttributeExists> for Condition
impl From<AttributeExists> for Condition
Source§fn from(condition: AttributeExists) -> Self
fn from(condition: AttributeExists) -> Self
Converts to this type from the input type.
Source§impl From<AttributeNotExists> for Condition
impl From<AttributeNotExists> for Condition
Source§fn from(condition: AttributeNotExists) -> Self
fn from(condition: AttributeNotExists) -> Self
Converts to this type from the input type.
Source§impl From<AttributeType> for Condition
impl From<AttributeType> for Condition
Source§fn from(condition: AttributeType) -> Self
fn from(condition: AttributeType) -> Self
Converts to this type from the input type.
Source§impl From<BeginsWith> for Condition
impl From<BeginsWith> for Condition
Source§fn from(condition: BeginsWith) -> Self
fn from(condition: BeginsWith) -> Self
Converts to this type from the input type.
Source§impl From<Comparison> for Condition
impl From<Comparison> for Condition
Source§fn from(condition: Comparison) -> Self
fn from(condition: Comparison) -> Self
Converts to this type from the input type.
Source§impl From<Parenthetical> for Condition
impl From<Parenthetical> for Condition
Source§fn from(condition: Parenthetical) -> Self
fn from(condition: Parenthetical) -> Self
Converts to this type from the input type.
Source§impl Not for Condition
impl Not for Condition
Source§fn not(self) -> Self::Output
fn not(self) -> Self::Output
A DynamoDB logical NOT condition.
See also: Condition::not, Not
use dynamodb_expression::Path;
let a = "a".parse::<Path>()?;
let b = "b".parse::<Path>()?;
let condition = !a.greater_than(b);
assert_eq!("NOT a > b", condition.to_string());impl Eq for Condition
impl StructuralPartialEq for Condition
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnwindSafe for Condition
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.