Struct dynamodb_expression::condition::Contains
source · pub struct Contains { /* private fields */ }
Expand description
The DynamoDB contains
function. True if the attribute specified
by Path
is one of the following:
- A
String
that contains a particular substring. - A
Set
that contains a particular element within the set. - A
List
that contains a particular element within the list.
The operand must be a String
if the attribute specified by path is a
String
. If the attribute specified by path is a Set
, the operand
must be the sets element type.
use dynamodb_expression::{condition::Contains, Num, Path};
// String
let condition = Contains::new(Path::new_name("foo"), "Quinn");
assert_eq!(r#"contains(foo, "Quinn")"#, condition.to_string());
// Number
let condition = Contains::new(Path::new_name("foo"), Num::new(42));
assert_eq!(r#"contains(foo, 42)"#, condition.to_string());
// Binary
let condition = Contains::new(Path::new_name("foo"), Vec::<u8>::from("fish"));
assert_eq!(r#"contains(foo, "ZmlzaA==")"#, condition.to_string());
See also: Path::contains
Implementations§
Trait Implementations§
source§impl PartialEq for Contains
impl PartialEq for Contains
impl Eq for Contains
impl StructuralEq for Contains
impl StructuralPartialEq for Contains
Auto Trait Implementations§
impl RefUnwindSafe for Contains
impl Send for Contains
impl Sync for Contains
impl Unpin for Contains
impl UnwindSafe for Contains
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.