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 PartialOrd for Name
impl PartialOrd for Name
Source§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
.
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 StructuralPartialEq for Name
Auto Trait Implementations§
impl Freeze for Name
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
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
Compare self to
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.