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.
Prefer Path::remove over this.
See also: Update
§Examples
use dynamodb_expression::{Expression, Path, update::{Remove, Update}};
let remove = "foo".parse::<Path>()?.remove();
assert_eq!("REMOVE foo", remove.to_string());
let remove = Remove::from("foo[8]".parse::<Path>()?);
assert_eq!("REMOVE foo[8]", remove.to_string());
let remove: Remove = ["foo", "bar", "baz"].into_iter().map(Path::new_name).collect();
assert_eq!("REMOVE foo, bar, baz", remove.to_string());
let remove = remove.and("quux".parse::<Path>()?.remove());
assert_eq!("REMOVE foo, bar, baz, quux", remove.to_string());
// Use in an update expression
let update = Update::from(remove.clone());
// Use an expression builder
let expression = Expression::builder().with_update(remove).build();Implementations§
Source§impl Remove
impl Remove
Sourcepub fn and<T>(self, other: T) -> Update
pub fn and<T>(self, other: T) -> Update
Add an additional Update statement to this expression.
use dynamodb_expression::Path;
let remove = "foo".parse::<Path>()?.remove().and("bar".parse::<Path>()?.remove());
assert_eq!("REMOVE foo, bar", remove.to_string());
let set_remove = remove.and("baz".parse::<Path>()?.set("a value"));
assert_eq!(r#"SET baz = "a value" REMOVE foo, bar"#, set_remove.to_string());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
impl Eq for Remove
impl StructuralPartialEq for Remove
Auto Trait Implementations§
impl Freeze for Remove
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.