pub trait RemoteStore: Send + Sync {
// Required methods
fn upload(&self, hash: &[u8; 32], data: &[u8]) -> Result<(), EdgestoreError>;
fn download(&self, hash: &[u8; 32]) -> Result<Vec<u8>, EdgestoreError>;
fn list(&self) -> Result<Vec<[u8; 32]>, EdgestoreError>;
fn delete(&self, hash: &[u8; 32]) -> Result<(), EdgestoreError>;
}Expand description
Abstraction over a durable, content-addressed segment store.
Phase 4 provides FilesystemRemoteStore (Plan 04-04). S3 (S3RemoteStore) is a
future-phase deliverable (D04, D05). Implementations must be Send + Sync so they
can be shared across threads.
Required Methods§
Sourcefn upload(&self, hash: &[u8; 32], data: &[u8]) -> Result<(), EdgestoreError>
fn upload(&self, hash: &[u8; 32], data: &[u8]) -> Result<(), EdgestoreError>
Store segment bytes under content hash. Idempotent.
If a segment with the same hash already exists, the implementation MAY skip the write without returning an error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".