Struct Database

Source
pub struct Database<const W: bool, C, B> {
    pub db: Db,
    pub config: C,
    pub books: B,
}

Fields§

§db: Db§config: C§books: B

Implementations§

Source§

impl<C: Serialize, B: Serialize> Database<true, C, B>

Source

pub fn create<P: AsRef<Path>>( path: P, cfs: Vec<ColumnFamilyDescriptor>, options: Options, optimistic_transactions: bool, config: C, books: B, ) -> Result<Self, Error>

Source

pub fn write_config(&self, config: &C) -> Result<(), Error>

Source

pub fn write_books(&self, books: &B) -> Result<(), Error>

Source§

impl<'de, C: Deserialize<'de>, B: Deserialize<'de>> Database<true, C, B>

Source§

impl<'de, const W: bool, C: Deserialize<'de>, B: Deserialize<'de>> Database<W, C, B>

Source

pub fn open<P: AsRef<Path>>( path: P, cfs: Vec<ColumnFamilyDescriptor>, options: Options, ) -> Result<Self, Error>

Source

pub fn read_config(&self) -> Result<C, Error>

Source

pub fn read_books(&self) -> Result<B, Error>

Source§

impl<C, B> Database<true, C, B>

Source

pub fn admin<P: AsRef<Path>>( path: P, cfs: Vec<ColumnFamilyDescriptor>, ) -> Result<Admin, Error>

Source§

impl<C, B> Database<false, C, B>

Source

pub fn underlying(&self) -> &DB

Trait Implementations§

Source§

impl<const W: bool, C: Clone, B: Clone> Clone for Database<W, C, B>

Source§

fn clone(&self) -> Database<W, C, B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<const W: bool, C, B> Freeze for Database<W, C, B>
where C: Freeze, B: Freeze,

§

impl<const W: bool, C, B> RefUnwindSafe for Database<W, C, B>

§

impl<const W: bool, C, B> Send for Database<W, C, B>
where C: Send, B: Send,

§

impl<const W: bool, C, B> Sync for Database<W, C, B>
where C: Sync, B: Sync,

§

impl<const W: bool, C, B> Unpin for Database<W, C, B>
where C: Unpin, B: Unpin,

§

impl<const W: bool, C, B> UnwindSafe for Database<W, C, B>
where C: UnwindSafe, B: 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> 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.