Skip to main content

StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend:
    Send
    + Sync
    + 'static {
Show 38 methods // Required methods fn history(&self) -> &StoreHistory; fn open(&self) -> StorageFuture<'_, StorageCursor>; fn cursor_saved(&self) -> StorageFuture<'_, StorageCursor>; fn close(&self) -> StorageFuture<'_, ()>; fn write_schemas( &self, batch: StorageBatch<StorageSchema>, ) -> StorageFuture<'_, StorageCursor>; fn write_objects( &self, batch: StorageBatch<ObjectEntry>, ) -> StorageFuture<'_, StorageCursor>; fn write_records( &self, batch: StorageBatch<StoredRecord>, ) -> StorageFuture<'_, StorageCursor>; fn write_stream( &self, batch: StorageBatch<StoredRow>, ) -> StorageFuture<'_, StorageCursor>; fn write_files( &self, batch: StorageBatch<FileReference>, ) -> StorageFuture<'_, StorageCursor>; fn open_snapshot<'a>( &'a self, at: &'a StorageCursor, memory: RetainedMemory, ) -> 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, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<StorageSchema>>; fn read_objects<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a ObjectSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<ObjectEntry>>; fn read_records<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a RecordSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<StoredRecord>>; fn read_stream<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a StreamSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<StoredRow>>; fn read_files<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a FileSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<FileReference>>; fn read_object<'a>( &'a self, snapshot: &'a BackendSnapshot, point: &'a ObjectPoint, memory: RetainedMemory, ) -> StorageFuture<'a, Option<ObjectEntry>>; fn read_file<'a>( &'a self, snapshot: &'a BackendSnapshot, file: &'a FileReference, offset: u64, max_bytes: NonZeroUsize, memory: RetainedMemory, ) -> 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, retention: fn(&SchemaKey) -> Result<ObjectRetention>, ) -> 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: FileChunk, ) -> 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( &self, _checkpoint: StorageBatch<FileCheckpoint>, ) -> StorageFuture<'_, ()> { ... } fn recover_productions( &self, _limits: ReadLimits, _memory: RetainedMemory, ) -> StorageFuture<'_, Vec<FileCheckpoint>> { ... } fn file_progress<'a>( &'a self, _file: &'a StagedFile, _memory: RetainedMemory, ) -> StorageFuture<'a, FileProgress> { ... } fn read_production<'a>( &'a self, _file: &'a StagedFile, _offset: u64, _max_bytes: NonZeroUsize, _memory: RetainedMemory, ) -> 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( &self, _receipts: StorageBatch<MutationReceipt>, ) -> StorageFuture<'_, ()> { ... } fn recover_mutations( &self, _limits: ReadLimits, _memory: RetainedMemory, ) -> StorageFuture<'_, Vec<MutationReceipt>> { ... } fn read_identities<'a>( &'a self, _snapshot: &'a BackendSnapshot, _selection: &'a IdentitySelection, _page: ScanPage, _memory: RetainedMemory, ) -> StorageFuture<'a, Vec<StoredIdentity>> { ... }
}

Required Methods§

Source

fn history(&self) -> &StoreHistory

Source

fn open(&self) -> StorageFuture<'_, StorageCursor>

Source

fn cursor_saved(&self) -> StorageFuture<'_, StorageCursor>

Source

fn close(&self) -> StorageFuture<'_, ()>

Source

fn write_schemas( &self, batch: StorageBatch<StorageSchema>, ) -> StorageFuture<'_, StorageCursor>

Source

fn write_objects( &self, batch: StorageBatch<ObjectEntry>, ) -> StorageFuture<'_, StorageCursor>

Source

fn write_records( &self, batch: StorageBatch<StoredRecord>, ) -> StorageFuture<'_, StorageCursor>

Source

fn write_stream( &self, batch: StorageBatch<StoredRow>, ) -> StorageFuture<'_, StorageCursor>

Source

fn write_files( &self, batch: StorageBatch<FileReference>, ) -> StorageFuture<'_, StorageCursor>

Source

fn open_snapshot<'a>( &'a self, at: &'a StorageCursor, memory: RetainedMemory, ) -> StorageFuture<'a, BackendSnapshot>

