Skip to main content

WriteLockInfo

Struct WriteLockInfo 

Source
pub struct WriteLockInfo {
    pub abort_lsn: u64,
    pub abort_known_deleted: bool,
    pub abort_key: Option<Vec<u8>>,
    pub abort_data: Option<Vec<u8>>,
    pub abort_vlsn: i64,
    pub abort_log_size: i32,
    pub abort_expiration: i32,
    pub abort_expiration_in_hours: bool,
    pub never_locked: bool,
    pub database_id: u64,
}
Expand description

Information needed to undo write operations if a transaction aborts.

Stores the “abort version” - the state of a record before this txn modified it. This allows the transaction to restore the previous state on abort.

Fields§

§abort_lsn: u64

LSN of the record’s abort version.

§abort_known_deleted: bool

Whether the abort version is a known-deleted record.

§abort_key: Option<Vec<u8>>

Key of the abort version (if key updates allowed).

§abort_data: Option<Vec<u8>>

Data of the abort version (if embedded in BIN).

§abort_vlsn: i64

VLSN of the abort version.

§abort_log_size: i32

On-disk size of the abort version.

§abort_expiration: i32

Expiration time of the abort version.

§abort_expiration_in_hours: bool

Whether expiration is in hours (true) or days (false).

§never_locked: bool

True if the LSN has never been locked before by this Txn.

Per the: “True if this locker has never had this LSN locked, is false otherwise. This is used to determine if the locker must add undo information for a write lock.”

§database_id: u64

Database ID of the database that was modified.

Stored so that Txn::abort() can route each UndoRecord to the correct database’s B-tree.

Implementations§

Source§

impl WriteLockInfo

Source

pub fn new() -> Self

Creates a new WriteLockInfo with default abort version values.

Source

pub fn copy_all_info(&mut self, from: &WriteLockInfo)

Copies all abort information from another WriteLockInfo.

Source

pub fn set_abort_info( &mut self, abort_lsn: u64, abort_key: Option<Vec<u8>>, abort_data: Option<Vec<u8>>, abort_vlsn: i64, abort_log_size: i32, abort_known_deleted: bool, abort_expiration: i32, abort_expiration_in_hours: bool, )

Sets the abort information from a log entry.

Source

pub fn is_null_abort_lsn(&self) -> bool

Returns true if this represents a NULL abort LSN.

Trait Implementations§

Source§

impl Clone for WriteLockInfo

Source§

fn clone(&self) -> WriteLockInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WriteLockInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WriteLockInfo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.