Struct jammdb::DB[][src]

pub struct DB(_);

A database

A DB can created from an OpenOptions builder, or by calling open. From a DB, you can create a Transaction to access the data in the database. Opening a transaction requires a mutable borrow though, so you need to clone the database to have concurrent transactions (you're really just cloning an Arc so it's pretty cheap).

Implementations

impl DB[src]

pub fn open<P: AsRef<Path>>(path: P) -> Result<DB, Error>[src]

Opens a database using the default OpenOptions.

Same as calling OpenOptions::new().open(path). Please read the documentation for OpenOptions::open for details.

Examples

use jammdb::{DB};

let db = DB::open("my.db")?;

// do whatever you want with the DB

pub fn tx(&self, writable: bool) -> Result<Transaction<'_>, Error>[src]

Creates a Transaction. This transaction is either read-only or writable depending on the writable parameter. Please read the docs on a Transaction for more details.

pub fn pagesize(&self) -> u64[src]

Returns the database's pagesize.

Trait Implementations

impl Clone for DB[src]

Auto Trait Implementations

impl RefUnwindSafe for DB[src]

impl Send for DB[src]

impl Sync for DB[src]

impl Unpin for DB[src]

impl UnwindSafe for DB[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.