Source

fn release_snapshot<'a>( &'a self, snapshot: &'a BackendSnapshot, ) -> StorageFuture<'a, ()>

Source

fn read_schemas<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a SchemaSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<StorageSchema>>

Source

fn read_objects<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a ObjectSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<ObjectEntry>>

Source

fn read_records<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a RecordSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<StoredRecord>>

Source

fn read_stream<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a StreamSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<StoredRow>>

Source

fn read_files<'a>( &'a self, snapshot: &'a BackendSnapshot, selection: &'a FileSelection, page: ScanPage, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<FileReference>>

Source

fn read_object<'a>( &'a self, snapshot: &'a BackendSnapshot, point: &'a ObjectPoint, memory: RetainedMemory, ) -> StorageFuture<'a, Option<ObjectEntry>>

Source

fn read_file<'a>( &'a self, snapshot: &'a BackendSnapshot, file: &'a FileReference, offset: u64, max_bytes: NonZeroUsize, memory: RetainedMemory, ) -> StorageFuture<'a, Vec<u8>>

Source

fn release_object_history<'a>( &'a self, schema: &'a SchemaKey, item: &'a ObjectKey, through: &'a StorageCursor, ) -> StorageFuture<'a, ()>

Source

fn prune_objects<'a>( &'a self, through: &'a StorageCursor, max_entries: NonZeroUsize, retention: fn(&SchemaKey) -> Result<ObjectRetention>, ) -> StorageFuture<'a, bool>

Source

fn create_file<'a>( &'a self, metadata: &'a FileMetadata, ) -> StorageFuture<'a, StagedFile>

Source

fn write_file<'a>( &'a self, staging: &'a StagedFile, offset: u64, bytes: FileChunk, ) -> StorageFuture<'a, ()>

Source

fn finish_file<'a>( &'a self, staging: &'a StagedFile, position: &'a StorageCursor, length: u64, sha256: [u8; 32], ) -> StorageFuture<'a, FileReference>

Source

fn abort_file<'a>(&'a self, staging: &'a StagedFile) -> StorageFuture<'a, ()>

Provided Methods§

Source

fn supports_file_sessions(&self) -> bool

Source

fn create_production<'a>( &'a self, _metadata: &'a FileMetadata, ) -> StorageFuture<'a, StagedFile>

Source

fn fence_production<'a>( &'a self, _file: &'a StagedFile, _expected: u64, _next: u64, ) -> StorageFuture<'a, ()>

Source

fn save_production( &self, _checkpoint: StorageBatch<FileCheckpoint>, ) -> StorageFuture<'_, ()>

Source

fn recover_productions( &self, _limits: ReadLimits, _memory: RetainedMemory, ) -> StorageFuture<'_, Vec<FileCheckpoint>>

Source

fn file_progress<'a>( &'a self, _file: &'a StagedFile, _memory: RetainedMemory, ) -> StorageFuture<'a, FileProgress>

Source

fn read_production<'a>( &'a self, _file: &'a StagedFile, _offset: u64, _max_bytes: NonZeroUsize, _memory: RetainedMemory, ) -> StorageFuture<'a, Vec<u8>>

Source

fn abandon_file<'a>(&'a self, _staging: &'a StagedFile) -> StorageFuture<'a, ()>

Source

fn supports_file_deletion(&self) -> bool

Source

fn delete_file<'a>(&'a self, _file: &'a StagedFile) -> StorageFuture<'a, ()>

Source

fn supports_mutation_receipts(&self) -> bool

Source

fn save_mutations( &self, _receipts: StorageBatch<MutationReceipt>, ) -> StorageFuture<'_, ()>

Source

fn recover_mutations( &self, _limits: ReadLimits, _memory: RetainedMemory, ) -> StorageFuture<'_, Vec<MutationReceipt>>

Source

fn read_identities<'a>( &'a self, _snapshot: &'a BackendSnapshot, _selection: &'a IdentitySelection, _page: ScanPage, _memory: RetainedMemory, ) -> StorageFuture<'a, Vec<StoredIdentity>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§