Enum dynamodb_expression::condition::Condition
source · 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());source§impl PartialEq for Condition
impl PartialEq for Condition
impl Eq for Condition
impl StructuralEq for Condition
impl StructuralPartialEq for Condition
Auto Trait Implementations§
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
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Creates a shared type from an unshared type.