[−][src]Struct kvdb_web::Database
Database backed by both IndexedDB and in memory implementation.
Implementations
impl Database
[src]
pub async fn open(name: String, columns: u32) -> Result<Database, Error>
[src]
Opens the database with the given name, and the specified number of columns (not including the default one).
pub fn name(&self) -> &str
[src]
Get the database name.
pub fn version(&self) -> u32
[src]
Get the database version.
Trait Implementations
impl Drop for Database
[src]
impl KeyValueDB for Database
[src]
fn get(&self, col: u32, key: &[u8]) -> Result<Option<DBValue>>
[src]
fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option<Box<[u8]>>
[src]
fn write(&self, transaction: DBTransaction) -> Result<()>
[src]
fn iter<'a>(
&'a self,
col: u32
) -> Box<dyn Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a>
[src]
&'a self,
col: u32
) -> Box<dyn Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a>
fn iter_with_prefix<'a>(
&'a self,
col: u32,
prefix: &'a [u8]
) -> Box<dyn Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a>
[src]
&'a self,
col: u32,
prefix: &'a [u8]
) -> Box<dyn Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a>
fn restore(&self, _new_db: &str) -> Result<()>
[src]
pub fn transaction(&self) -> DBTransaction
[src]
pub fn io_stats(&self, _kind: Kind) -> IoStats
[src]
pub fn has_key(&self, col: u32, key: &[u8]) -> Result<bool, Error>
[src]
pub fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool
[src]
impl MallocSizeOf for Database
[src]
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
[src]
fn constant_size() -> Option<usize>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Database
[src]
impl Send for Database
[src]
impl Sync for Database
[src]
impl Unpin for Database
[src]
impl UnwindSafe for Database
[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> MallocSizeOfExt for T where
T: MallocSizeOf,
[src]
T: MallocSizeOf,
pub fn malloc_size_of(&self) -> usize
[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>,