Struct dynamodb_expression::key::Key
source · pub struct Key { /* private fields */ }
Expand description
Represents a DynamoDB key condition expression.
An instance can be constructed using the Path::key
method, or the
the From<T: Into<Path>>
implementation.
See also: Path::key
use dynamodb_expression::{key::Key, Path};
let key: Key = Path::new_name("foo").key();
let key: Key = Path::new_name("foo").into();
Implementations§
source§impl Key
impl Key
sourcepub fn begins_with<T>(self, prefix: T) -> KeyConditionwhere
T: Into<StringOrRef>,
pub fn begins_with<T>(self, prefix: T) -> KeyConditionwhere T: Into<StringOrRef>,
The DynamoDB begins_with
function. True if the attribute specified by
the Path
begins with a particular substring.
begins_with
can take a string or a reference to an extended attribute
value. Here’s an example.
See also: Ref
use dynamodb_expression::{condition::BeginsWith, value::Ref, Path};
let begins_with = Path::new_name("foo").key().begins_with("T");
assert_eq!(r#"begins_with(foo, "T")"#, begins_with.to_string());
let begins_with = Path::new_name("foo").key().begins_with(Ref::new("prefix"));
assert_eq!(r#"begins_with(foo, :prefix)"#, begins_with.to_string());
sourcepub fn between<L, U>(self, lower: L, upper: U) -> KeyConditionwhere
L: Into<Operand>,
U: Into<Operand>,
pub fn between<L, U>(self, lower: L, upper: U) -> KeyConditionwhere L: Into<Operand>, U: Into<Operand>,
The DynamoDB BETWEEN
operator. True if self
is greater than or
equal to lower
, and less than or equal to upper
.
See also: Path::between
use dynamodb_expression::{Num, Path};
let key_condition = Path::new_name("age")
.key()
.between(Num::new(10), Num::new(90));
assert_eq!(r#"age BETWEEN 10 AND 90"#, key_condition.to_string());
sourcepub fn equal<T>(self, right: T) -> KeyConditionwhere
T: Into<Operand>,
pub fn equal<T>(self, right: T) -> KeyConditionwhere T: Into<Operand>,
A simple comparison that the specified attribute is equal to the provided value.
sourcepub fn greater_than<T>(self, right: T) -> KeyConditionwhere
T: Into<Operand>,
pub fn greater_than<T>(self, right: T) -> KeyConditionwhere T: Into<Operand>,
A simple comparison that the specified attribute is greater than the provided value.
sourcepub fn greater_than_or_equal<T>(self, right: T) -> KeyConditionwhere
T: Into<Operand>,
pub fn greater_than_or_equal<T>(self, right: T) -> KeyConditionwhere T: Into<Operand>,
A simple comparison that the specified attribute is greater than or equal to the provided value.
sourcepub fn less_than<T>(self, right: T) -> KeyConditionwhere
T: Into<Operand>,
pub fn less_than<T>(self, right: T) -> KeyConditionwhere T: Into<Operand>,
A simple comparison that the specified attribute is less than the provided value.
sourcepub fn less_than_or_equal<T>(self, right: T) -> KeyConditionwhere
T: Into<Operand>,
pub fn less_than_or_equal<T>(self, right: T) -> KeyConditionwhere T: Into<Operand>,
A simple comparison that the specified attribute is less than or equal to the provided value.
Trait Implementations§
source§impl Ord for Key
impl Ord for Key
source§impl PartialOrd for Key
impl PartialOrd for Key
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Key
impl StructuralEq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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
§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
§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
key
and return true
if they are equal.