Struct dynamodb_expression::update::remove::Remove
source · pub struct Remove { /* private fields */ }
Expand description
For use an in an update expression to remove attributes from an item, or elements from a list.
See also: Path::remove
, Update
Examples
use dynamodb_expression::{Path, update::{Remove, Update}};
let update = Remove::new_name("foo");
assert_eq!(r#"REMOVE foo"#, update.to_string());
let update = Remove::new_indexed_field("foo", [8]);
assert_eq!(r#"REMOVE foo[8]"#, update.to_string());
let update = Remove::from("foo[8]".parse::<Path>().unwrap());
assert_eq!(r#"REMOVE foo[8]"#, update.to_string());
let update = Remove::from_iter(["foo", "bar", "baz"].map(Path::new_name));
assert_eq!(r#"REMOVE foo, bar, baz"#, update.to_string());
Implementations§
source§impl Remove
impl Remove
sourcepub fn new_indexed_field<N, I>(name: N, indexes: I) -> Self
pub fn new_indexed_field<N, I>(name: N, indexes: I) -> Self
Constructs a Remove
for an indexed field element of a document path.
For example, foo[3]
or foo[7][4]
. If you have a attribute name with
no indexes, you can pass an empty collection, or use Remove::new_name
.
indexes
here can be an array, slice, Vec
of, or single usize
.
See also: IndexedField
, Path::new_indexed_field
Trait Implementations§
source§impl<T> FromIterator<T> for Remove
impl<T> FromIterator<T> for Remove
source§fn from_iter<I>(paths: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(paths: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
source§impl PartialEq for Remove
impl PartialEq for Remove
impl Eq for Remove
impl StructuralEq for Remove
impl StructuralPartialEq for Remove
Auto Trait Implementations§
impl RefUnwindSafe for Remove
impl Send for Remove
impl Sync for Remove
impl Unpin for Remove
impl UnwindSafe for Remove
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 Q
impl<Q, K> Equivalent<K> for Q
§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 Q
impl<Q, K> Equivalent<K> for Q
§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.