Struct dynamodb_expression::path::Name
source · pub struct Name { /* private fields */ }
Expand description
Represents a DynamoDB attribute name. This will most commonly be used for top-level attributes.
This must only be used an attribute name without an index or additional field.
When used in an Expression
, attribute Name
s are automatically handled
as expression attribute names, allowing for names that would not
otherwise be permitted by DynamoDB. For example, foo
would become
something similar to #0
in the expression, and the name would be in the
expression_attribute_names
.
use dynamodb_expression::path::Name;
// A variety of strings can be turned into a `Name`.
let name: Name = "foo".into();
let name: Name = String::from("foo").into();
let name: Name = (&String::from("foo")).into();
let name: Name = (&"foo").into();
Implementations§
Trait Implementations§
source§impl Ord for Name
impl Ord for Name
source§impl PartialEq for Name
impl PartialEq for Name
source§impl PartialOrd for Name
impl PartialOrd for Name
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 moresource§impl TryFrom<Path> for Name
impl TryFrom<Path> for Name
source§fn try_from(path: Path) -> Result<Self, Self::Error>
fn try_from(path: Path) -> Result<Self, Self::Error>
A Path
consisting of a single, unindexed attribute can be converted
into a Name
.
use dynamodb_expression::path::{Element, Name, Path};
let path: Path = "foo".parse().unwrap();
let name = Name::try_from(path).unwrap();
assert_eq!(Name::from("foo"), name);
If the Path
has indexes, or has sub-attributes, it cannot be
converted, and the original Path
is returned.
let path: Path = "foo[0]".parse().unwrap();
let err = Name::try_from(path.clone()).unwrap_err();
assert_eq!(path, err);
let path: Path = "foo.bar".parse().unwrap();
let err = Name::try_from(path.clone()).unwrap_err();
assert_eq!(path, err);
impl Eq for Name
impl StructuralEq for Name
impl StructuralPartialEq for Name
Auto Trait Implementations§
impl RefUnwindSafe for Name
impl Send for Name
impl Sync for Name
impl Unpin for Name
impl UnwindSafe for Name
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.