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 = "foo".parse::<Path>()?.key();
let key: Key = "foo".parse::<Path>()?.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 key_condition = "foo".parse::<Path>()?.key().begins_with("T");
assert_eq!(r#"begins_with(foo, "T")"#, key_condition.to_string());
let key_condition = "foo".parse::<Path>()?.key().begins_with(Ref::new("prefix"));
assert_eq!(r#"begins_with(foo, :prefix)"#, key_condition.to_string());
Sourcepub fn between<L, U>(self, lower: L, upper: U) -> KeyCondition
pub fn between<L, U>(self, lower: L, upper: U) -> KeyCondition
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 = "age"
.parse::<Path>()?
.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) -> KeyCondition
pub fn equal<T>(self, right: T) -> KeyCondition
A simple comparison that the specified attribute is equal to the provided value.
Sourcepub fn greater_than<T>(self, right: T) -> KeyCondition
pub fn greater_than<T>(self, right: T) -> KeyCondition
A simple comparison that the specified attribute is greater than the provided value.
Sourcepub fn greater_than_or_equal<T>(self, right: T) -> KeyCondition
pub fn greater_than_or_equal<T>(self, right: T) -> KeyCondition
A simple comparison that the specified attribute is greater than or equal to the provided value.
Sourcepub fn less_than<T>(self, right: T) -> KeyCondition
pub fn less_than<T>(self, right: T) -> KeyCondition
A simple comparison that the specified attribute is less than the provided value.
Sourcepub fn less_than_or_equal<T>(self, right: T) -> KeyCondition
pub fn less_than_or_equal<T>(self, right: T) -> KeyCondition
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
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
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>
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>
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 more