pub trait StorageBackend:
Send
+ Sync
+ 'static {
Show 34 methods
// Required methods
fn history(&self) -> &StoreHistory;
fn open(&self) -> StorageFuture<'_, StorageCursor>;
fn cursor_saved(&self) -> StorageFuture<'_, StorageCursor>;
fn close(&self) -> StorageFuture<'_, ()>;
fn write<'a>(
&'a self,
batch: StorageBatch<'a>,
) -> StorageFuture<'a, StorageCursor>;
fn open_snapshot<'a>(
&'a self,
at: &'a StorageCursor,
) -> StorageFuture<'a, BackendSnapshot>;
fn release_snapshot<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
) -> StorageFuture<'a, ()>;
fn read_schemas<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
selection: &'a SchemaSelection,
page: ScanPage,
) -> StorageFuture<'a, Vec<StorageSchema>>;
fn read_objects<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
selection: &'a ObjectSelection,
page: ScanPage,
) -> StorageFuture<'a, Vec<ObjectEntry>>;
fn read_records<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
selection: &'a RecordSelection,
page: ScanPage,
) -> StorageFuture<'a, Vec<StoredRecord>>;
fn read_stream<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
selection: &'a StreamSelection,
page: ScanPage,
) -> StorageFuture<'a, Vec<StoredRow>>;
fn read_files<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
selection: &'a FileSelection,
page: ScanPage,
) -> StorageFuture<'a, Vec<FileReference>>;
fn read_object<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
point: &'a ObjectPoint,
) -> StorageFuture<'a, Option<ObjectEntry>>;
fn read_file<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
file: &'a FileReference,
offset: u64,
max_bytes: NonZeroUsize,
) -> StorageFuture<'a, Vec<u8>>;
fn release_object_history<'a>(
&'a self,
schema: &'a SchemaKey,
item: &'a ObjectKey,
through: &'a StorageCursor,
) -> StorageFuture<'a, ()>;
fn prune_objects<'a>(
&'a self,
through: &'a StorageCursor,
max_entries: NonZeroUsize,
) -> StorageFuture<'a, bool>;
fn create_file<'a>(
&'a self,
metadata: &'a FileMetadata,
) -> StorageFuture<'a, StagedFile>;
fn write_file<'a>(
&'a self,
staging: &'a StagedFile,
offset: u64,
bytes: &'a [u8],
) -> StorageFuture<'a, ()>;
fn finish_file<'a>(
&'a self,
staging: &'a StagedFile,
position: &'a StorageCursor,
length: u64,
sha256: [u8; 32],
) -> StorageFuture<'a, FileReference>;
fn abort_file<'a>(
&'a self,
staging: &'a StagedFile,
) -> StorageFuture<'a, ()>;
// Provided methods
fn supports_file_sessions(&self) -> bool { ... }
fn create_production<'a>(
&'a self,
_metadata: &'a FileMetadata,
) -> StorageFuture<'a, StagedFile> { ... }
fn fence_production<'a>(
&'a self,
_file: &'a StagedFile,
_expected: u64,
_next: u64,
) -> StorageFuture<'a, ()> { ... }
fn save_production<'a>(
&'a self,
_checkpoint: &'a FileCheckpoint,
) -> StorageFuture<'a, ()> { ... }
fn recover_productions(
&self,
_limits: ReadLimits,
) -> StorageFuture<'_, Vec<FileCheckpoint>> { ... }
fn file_progress<'a>(
&'a self,
_file: &'a StagedFile,
) -> StorageFuture<'a, FileProgress> { ... }
fn read_production<'a>(
&'a self,
_file: &'a StagedFile,
_offset: u64,
_max_bytes: NonZeroUsize,
) -> StorageFuture<'a, Vec<u8>> { ... }
fn abandon_file<'a>(
&'a self,
_staging: &'a StagedFile,
) -> StorageFuture<'a, ()> { ... }
fn supports_file_deletion(&self) -> bool { ... }
fn delete_file<'a>(&'a self, _file: &'a StagedFile) -> StorageFuture<'a, ()> { ... }
fn supports_mutation_receipts(&self) -> bool { ... }
fn save_mutations<'a>(
&'a self,
_receipts: &'a [MutationReceipt],
) -> StorageFuture<'a, ()> { ... }
fn recover_mutations(
&self,
_limits: ReadLimits,
) -> StorageFuture<'_, Vec<MutationReceipt>> { ... }
fn read_identities<'a>(
&'a self,
_snapshot: &'a BackendSnapshot,
_selection: &'a IdentitySelection,
_page: ScanPage,
) -> StorageFuture<'a, Vec<StoredIdentity>> { ... }
}Required Methods§
fn history(&self) -> &StoreHistory
fn open(&self) -> StorageFuture<'_, StorageCursor>
fn cursor_saved(&self) -> StorageFuture<'_, StorageCursor>
fn close(&self) -> StorageFuture<'_, ()>
fn write<'a>( &'a self, batch: StorageBatch<'a>, ) -> StorageFuture<'a, StorageCursor>
fn open_snapshot<'a>( &'a self, at: &'a StorageCursor, ) -> StorageFuture<'a, BackendSnapshot>
fn release_snapshot<'a>( &'a self, snapshot: &'a BackendSnapshot, ) -> StorageFuture<'a, ()>
fn read_schemas<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a SchemaSelection, page: ScanPage, ) -> StorageFuture<'a, Vec<StorageSchema>>
fn read_objects<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a ObjectSelection, page: ScanPage, ) -> StorageFuture<'a, Vec<ObjectEntry>>
fn read_records<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a RecordSelection, page: ScanPage, ) -> StorageFuture<'a, Vec<StoredRecord>>
fn read_stream<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a StreamSelection, page: ScanPage, ) -> StorageFuture<'a, Vec<StoredRow>>
fn read_files<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a FileSelection, page: ScanPage, ) -> StorageFuture<'a, Vec<FileReference>>
fn read_object<'a>( &'a self, snapshot: &'a BackendSnapshot, point: &'a ObjectPoint, ) -> StorageFuture<'a, Option<ObjectEntry>>
fn read_file<'a>( &'a self, snapshot: &'a BackendSnapshot, file: &'a FileReference, offset: u64, max_bytes: NonZeroUsize, ) -> StorageFuture<'a, Vec<u8>>
fn release_object_history<'a>( &'a self, schema: &'a SchemaKey, item: &'a ObjectKey, through: &'a StorageCursor, ) -> StorageFuture<'a, ()>
fn prune_objects<'a>( &'a self, through: &'a StorageCursor, max_entries: NonZeroUsize, ) -> StorageFuture<'a, bool>
fn create_file<'a>( &'a self, metadata: &'a FileMetadata, ) -> StorageFuture<'a, StagedFile>
fn write_file<'a>( &'a self, staging: &'a StagedFile, offset: u64, bytes: &'a [u8], ) -> StorageFuture<'a, ()>
fn finish_file<'a>( &'a self, staging: &'a StagedFile, position: &'a StorageCursor, length: u64, sha256: [u8; 32], ) -> StorageFuture<'a, FileReference>
fn abort_file<'a>(&'a self, staging: &'a StagedFile) -> StorageFuture<'a, ()>
Provided Methods§
fn supports_file_sessions(&self) -> bool
fn create_production<'a>( &'a self, _metadata: &'a FileMetadata, ) -> StorageFuture<'a, StagedFile>
fn fence_production<'a>( &'a self, _file: &'a StagedFile, _expected: u64, _next: u64, ) -> StorageFuture<'a, ()>
fn save_production<'a>( &'a self, _checkpoint: &'a FileCheckpoint, ) -> StorageFuture<'a, ()>
fn recover_productions( &self, _limits: ReadLimits, ) -> StorageFuture<'_, Vec<FileCheckpoint>>
fn file_progress<'a>( &'a self, _file: &'a StagedFile, ) -> StorageFuture<'a, FileProgress>
fn read_production<'a>( &'a self, _file: &'a StagedFile, _offset: u64, _max_bytes: NonZeroUsize, ) -> StorageFuture<'a, Vec<u8>>
fn abandon_file<'a>(&'a self, _staging: &'a StagedFile) -> StorageFuture<'a, ()>
fn supports_file_deletion(&self) -> bool
fn delete_file<'a>(&'a self, _file: &'a StagedFile) -> StorageFuture<'a, ()>
fn supports_mutation_receipts(&self) -> bool
fn save_mutations<'a>( &'a self, _receipts: &'a [MutationReceipt], ) -> StorageFuture<'a, ()>
fn recover_mutations( &self, _limits: ReadLimits, ) -> StorageFuture<'_, Vec<MutationReceipt>>
fn read_identities<'a>( &'a self, _snapshot: &'a BackendSnapshot, _selection: &'a IdentitySelection, _page: ScanPage, ) -> StorageFuture<'a, Vec<StoredIdentity>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".