pub trait BlobStore: Debug + Send + Sync + 'static {
type Error: From<NoError> + From<Error> + Debug;
fn read(&self, id: &[u8]) -> Result<Blob<'static>, Self::Error>;
fn write(&self, data: &[u8]) -> Result<Vec<u8>, Self::Error>;
fn sync(&self) -> Result<(), Self::Error>;
fn needs_deep_detach(&self) -> bool { ... }
}
Expand description
A generic blob store with variable id size
Required Associated Types
Required Methods
Read a blob with the given id. Since ids can be of arbitrary size, passed as a slice
Write a blob, returning an id into a target vec tgt
.
If this returns an error, the tgt vec is guaranteed to be unmodified.
Provided Methods
sourcefn needs_deep_detach(&self) -> bool
fn needs_deep_detach(&self) -> bool
True if the store needs deep detach. This is true for basically all stores except the special NoStore store