Struct dynamodb_expression::update::SetRemove
source · pub struct SetRemove { /* private fields */ }Expand description
Represents a Set or Remove statement for a DynamoDB expression. Most
of the time you won’t use this directly.
See: Set::and, Remove::and
use dynamodb_expression::{Num, Path};
let set = "foo".parse::<Path>()?.set(Num::new(7)).and("bar".parse::<Path>()?.set("a value"));
assert_eq!(r#"SET foo = 7, bar = "a value""#, set.to_string());
let remove = "baz".parse::<Path>()?.remove().and("quux".parse::<Path>()?.remove());
assert_eq!("REMOVE baz, quux", remove.to_string());
let set_remove = set.and(remove);
assert_eq!(r#"SET foo = 7, bar = "a value" REMOVE baz, quux"#, set_remove.to_string());Implementations§
source§impl SetRemove
impl SetRemove
sourcepub fn and<T>(self, other: T) -> Self
pub fn and<T>(self, other: T) -> Self
Add an additional Set or Remove statement to this expression.
use dynamodb_expression::{Num, Path, update::SetRemove};
let set = "foo"
.parse::<Path>()?
.set(Num::new(7))
.and("bar".parse::<Path>()?.set("a value"))
.and("baz".parse::<Path>()?.remove());
assert_eq!(r#"SET foo = 7, bar = "a value" REMOVE baz"#, set.to_string());Trait Implementations§
source§impl From<IfNotExists> for SetRemove
impl From<IfNotExists> for SetRemove
source§fn from(value: IfNotExists) -> Self
fn from(value: IfNotExists) -> Self
Converts to this type from the input type.
source§impl From<ListAppend> for SetRemove
impl From<ListAppend> for SetRemove
source§fn from(value: ListAppend) -> Self
fn from(value: ListAppend) -> Self
Converts to this type from the input type.
source§impl PartialEq for SetRemove
impl PartialEq for SetRemove
impl Eq for SetRemove
impl StructuralEq for SetRemove
impl StructuralPartialEq for SetRemove
Auto Trait Implementations§
impl RefUnwindSafe for SetRemove
impl Send for SetRemove
impl Sync for SetRemove
impl Unpin for SetRemove
impl UnwindSafe for SetRemove
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.