Trait asuran::repository::backend::common::sync_backend::SyncBackend[][src]

pub trait SyncBackend: 'static + Debug {
    type SyncManifest: SyncManifest + 'static;
    type SyncIndex: SyncIndex + 'static;
    fn get_index(&mut self) -> &mut Self::SyncIndex;
fn get_manifest(&mut self) -> &mut Self::SyncManifest;
fn write_key(&mut self, key: EncryptedKey) -> Result<()>;
fn read_key(&mut self) -> Result<EncryptedKey>;
fn read_chunk(&mut self, location: SegmentDescriptor) -> Result<Chunk>;
fn write_chunk(&mut self, chunk: Chunk) -> Result<SegmentDescriptor>; }
Expand description

Note: In this version of the trait, the get index and get archive methods return mutable references, instead of owned values. As this version of the trait is intrinsically single threaded, implementers are expected to own a single instance of their Index and Manifest impls, and the reference will never leak outside of their container task.

Also note, that we do not have the close method, as the wrapper type will handle that for us.

Associated Types

Required methods