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.
impl Eq for Update
impl StructuralPartialEq for Update
Auto Trait Implementations§
impl Freeze for Update
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
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.