pub struct Database { /* private fields */ }
Implementationsยง
Sourceยงimpl Database
impl Database
pub async fn open(config: &Config, mode: AccessMode) -> Result<DatabaseHandle>
pub async fn open_directly(config: &Config, mode: AccessMode) -> Result<Self>
pub async fn open_at(path: PathBuf, mode: AccessMode) -> Result<Self>
pub async fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<Value>>
pub async fn insert( &mut self, fp: &Fingerprint, hash: CryptoHash, value: &[u8], ) -> Result<(String, bool)>
pub fn scan_keys<'a>( &'a self, prefix: &'a [u8], ) -> impl Stream<Item = Result<Key>> + 'a
pub fn scan_values<'a>( &'a self, prefix: &'a [u8], ) -> impl Stream<Item = Result<(Key, Value)>> + 'a
Trait Implementationsยง
Sourceยงimpl DatabaseClient for Database
impl DatabaseClient for Database
fn add_release<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
fp: &'life1 Fingerprint,
signed: &'life2 Signed,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn index_from_scan<'life0, 'life1, 'async_trait>(
&'life0 mut self,
query: &'life1 TreeQuery,
) -> Pin<Box<dyn Future<Output = Result<(String, usize)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourceยงfn spill<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<(Key, Value)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn spill<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<(Key, Value)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all documents matching this prefix
We may refactor this again because itโs essentially a buffering scan_prefix
fn get_value<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count<'life0, 'life1, 'async_trait>(
&'life0 mut self,
prefix: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn batch_index_from_scan<'life0, 'life1, 'async_trait>(
&'life0 mut self,
query: &'life1 mut TreeQuery,
) -> Pin<Box<dyn Future<Output = Result<(BatchIndex, usize)>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementationsยง
impl !Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more