pub trait WriteBackend: ReadBackend {
    // Required methods
    fn create(&self) -> Result<()>;
    fn write_bytes(
        &self,
        tpe: FileType,
        id: &Id,
        cacheable: bool,
        buf: Bytes
    ) -> Result<()>;
    fn remove(&self, tpe: FileType, id: &Id, cacheable: bool) -> Result<()>;
}
Expand description

Trait for backends that can write. This trait is implemented by all backends that can write data.

Required Methods§

source

fn create(&self) -> Result<()>

Creates a new backend.

source

fn write_bytes( &self, tpe: FileType, id: &Id, cacheable: bool, buf: Bytes ) -> Result<()>

Writes bytes to the given file.

§Arguments
  • tpe - The type of the file.
  • id - The id of the file.
  • cacheable - Whether the data can be cached.
  • buf - The data to write.
source

fn remove(&self, tpe: FileType, id: &Id, cacheable: bool) -> Result<()>

Removes the given file.

§Arguments
  • tpe - The type of the file.
  • id - The id of the file.
  • cacheable - Whether the file is cacheable.

Trait Implementations§

source§

impl Debug for dyn WriteBackend

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementations on Foreign Types§

source§

impl WriteBackend for Arc<dyn WriteBackend>

source§

fn create(&self) -> Result<()>

source§

fn write_bytes( &self, tpe: FileType, id: &Id, cacheable: bool, buf: Bytes ) -> Result<()>

source§

fn remove(&self, tpe: FileType, id: &Id, cacheable: bool) -> Result<()>

Implementors§