Struct solana_ledger::blockstore_db::Database
source · pub struct Database {
backend: Arc<Rocks>,
path: Arc<Path>,
column_options: Arc<LedgerColumnOptions>,
}
Fields§
§backend: Arc<Rocks>
§path: Arc<Path>
§column_options: Arc<LedgerColumnOptions>
Implementations§
source§impl Database
impl Database
pub fn open(path: &Path, options: BlockstoreOptions) -> Result<Self>
pub fn destroy(path: &Path) -> Result<()>
pub fn get<C>(&self, key: C::Index) -> Result<Option<C::Type>>where C: TypedColumn + ColumnName,
pub fn iter<C>( &self, iterator_mode: IteratorMode<C::Index> ) -> Result<impl Iterator<Item = (C::Index, Box<[u8]>)> + '_>where C: Column + ColumnName,
pub fn cf_handle<C>(&self) -> &ColumnFamilywhere C: Column + ColumnName,
pub fn column<C>(&self) -> LedgerColumn<C>where C: Column + ColumnName,
pub fn raw_iterator_cf(&self, cf: &ColumnFamily) -> Result<DBRawIterator<'_>>
pub fn batch(&self) -> Result<WriteBatch<'_>>
pub fn write(&self, batch: WriteBatch<'_>) -> Result<()>
pub fn storage_size(&self) -> Result<u64>
sourcepub fn delete_range_cf<C>(
&self,
batch: &mut WriteBatch<'_>,
from: Slot,
to: Slot
) -> Result<()>where
C: Column + ColumnName,
pub fn delete_range_cf<C>( &self, batch: &mut WriteBatch<'_>, from: Slot, to: Slot ) -> Result<()>where C: Column + ColumnName,
Adds a [from
, to
] range that deletes all entries between the from
slot
and to
slot inclusively. If from
slot and to
slot are the same, then all
entries in that slot will be removed.
sourcepub fn delete_file_in_range_cf<C>(&self, from: Slot, to: Slot) -> Result<()>where
C: Column + ColumnName,
pub fn delete_file_in_range_cf<C>(&self, from: Slot, to: Slot) -> Result<()>where C: Column + ColumnName,
Delete files whose slot range is within [from
, to
].
pub fn is_primary_access(&self) -> bool
pub fn set_oldest_slot(&self, oldest_slot: Slot)
pub fn live_files_metadata(&self) -> Result<Vec<LiveFile>>
Trait Implementations§
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request