pub trait Store {
    type Identifier;

    fn get(&self, ident: &Self::Identifier) -> &[u8]Notable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8];
    fn request_buffer(&self) -> TokenBuffer;
    fn persist(&self) -> Result<(), ()>;
    fn commit(&self, buffer: &mut TokenBuffer) -> Self::Identifier;
    fn extend(&self, buffer: &mut TokenBuffer) -> Result<(), ()>;
    fn return_token(&self, token: Token);
}
Expand description

A type that works as a handle to a Storage backend.

Required Associated Types

The identifier used for refering to stored values

Required Methods

Gets a reference to an archived value

Request a buffer to write data

Persist to underlying storage.

To keep the trait simple, the error type is omitted, and will have to be returned by other means, for example in logging.

Commit written bytes to the

Request additional bytes for writing

Return the token to the store

Implementors