ObjectStoreProvider

Trait ObjectStoreProvider 

Source
pub trait ObjectStoreProvider:
    Debug
    + Sync
    + Send {
    // Required method
    fn new_store<'life0, 'life1, 'async_trait>(
        &'life0 self,
        base_path: Url,
        params: &'life1 ObjectStoreParams,
    ) -> Pin<Box<dyn Future<Output = Result<ObjectStore>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn extract_path(&self, url: &Url) -> Result<Path> { ... }
    fn cache_url(&self, url: &Url) -> String { ... }
}

Required Methods§

Source

fn new_store<'life0, 'life1, 'async_trait>( &'life0 self, base_path: Url, params: &'life1 ObjectStoreParams, ) -> Pin<Box<dyn Future<Output = Result<ObjectStore>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn extract_path(&self, url: &Url) -> Result<Path>

Extract the path relative to the base of the store.

For example, in S3 the path is relative to the bucket. So a URL of s3://bucket/path/to/file would return path/to/file.

Meanwhile, for a file store, the path is relative to the filesystem root. So a URL of file:///path/to/file would return /path/to/file.

Source

fn cache_url(&self, url: &Url) -> String

Generate a cache URL for this provider.

Providers can override this to implement custom cache key generation that takes into account provider-specific requirements like namespace isolation.

Implementors§