pub struct TransactionWeak<'t, S> { /* private fields */ }Expand description
This is the weak version of TransactionMut.
The reason that it is called weak is because TransactionWeak can not guarantee
that TableRows prove the existence of their particular row.
TransactionWeak is useful because it allowes deleting rows.
Implementations§
Source§impl<'t, S: 'static> TransactionWeak<'t, S>
impl<'t, S: 'static> TransactionWeak<'t, S>
Sourcepub fn try_delete<T: Table<Schema = S>>(
&mut self,
val: TableRow<'t, T>,
) -> Result<bool, T::Referer>
pub fn try_delete<T: Table<Schema = S>>( &mut self, val: TableRow<'t, T>, ) -> Result<bool, T::Referer>
Sourcepub fn delete<T: Table<Referer = Infallible, Schema = S>>(
&mut self,
val: TableRow<'t, T>,
) -> bool
pub fn delete<T: Table<Referer = Infallible, Schema = S>>( &mut self, val: TableRow<'t, T>, ) -> bool
Delete a row from the database.
This is the infallible version of TransactionWeak::try_delete.
To be able to use this method you have to mark the table as #[no_reference] in the schema.
Sourcepub fn commit(self)
pub fn commit(self)
Make the changes made in this TransactionWeak permanent.
If the TransactionWeak is dropped without calling this function, then the changes are rolled back.
Auto Trait Implementations§
impl<'t, S> Freeze for TransactionWeak<'t, S>
impl<'t, S> !RefUnwindSafe for TransactionWeak<'t, S>
impl<'t, S> !Send for TransactionWeak<'t, S>
impl<'t, S> !Sync for TransactionWeak<'t, S>
impl<'t, S> Unpin for TransactionWeak<'t, S>
impl<'t, S> !UnwindSafe for TransactionWeak<'t, S>
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