pub struct UpsertExecutor<E: EntityKind> { /* private fields */ }Expand description
UpsertExecutor
Implementations§
Source§impl<E: EntityKind> UpsertExecutor<E>where
E::PrimaryKey: FromKey,
impl<E: EntityKind> UpsertExecutor<E>where
E::PrimaryKey: FromKey,
Sourcepub fn by_unique_index(
&self,
index: UniqueIndexHandle,
entity: E,
) -> Result<E, Error>
pub fn by_unique_index( &self, index: UniqueIndexHandle, entity: E, ) -> Result<E, Error>
Upsert using a unique index specification.
Sourcepub fn by_unique_index_merge<F>(
&self,
index: UniqueIndexHandle,
entity: E,
merge: F,
) -> Result<E, Error>where
F: FnOnce(E, E) -> E,
pub fn by_unique_index_merge<F>(
&self,
index: UniqueIndexHandle,
entity: E,
merge: F,
) -> Result<E, Error>where
F: FnOnce(E, E) -> E,
Upsert using a unique index specification with a merge closure.
Sourcepub fn by_unique_index_merge_result<F>(
&self,
index: UniqueIndexHandle,
entity: E,
merge: F,
) -> Result<UpsertResult<E>, Error>where
F: FnOnce(E, E) -> E,
pub fn by_unique_index_merge_result<F>(
&self,
index: UniqueIndexHandle,
entity: E,
merge: F,
) -> Result<UpsertResult<E>, Error>where
F: FnOnce(E, E) -> E,
Upsert using a unique index specification with a merge closure, returning an insert/update flag.
Sourcepub fn by_unique_index_result(
&self,
index: UniqueIndexHandle,
entity: E,
) -> Result<UpsertResult<E>, Error>
pub fn by_unique_index_result( &self, index: UniqueIndexHandle, entity: E, ) -> Result<UpsertResult<E>, Error>
Upsert using a unique index specification, returning an insert/update flag.
Sourcepub fn by_unique_fields(&self, fields: &[&str], entity: E) -> Result<E, Error>
pub fn by_unique_fields(&self, fields: &[&str], entity: E) -> Result<E, Error>
Upsert using a unique index identified by its field list.
Sourcepub fn by_unique_fields_merge<F>(
&self,
fields: &[&str],
entity: E,
merge: F,
) -> Result<E, Error>where
F: FnOnce(E, E) -> E,
pub fn by_unique_fields_merge<F>(
&self,
fields: &[&str],
entity: E,
merge: F,
) -> Result<E, Error>where
F: FnOnce(E, E) -> E,
Upsert using a unique index identified by its field list with a merge closure.
Sourcepub fn by_unique_fields_merge_result<F>(
&self,
fields: &[&str],
entity: E,
merge: F,
) -> Result<UpsertResult<E>, Error>where
F: FnOnce(E, E) -> E,
pub fn by_unique_fields_merge_result<F>(
&self,
fields: &[&str],
entity: E,
merge: F,
) -> Result<UpsertResult<E>, Error>where
F: FnOnce(E, E) -> E,
Upsert using a unique index identified by its field list with a merge closure, returning an insert/update flag.
Sourcepub fn by_unique_fields_result(
&self,
fields: &[&str],
entity: E,
) -> Result<UpsertResult<E>, Error>
pub fn by_unique_fields_result( &self, fields: &[&str], entity: E, ) -> Result<UpsertResult<E>, Error>
Upsert using a unique index identified by its field list, returning an insert/update flag.
Trait Implementations§
Source§impl<E: Clone + EntityKind> Clone for UpsertExecutor<E>
impl<E: Clone + EntityKind> Clone for UpsertExecutor<E>
Source§fn clone(&self) -> UpsertExecutor<E>
fn clone(&self) -> UpsertExecutor<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<E: Copy + EntityKind> Copy for UpsertExecutor<E>
Auto Trait Implementations§
impl<E> Freeze for UpsertExecutor<E>
impl<E> RefUnwindSafe for UpsertExecutor<E>
impl<E> Send for UpsertExecutor<E>
impl<E> Sync for UpsertExecutor<E>
impl<E> Unpin for UpsertExecutor<E>
impl<E> UnwindSafe for UpsertExecutor<E>
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