Struct dynamodb_expression::update::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, SetRemove, 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) -> SetRemove
 
pub fn and<T>(self, other: T) -> SetRemove
Add an additional Remove or Set 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
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.