pub trait StorageBackend:
Send
+ Sync
+ 'static {
Show 38 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_schemas(
&self,
batch: StorageBatch<StorageSchema>,
) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>;
fn write_objects(
&self,
batch: StorageBatch<ObjectEntry>,
) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>;
fn write_records(
&self,
batch: StorageBatch<StoredRecord>,
) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>;
fn write_stream(
&self,
batch: StorageBatch<StoredRow>,
) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>;
fn write_files(
&self,
batch: StorageBatch<FileReference>,
) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>;
fn open_snapshot<'a>(
&'a self,
at: &'a StorageCursor,
memory: RetainedMemory,
) -> 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,
memory: RetainedMemory,
) -> 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,
memory: RetainedMemory,
) -> 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,
memory: RetainedMemory,
) -> 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,
memory: RetainedMemory,
) -> 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,
memory: RetainedMemory,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileReference>, Error>> + Send + 'a>>;
fn read_object<'a>(
&'a self,
snapshot: &'a BackendSnapshot,
point: &'a ObjectPoint,
memory: RetainedMemory,
) -> 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>,
memory: RetainedMemory,
) -> 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>,
retention: fn(&SchemaKey) -> Result<ObjectRetention, Error>,
) -> 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: StorageBatch<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(
&self,
_checkpoint: StorageBatch<FileCheckpoint>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>> { ... }
fn recover_productions(
&self,
_limits: ReadLimits,
_memory: RetainedMemory,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileCheckpoint>, Error>> + Send + '_>> { ... }
fn file_progress<'a>(
&'a self,
_file: &'a StagedFile,
_memory: RetainedMemory,
) -> 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>,
_memory: RetainedMemory,
) -> 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(
&self,
_receipts: StorageBatch<MutationReceipt>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>> { ... }
fn recover_mutations(
&self,
_limits: ReadLimits,
_memory: RetainedMemory,
) -> Pin<Box<dyn Future<Output = Result<Vec<MutationReceipt>, Error>> + Send + '_>> { ... }
fn read_identities<'a>(
&'a self,
_snapshot: &'a BackendSnapshot,
_selection: &'a IdentitySelection,
_page: ScanPage,
_memory: RetainedMemory,
) -> 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_schemas( &self, batch: StorageBatch<StorageSchema>, ) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>
fn write_objects( &self, batch: StorageBatch<ObjectEntry>, ) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>
fn write_records( &self, batch: StorageBatch<StoredRecord>, ) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>
fn write_stream( &self, batch: StorageBatch<StoredRow>, ) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>
fn write_files( &self, batch: StorageBatch<FileReference>, ) -> Pin<Box<dyn Future<Output = Result<StorageCursor, Error>> + Send + '_>>
fn open_snapshot<'a>( &'a self, at: &'a StorageCursor, memory: RetainedMemory, ) -> 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, memory: RetainedMemory, ) -> 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, memory: RetainedMemory, ) -> 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, memory: RetainedMemory, ) -> 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, memory: RetainedMemory, ) -> 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, memory: RetainedMemory, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileReference>, Error>> + Send + 'a>>
fn read_object<'a>( &'a self, snapshot: &'a BackendSnapshot, point: &'a ObjectPoint, memory: RetainedMemory, ) -> 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>, memory: RetainedMemory, ) -> 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>, retention: fn(&SchemaKey) -> Result<ObjectRetention, Error>, ) -> 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: StorageBatch<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( &self, _checkpoint: StorageBatch<FileCheckpoint>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
fn recover_productions( &self, _limits: ReadLimits, _memory: RetainedMemory, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileCheckpoint>, Error>> + Send + '_>>
fn file_progress<'a>( &'a self, _file: &'a StagedFile, _memory: RetainedMemory, ) -> 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>, _memory: RetainedMemory, ) -> 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( &self, _receipts: StorageBatch<MutationReceipt>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
fn recover_mutations( &self, _limits: ReadLimits, _memory: RetainedMemory, ) -> Pin<Box<dyn Future<Output = Result<Vec<MutationReceipt>, Error>> + Send + '_>>
fn read_identities<'a>( &'a self, _snapshot: &'a BackendSnapshot, _selection: &'a IdentitySelection, _page: ScanPage, _memory: RetainedMemory, ) -> 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".