Trait external_storage::ExternalStorage[][src]

pub trait ExternalStorage: 'static + Send + Sync {
    fn name(&self) -> &'static str;
fn url(&self) -> Result<Url>;
fn write(
        &self,
        name: &str,
        reader: Box<dyn AsyncRead + Send + Unpin>,
        content_length: u64
    ) -> Result<()>;
fn read(&self, name: &str) -> Box<dyn AsyncRead + Unpin>; fn restore(
        &self,
        storage_name: &str,
        restore_name: PathBuf,
        expected_length: u64,
        speed_limiter: &Limiter
    ) -> Result<()> { ... } }

An abstraction of an external storage.

Required methods

fn name(&self) -> &'static str[src]

fn url(&self) -> Result<Url>[src]

fn write(
    &self,
    name: &str,
    reader: Box<dyn AsyncRead + Send + Unpin>,
    content_length: u64
) -> Result<()>
[src]

Write all contents of the read to the given path.

fn read(&self, name: &str) -> Box<dyn AsyncRead + Unpin>[src]

Read all contents of the given path.

Loading content...

Provided methods

fn restore(
    &self,
    storage_name: &str,
    restore_name: PathBuf,
    expected_length: u64,
    speed_limiter: &Limiter
) -> Result<()>
[src]

Read from external storage and restore to the given path

Loading content...

Implementations on Foreign Types

impl ExternalStorage for Arc<dyn ExternalStorage>[src]

impl ExternalStorage for Box<dyn ExternalStorage>[src]

Loading content...

Implementors

impl ExternalStorage for LocalStorage[src]

impl ExternalStorage for NoopStorage[src]

Loading content...