Trait external_storage_export::ExternalStorage[][src]

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

An abstraction of an external storage.

Required methods

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

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

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

Write all contents of the read to the given path.

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

Read all contents of the given path.

Provided methods

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

Read from external storage and restore to the given path

Implementations on Foreign Types

impl ExternalStorage for Box<dyn ExternalStorage + 'static, Global>[src][]

impl ExternalStorage for Arc<dyn ExternalStorage + 'static>[src][]

Implementors

impl ExternalStorage for EncryptedExternalStorage[src][+]

impl ExternalStorage for LocalStorage[src][+]

impl ExternalStorage for NoopStorage[src][+]

impl<Blob: BlobStorage> ExternalStorage for BlobStore<Blob>[src][+]