Struct sanakirja::MutTxn [−][src]
Expand description
A mutable transaction.
Implementations
impl<E: Borrow<Env>, T> MutTxn<E, T>
[src]
impl<E: Borrow<Env>, T> MutTxn<E, T>
[src]pub fn set_root(&mut self, num: usize, value: u64)
[src]
pub fn set_root(&mut self, num: usize, value: u64)
[src]Setting the num
th element of the initial page, treated as a
[u64; 510]
, to value
. This doesn’t actually write anything
to that page, since that page is written during the commit.
In the current implementation, value
is probably going to be
the offset in the file of the root page of a B tree.
pub fn remove_root(&mut self, num: usize)
[src]
pub fn remove_root(&mut self, num: usize)
[src]Setting the num
th element of the initial page, treated as a
[u64; 510].
Trait Implementations
impl<E: Borrow<Env>, T> AllocPage for MutTxn<E, T>
[src]
impl<E: Borrow<Env>, T> AllocPage for MutTxn<E, T>
[src]fn alloc_page(&mut self) -> Result<MutPage, Error>
[src]
fn alloc_page(&mut self) -> Result<MutPage, Error>
[src]Allocate a single page.
fn incr_rc(&mut self, off: u64) -> Result<usize, Error>
[src]
fn incr_rc(&mut self, off: u64) -> Result<usize, Error>
[src]Increment the reference count for page off
.
fn decr_rc(&mut self, off: u64) -> Result<usize, Error>
[src]
fn decr_rc(&mut self, off: u64) -> Result<usize, Error>
[src]Decrement the page’s reference count, assuming the page was first allocated by another transaction. If the RC reaches 0, free the page. Must return the new RC (0 if freed). Read more
fn decr_rc_owned(&mut self, off: u64) -> Result<usize, Error>
[src]
fn decr_rc_owned(&mut self, off: u64) -> Result<usize, Error>
[src]Same as Self::decr_rc
, but for pages allocated by the current
transaction. This is an important distinction, as pages
allocated by the current transaction can be reused immediately
after being freed. Read more
impl<'a, E: Borrow<Env>, T> Commit for MutTxn<E, &'a mut MutTxn<E, T>>
[src]
impl<'a, E: Borrow<Env>, T> Commit for MutTxn<E, &'a mut MutTxn<E, T>>
[src]The following is very easy, we’re just extending all values of the current transaction with values of the subtransaction.
impl<E: Borrow<Env>, T> Drop for MutTxn<E, T>
[src]
impl<E: Borrow<Env>, T> Drop for MutTxn<E, T>
[src]When dropping a transaction, we need to unlock the read-write locks internal to this process, and possibly the file locks.
impl<E: Borrow<Env>, A> LoadPage for MutTxn<E, A>
[src]
impl<E: Borrow<Env>, A> LoadPage for MutTxn<E, A>
[src]type Error = Error
fn rc(&self, page: u64) -> Result<u64, Self::Error>
[src]
fn rc(&self, page: u64) -> Result<u64, Self::Error>
[src]Reference-counting. Since reference-counts are designed to be storable into B trees by external allocators, pages referenced once aren’t stored, and hence are indistinguishable from pages that are never referenced. The default implementation returns 0. Read more
Auto Trait Implementations
impl<E, T> RefUnwindSafe for MutTxn<E, T> where
E: RefUnwindSafe,
T: RefUnwindSafe,
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<E, T> Send for MutTxn<E, T> where
E: Send,
T: Send,
E: Send,
T: Send,
impl<E, T> Sync for MutTxn<E, T> where
E: Sync,
T: Sync,
E: Sync,
T: Sync,
impl<E, T> Unpin for MutTxn<E, T> where
E: Unpin,
T: Unpin,
E: Unpin,
T: Unpin,
impl<E, T> UnwindSafe for MutTxn<E, T> where
E: UnwindSafe,
T: UnwindSafe,
E: UnwindSafe,
T: UnwindSafe,