[−][src]Struct sanakirja::Env
Environment, required to start any transactions. Thread-safe, but opening the same database several times in the same process is not cross-platform.
Implementations
impl<T> Env<T>
[src]
impl<T> Env<T>
[src]
pub fn file_size<P: AsRef<Path>>(path: P) -> Result<u64, Error>
[src]
std::fs::File size of the database path, if it exists.
pub fn set_flush_limit(&mut self, flush: u64)
[src]
Set the maximum number of dirty pages before triggering a
flush. The default is 4096 pages. Some operating systems might
have other acceptable values. For example, Linux defines the
"dirty ratio" as the number of memory pages that have been
written to (so-called "dirty pages") divided by number of
pages in available memory. This can be checked for instance
using the command systctl -a | grep dirty
.
pub fn flush_limit(&self) -> u64
[src]
Get the maximum number of dirty pages before triggering a flush.
impl Env<Exclusive>
[src]
pub fn new_anon(length: u64) -> Result<Env<Exclusive>, Error>
[src]
Create a new anonymous database, backed by memory. The length is the total size in bytes of the database.
pub fn mut_txn_begin<E: Borrow<Self>>(env: E) -> Result<MutTxn<E, ()>, Error>
[src]
Start a mutable transaction. Mutable transactions that go out of scope are automatically aborted.
impl<L> Env<L>
[src]
pub unsafe fn close(&mut self)
[src]
Close this repository.
The safe alternative to this method is to use an Option<Env>
instead of an Env
.
impl<L> Env<L>
[src]
pub fn txn_begin<E: Borrow<Self>>(env: E) -> Result<Txn<L, E>, Error>
[src]
Start a read-only transaction.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Env<T>
[src]
impl<T> Unpin for Env<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Env<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
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, 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,