Trait Backend

Source
pub trait Backend {
    // Required methods
    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§

Source

fn get_data(&mut self) -> BackendResult<Vec<u8>>

Read the all data from the backend.

Source

fn put_data(&mut self, data: &[u8]) -> BackendResult<()>

Write the whole slice to the backend.

Trait Implementations§

Source§

impl Backend for Box<dyn Backend>

Source§

fn get_data(&mut self) -> BackendResult<Vec<u8>>

Read the all data from the backend.
Source§

fn put_data(&mut self, data: &[u8]) -> BackendResult<()>

Write the whole slice to the backend.

Implementations on Foreign Types§

Source§

impl Backend for Box<dyn Backend>

Source§

fn get_data(&mut self) -> BackendResult<Vec<u8>>

Source§

fn put_data(&mut self, data: &[u8]) -> BackendResult<()>

Source§

impl<T: Backend> Backend for Box<T>

Source§

fn get_data(&mut self) -> BackendResult<Vec<u8>>

Source§

fn put_data(&mut self, data: &[u8]) -> BackendResult<()>

Implementors§