pub struct Database { /* private fields */ }
Expand description
Database implements the crate::subnet::rpc::database::Database
interface
by living on top of another database, writing changes to the underlying
database only when commit is called.
ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/database/versiondb#Database
Implementations§
source§impl Database
impl Database
pub fn new(db: BoxedDatabase, batch: BoxedBatch) -> Self
Trait Implementations§
source§impl Batcher for Database
impl Batcher for Database
source§fn new_batch<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BoxedBatch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_batch<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<BoxedBatch>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Implements the crate::subnet::rpc::database::batch::Batcher
trait.
source§impl Iteratee for Database
impl Iteratee for Database
source§fn new_iterator<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BoxedIterator>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_iterator<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<BoxedIterator>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Implements the crate::subnet::rpc::database::iterator::Iteratee
trait.
source§fn new_iterator_with_start<'life0, 'life1, 'async_trait>(
&'life0 self,
start: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<BoxedIterator>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn new_iterator_with_start<'life0, 'life1, 'async_trait>( &'life0 self, start: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<BoxedIterator>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Implements the crate::subnet::rpc::database::iterator::Iteratee
trait.
source§fn new_iterator_with_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<BoxedIterator>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn new_iterator_with_prefix<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<BoxedIterator>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Implements the crate::subnet::rpc::database::iterator::Iteratee
trait.
source§fn new_iterator_with_start_and_prefix<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
start: &'life1 [u8],
prefix: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<BoxedIterator>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn new_iterator_with_start_and_prefix<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, start: &'life1 [u8], prefix: &'life2 [u8] ) -> Pin<Box<dyn Future<Output = Result<BoxedIterator>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Implements the crate::subnet::rpc::database::iterator::Iteratee
trait.
source§impl KeyValueReaderWriterDeleter for Database
impl KeyValueReaderWriterDeleter for Database
source§fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Implements the crate::subnet::rpc::database::KeyValueReaderWriterDeleter
trait.
source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Implements the crate::subnet::rpc::database::KeyValueReaderWriterDeleter
trait.
source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
key: &'life1 [u8],
value: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, key: &'life1 [u8], value: &'life2 [u8] ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Implements the crate::subnet::rpc::database::KeyValueReaderWriterDeleter
trait.
source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 mut self,
key: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Implements the crate::subnet::rpc::database::KeyValueReaderWriterDeleter
trait.
impl Database for Database
Auto Trait Implementations§
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request