Enum dynamodb_expression::path::Element
source · pub enum Element {
Name(Name),
IndexedField(IndexedField),
}
Expand description
Variants§
Name(Name)
IndexedField(IndexedField)
Implementations§
source§impl Element
impl Element
sourcepub fn new_indexed_field<N, I>(name: N, indexes: I) -> Selfwhere
N: Into<Name>,
I: Indexes,
pub fn new_indexed_field<N, I>(name: N, indexes: I) -> Selfwhere N: Into<Name>, I: Indexes,
An indexed field element of a document path. For example, foo[3]
or
foo[7][4]
indexes
here can be an array, slice, Vec
of, or single usize
.
assert_eq!("foo[3]", Element::new_indexed_field("foo", 3).to_string());
assert_eq!("foo[3]", Element::new_indexed_field("foo", [3]).to_string());
assert_eq!("foo[3]", Element::new_indexed_field("foo", &[3]).to_string());
assert_eq!("foo[3]", Element::new_indexed_field("foo", vec![3]).to_string());
assert_eq!("foo[7][4]", Element::new_indexed_field("foo", [7, 4]).to_string());
assert_eq!("foo[7][4]", Element::new_indexed_field("foo", &[7, 4]).to_string());
assert_eq!("foo[7][4]", Element::new_indexed_field("foo", vec![7, 4]).to_string());
assert_eq!("foo", Element::new_indexed_field("foo", []).to_string());
assert_eq!("foo", Element::new_indexed_field("foo", &[]).to_string());
assert_eq!("foo", Element::new_indexed_field("foo", vec![]).to_string());
See also: IndexedField
, Path
, Path::new_indexed_field
Trait Implementations§
source§impl From<IndexedField> for Element
impl From<IndexedField> for Element
source§fn from(value: IndexedField) -> Self
fn from(value: IndexedField) -> Self
Converts to this type from the input type.
source§impl Ord for Element
impl Ord for Element
source§impl PartialEq for Element
impl PartialEq for Element
source§impl PartialOrd for Element
impl PartialOrd for Element
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Element
impl StructuralEq for Element
impl StructuralPartialEq for Element
Auto Trait Implementations§
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
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.