pub trait Backend {
fn get_data(&mut self) -> BackendResult<Vec<u8>>;
fn put_data(&mut self, data: &[u8]) -> BackendResult<()>;
}
Expand description
The Backend Trait.
It should always read and save in full the data that it is passed. This means that a write to the backend followed by a read must return the same dataset.
Important: You can only return custom errors if the other_errors
feature is enabled
Required Methods
fn get_data(&mut self) -> BackendResult<Vec<u8>>
fn get_data(&mut self) -> BackendResult<Vec<u8>>
Read the all data from the backend.
fn put_data(&mut self, data: &[u8]) -> BackendResult<()>
fn put_data(&mut self, data: &[u8]) -> BackendResult<()>
Write the whole slice to the backend.