Skip to main content

SourceTargetMapStore

Trait SourceTargetMapStore 

Source
pub trait SourceTargetMapStore {
    type Error;

    // Required methods
    fn read(
        &mut self,
        hash: ContentHash,
        max_bytes: usize,
    ) -> Result<Option<Vec<u8>>, Self::Error>;
    fn write(
        &mut self,
        hash: ContentHash,
        bytes: Vec<u8>,
    ) -> Result<(), Self::Error>;
}
Expand description

Storage must bound a read before allocating/fetching more than max_bytes. Writes install immutable bytes at their ordinary blob address.

Required Associated Types§

Required Methods§

Source

fn read( &mut self, hash: ContentHash, max_bytes: usize, ) -> Result<Option<Vec<u8>>, Self::Error>

Source

fn write( &mut self, hash: ContentHash, bytes: Vec<u8>, ) -> Result<(), Self::Error>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§