Struct sanakirja_core::btree::Db_

source ·
pub struct Db_<K: ?Sized, V: ?Sized, P: BTreePage<K, V>> {
    pub db: NonZeroU64,
    pub k: PhantomData<K>,
    pub v: PhantomData<V>,
    pub p: PhantomData<P>,
}
Expand description

A database, which is essentially just a page offset along with markers.

Fields§

§db: NonZeroU64§k: PhantomData<K>§v: PhantomData<V>§p: PhantomData<P>

Implementations§

source§

impl<K: ?Sized, V: ?Sized, P: BTreePage<K, V>> Db_<K, V, P>

source

pub unsafe fn from_page(db: u64) -> Self

Load a database from a page offset.

Trait Implementations§

source§

impl<K: Debug + ?Sized, V: Debug + ?Sized, P: Debug + BTreePage<K, V>> Debug for Db_<K, V, P>

source§

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

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

impl<K: Storable, V: Storable, P: BTreePage<K, V> + Debug> Storable for Db_<K, V, P>

§

type PageReferences = Once<u64>

An iterator over the offsets to pages contained in this value. Only values from this crate can generate non-empty iterators, but combined values (like tuples) must chain the iterators returned by method page_offsets.
source§

fn page_references(&self) -> Self::PageReferences

If this value is an offset to another page at offset offset, return Some(offset). Return None else.
source§

unsafe fn drop<T: AllocPage>(&self, t: &mut T) -> Result<(), T::Error>

If this value is an offset to another page at offset offset, return Some(offset). Return None else. Read more
source§

fn compare<T: LoadPage>(&self, _txn: &T, _b: &Self) -> Ordering

This is required for B trees, not necessarily for other structures. The default implementation panics.

Auto Trait Implementations§

§

impl<K: ?Sized, V: ?Sized, P> RefUnwindSafe for Db_<K, V, P>

§

impl<K: ?Sized, V: ?Sized, P> Send for Db_<K, V, P>
where K: Send, P: Send, V: Send,

§

impl<K: ?Sized, V: ?Sized, P> Sync for Db_<K, V, P>
where K: Sync, P: Sync, V: Sync,

§

impl<K: ?Sized, V: ?Sized, P> Unpin for Db_<K, V, P>
where K: Unpin, P: Unpin, V: Unpin,

§

impl<K: ?Sized, V: ?Sized, P> UnwindSafe for Db_<K, V, P>
where K: UnwindSafe, P: UnwindSafe, V: UnwindSafe,

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>,

§

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>,

§

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.