Skip to main content

VelrSavepoint

Struct VelrSavepoint 

Source
pub struct VelrSavepoint<'tx> { /* private fields */ }
Expand description

A scoped savepoint handle within a transaction (thread-affine).

This is the RAII/scoped savepoint API:

§Drop behavior

If dropped without explicit release/rollback, the runtime rolls back to the savepoint and releases it.

Implementations§

Source§

impl VelrSavepoint<'_>

Source

pub fn release(self) -> Result<()>

Release this savepoint.

Consumes the savepoint handle. After this call, the savepoint is finalized and cannot be used again.

Note: the underlying C ABI consumes the savepoint handle even if an error is returned.

Source

pub fn rollback(self) -> Result<()>

Roll back to this savepoint and release it.

Consumes the savepoint handle. After this call, the savepoint is finalized and cannot be used again.

Note: the underlying C ABI consumes the savepoint handle even if an error is returned.

Trait Implementations§

Source§

impl Drop for VelrSavepoint<'_>

Source§

fn drop(&mut self)

Close the savepoint handle if still open.

Auto Trait Implementations§

§

impl<'tx> Freeze for VelrSavepoint<'tx>

§

impl<'tx> !RefUnwindSafe for VelrSavepoint<'tx>

§

impl<'tx> !Send for VelrSavepoint<'tx>

§

impl<'tx> !Sync for VelrSavepoint<'tx>

§

impl<'tx> Unpin for VelrSavepoint<'tx>

§

impl<'tx> UnsafeUnpin for VelrSavepoint<'tx>

§

impl<'tx> !UnwindSafe for VelrSavepoint<'tx>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.