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) -> Selfwhere
R: Into<Condition>,
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());
sourcepub fn or<R>(self, right: R) -> Selfwhere
R: Into<Condition>,
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());
sourcepub fn not(self) -> Self
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());
sourcepub fn parenthesize(self) -> Self
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 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.
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());
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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§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.