pub struct SaveExecutor<E: EntityKind> { /* private fields */ }Expand description
SaveExecutor
Implementations§
Source§impl<E: EntityKind> SaveExecutor<E>
impl<E: EntityKind> SaveExecutor<E>
pub const fn new(db: Db<E::Canister>, debug: bool) -> Self
pub const fn debug(self) -> Self
Sourcepub fn insert(&self, entity: E) -> Result<E, Error>
pub fn insert(&self, entity: E) -> Result<E, Error>
EXECUTION METHODS
Insert a brand-new entity (errors if the key already exists).
Sourcepub fn insert_view<V>(&self, view: E::ViewType) -> Result<E::ViewType, Error>
pub fn insert_view<V>(&self, view: E::ViewType) -> Result<E::ViewType, Error>
Insert a new view, returning the stored view.
Sourcepub fn update(&self, entity: E) -> Result<E, Error>
pub fn update(&self, entity: E) -> Result<E, Error>
Update an existing entity (errors if it does not exist).
Sourcepub fn update_view<V>(&self, view: E::ViewType) -> Result<E::ViewType, Error>
pub fn update_view<V>(&self, view: E::ViewType) -> Result<E::ViewType, Error>
Update an existing view (errors if it does not exist).
Trait Implementations§
Source§impl<E: Clone + EntityKind> Clone for SaveExecutor<E>
impl<E: Clone + EntityKind> Clone for SaveExecutor<E>
Source§fn clone(&self) -> SaveExecutor<E>
fn clone(&self) -> SaveExecutor<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 SaveExecutor<E>
Auto Trait Implementations§
impl<E> Freeze for SaveExecutor<E>
impl<E> RefUnwindSafe for SaveExecutor<E>
impl<E> Send for SaveExecutor<E>
impl<E> Sync for SaveExecutor<E>
impl<E> Unpin for SaveExecutor<E>
impl<E> UnwindSafe for SaveExecutor<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