Skip to main content

ReadTxn

Struct ReadTxn 

Source
pub struct ReadTxn<'db> { /* private fields */ }
Expand description

Public read transaction. Acquired by crate::Db::read_transaction.

Carries only the obj-core read-side handle — the writer’s live Catalog is NOT held by a ReadTxn because reads consult the snapshot-pinned catalog root via obj_core::Catalog::lookup_via_snapshot (M6 #53), not the live Catalog.tree.root.

M11 #93: a ReadTxn MAY also carry one AttachedReadCtx per attached database registered on the calling crate::Db. The per-attached snapshots are pinned at txn-begin time and released when the ReadTxn drops; reads against <namespace>.<collection> route through them.

Implementations§

Source§

impl<'db> ReadTxn<'db>

Source

pub fn collection<T: Document>(&self) -> Result<Collection<'_, T>>

Open a typed handle to the collection T lives in.

Read-only: returns Error::CollectionNotFound if the collection has never been registered AT THE SNAPSHOT’S PINNED LSN.

If T::COLLECTION is of the form <namespace>.<name>, the txn dispatches against the attached database registered under <namespace> instead of the calling Db.

§Errors

Auto Trait Implementations§

§

impl<'db> Freeze for ReadTxn<'db>

§

impl<'db> RefUnwindSafe for ReadTxn<'db>

§

impl<'db> Send for ReadTxn<'db>

§

impl<'db> Sync for ReadTxn<'db>

§

impl<'db> Unpin for ReadTxn<'db>

§

impl<'db> UnsafeUnpin for ReadTxn<'db>

§

impl<'db> UnwindSafe for ReadTxn<'db>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V