Struct Connection

Source
pub struct Connection { /* private fields */ }

Trait Implementations§

Source§

impl DatabaseHandle for Connection

Source§

type WalIndex = WalDisabled

An optional trait used to store a WAL (write-ahead log).
Source§

fn size(&self) -> Result<u64, Error>

Return the current size in bytes of the database.
Source§

fn read_exact_at(&mut self, buf: &mut [u8], offset: u64) -> Result<(), Error>

Reads the exact number of byte required to fill buf from the given offset.
Source§

fn write_all_at(&mut self, buf: &[u8], offset: u64) -> Result<(), Error>

Attempts to write an entire buf starting from the given offset.
Source§

fn sync(&mut self, _data_only: bool) -> Result<(), Error>

Make sure all writes are committed to the underlying storage. If data_only is set to true, only the data and not the metadata (like size, access time, etc) should be synced.
Source§

fn set_len(&mut self, size: u64) -> Result<(), Error>

Set the database file to the specified size. Truncates or extends the underlying storage.
Source§

fn lock(&mut self, lock: LockKind) -> Result<bool, Error>

Lock the database. Returns whether the requested lock could be acquired. Locking sequence: Read more
Source§

fn reserved(&mut self) -> Result<bool, Error>

Check if the database this handle points to holds a LockKind::Reserved, LockKind::Pending or LockKind::Exclusive lock.
Source§

fn current_lock(&self) -> Result<LockKind, Error>

Return the current LockKind of the this handle.
Source§

fn wal_index(&self, _readonly: bool) -> Result<Self::WalIndex, Error>

Source§

fn unlock(&mut self, lock: LockKind) -> Result<bool, Error>

Unlock the database.
Source§

fn set_chunk_size(&self, _chunk_size: usize) -> Result<(), Error>

Change the chunk size of the database to chunk_size.
Source§

fn moved(&self) -> Result<bool, Error>

Check if the underlying data of the handle got moved or deleted. When moved, the handle can still be read from, but not written to anymore.
Source§

impl Drop for Connection

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.