StorageService

Struct StorageService 

Source
pub struct StorageService { /* private fields */ }
Expand description

Represents an implementation of StorageService for Amazon Simple Storage Service.

Implementations§

Source§

impl StorageService

Source

pub fn new(config: StorageConfig) -> StorageService

Creates a StorageService with a given storage service configuration.

Source

pub fn with_sdk_conf<I: Into<Config>>(config: I) -> StorageService

Creates a new StorageService with a implementator of Config that can represent the AWS SDK S3 configuration that you want.

Source

pub fn with_config(self, config: StorageConfig) -> StorageService

Overwrites a StorageConfig instance on this service without modifying the actual SDK client. This is useful if you used the StorageService::with_sdk_conf method.

If you wish to modify the SDK client with a StorageConfig, then use the StorageService::new method instead.

Trait Implementations§

Source§

impl Clone for StorageService

Source§

fn clone(&self) -> StorageService

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StorageService

Source§

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

Formats the value using the given formatter. Read more
Source§

impl StorageService for StorageService

Source§

type Error = Error

Represents a generic error to use for errors that could be emitted when calling any function.
Source§

fn name(&self) -> Cow<'static, str>

Returns the name of the storage service. Read more
Source§

fn init<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Optionally initialize this StorageService if it requires initialization, like creating a directory if it doesn’t exist. Read more
Source§

fn open<'life0, 'async_trait, P>( &'life0 self, path: P, ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Opens a file in the specified path and returns the contents as Bytes if it existed, otherwise None will be returned to indicate that file doesn’t exist. Read more
Source§

fn blob<'life0, 'async_trait, P>( &'life0 self, path: P, ) -> Pin<Box<dyn Future<Output = Result<Option<Blob>>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Open a file in the given path and returns a Blob structure if the path existed, otherwise None will be returned to indiciate that a file doesn’t exist. Read more
Source§

fn blobs<'life0, 'async_trait, P>( &'life0 self, path: Option<P>, options: Option<ListBlobsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Blob>>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Iterate over a list of files from a storage service and returns a Vec of Blobs. Read more
Source§

fn delete<'life0, 'async_trait, P>( &'life0 self, path: P, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Deletes a file in a specified path. At the moment, () is returned but bool might be returned to indicate if it actually deleted itself or not. Read more
Source§

fn exists<'life0, 'async_trait, P>( &'life0 self, path: P, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Checks the existence of the file by the specified path. Read more
Source§

fn upload<'life0, 'async_trait, P>( &'life0 self, path: P, options: UploadRequest, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Does a file upload where it writes the byte array as one call and does not do chunking. Read more
Source§

fn healthcheck<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Performs any healthchecks to determine the storage service’s health.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T