Struct dynamodb_expression::key::KeyCondition
source · pub struct KeyCondition { /* private fields */ }Expand description
Represents a DynamoDB key condition expression. Build an instance from
the methods on Key.
See also: Path::key, expression::Builder::with_key_condition
use dynamodb_expression::{Expression, Num, Path};
let key_condition = "id"
.parse::<Path>()?
.key()
.equal(Num::new(42))
.and("category".parse::<Path>()?.key().begins_with("hardware."));
let expression = Expression::builder().with_key_condition(key_condition).build();Implementations§
source§impl KeyCondition
impl KeyCondition
sourcepub fn and(self, right: Self) -> Self
pub fn and(self, right: Self) -> Self
Combine two KeyConditions with the AND operator.
use dynamodb_expression::{Num, Path};
let key_condition = "id"
.parse::<Path>()?
.key()
.equal(Num::new(42))
.and("category".parse::<Path>()?.key().begins_with("hardware."));
assert_eq!(r#"id = 42 AND begins_with(category, "hardware.")"#, key_condition.to_string());Trait Implementations§
source§impl Clone for KeyCondition
impl Clone for KeyCondition
source§fn clone(&self) -> KeyCondition
fn clone(&self) -> KeyCondition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for KeyCondition
impl Debug for KeyCondition
source§impl Display for KeyCondition
impl Display for KeyCondition
source§impl From<KeyCondition> for String
impl From<KeyCondition> for String
source§fn from(key_condition: KeyCondition) -> Self
fn from(key_condition: KeyCondition) -> Self
Converts to this type from the input type.
source§impl PartialEq for KeyCondition
impl PartialEq for KeyCondition
source§fn eq(&self, other: &KeyCondition) -> bool
fn eq(&self, other: &KeyCondition) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for KeyCondition
impl StructuralEq for KeyCondition
impl StructuralPartialEq for KeyCondition
Auto Trait Implementations§
impl RefUnwindSafe for KeyCondition
impl Send for KeyCondition
impl Sync for KeyCondition
impl Unpin for KeyCondition
impl UnwindSafe for KeyCondition
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.