Struct dynamodb_expression::update::Update
source · pub struct Update { /* private fields */ }
Expand description
Represents a DynamoDB update expression.
See also: Expression
, Set
, Remove
, Add
, Delete
§Examples
use dynamodb_expression::{update::Update, Expression, Path};
let update = Update::from("foo".parse::<Path>()?.math().add(7));
assert_eq!("SET foo = foo + 7", update.to_string());
let update = Update::from("foo".parse::<Path>()?.if_not_exists().set("a value"));
assert_eq!(
r#"SET foo = if_not_exists(foo, "a value")"#,
update.to_string()
);
let update = Update::from("foo".parse::<Path>()?.remove());
assert_eq!(r#"REMOVE foo"#, update.to_string());
// To use an `Update`, build an `Expression`.
let expression = Expression::builder().with_update(update).build();
Implementations§
source§impl Update
impl Update
sourcepub fn new_remove<T>(remove: T) -> Self
pub fn new_remove<T>(remove: T) -> Self
A new update expression for a Remove
statement.
sourcepub fn new_delete<T>(delete: T) -> Self
pub fn new_delete<T>(delete: T) -> Self
A new update expression for a Delete
statement.
Trait Implementations§
source§impl From<DeleteAction> for Update
impl From<DeleteAction> for Update
source§fn from(value: DeleteAction) -> Self
fn from(value: DeleteAction) -> Self
Converts to this type from the input type.
source§impl From<IfNotExists> for Update
impl From<IfNotExists> for Update
source§fn from(value: IfNotExists) -> Self
fn from(value: IfNotExists) -> Self
Converts to this type from the input type.
source§impl From<ListAppend> for Update
impl From<ListAppend> for Update
source§fn from(value: ListAppend) -> Self
fn from(value: ListAppend) -> Self
Converts to this type from the input type.
source§impl PartialEq for Update
impl PartialEq for Update
impl Eq for Update
impl StructuralEq for Update
impl StructuralPartialEq for Update
Auto Trait Implementations§
impl RefUnwindSafe for Update
impl Send for Update
impl Sync for Update
impl Unpin for Update
impl UnwindSafe for Update
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.