pub enum AnyStorage {
Local(LocalStorage),
S3(Box<S3Storage>),
}Expand description
Build the configured driver.
Returns an enum rather than a boxed trait object: Storage uses async fn,
which is not dyn-safe, and two drivers do not justify the machinery that
would make it so.
Variants§
Local(LocalStorage)
S3(Box<S3Storage>)
Implementations§
Source§impl AnyStorage
impl AnyStorage
pub fn from_config(config: &Config, root: &Path) -> Result<AnyStorage>
Trait Implementations§
Source§impl Storage for AnyStorage
impl Storage for AnyStorage
async fn put(&self, path: &str, contents: Vec<u8>) -> Result<()>
async fn put_with( &self, path: &str, contents: Vec<u8>, visibility: Visibility, ) -> Result<()>
async fn get(&self, path: &str) -> Result<Vec<u8>>
async fn exists(&self, path: &str) -> Result<bool>
async fn delete(&self, path: &str) -> Result<()>
async fn size(&self, path: &str) -> Result<u64>
Auto Trait Implementations§
impl !RefUnwindSafe for AnyStorage
impl !UnwindSafe for AnyStorage
impl Freeze for AnyStorage
impl Send for AnyStorage
impl Sync for AnyStorage
impl Unpin for AnyStorage
impl UnsafeUnpin for AnyStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more