Struct jammdb::DB [−][src]
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,