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