pub struct S3ClientManager { /* private fields */ }Expand description
S3 Client Manager - creates and caches S3 clients per profile and region
Implementations§
Source§impl S3ClientManager
impl S3ClientManager
pub fn new() -> Self
Sourcepub async fn get_client(&mut self, profile: &Profile) -> Result<&Client>
pub async fn get_client(&mut self, profile: &Profile) -> Result<&Client>
Get or create an S3 client for the given profile’s default region
Sourcepub async fn get_client_for_region(
&mut self,
profile: &Profile,
region: &str,
) -> Result<&Client>
pub async fn get_client_for_region( &mut self, profile: &Profile, region: &str, ) -> Result<&Client>
Get or create an S3 client for the given profile and specific region
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear cached clients, sorted folder results, and discovered regions.
Sourcepub fn get_bucket_region(
&self,
profile: &Profile,
bucket_name: &str,
) -> Option<String>
pub fn get_bucket_region( &self, profile: &Profile, bucket_name: &str, ) -> Option<String>
Get cached region for a bucket
Sourcepub fn set_bucket_region(
&mut self,
profile: &Profile,
bucket_name: &str,
region: String,
)
pub fn set_bucket_region( &mut self, profile: &Profile, bucket_name: &str, region: String, )
Cache the region for a bucket
Sourcepub fn set_bucket_regions<I>(
&mut self,
profile: &Profile,
bucket_names: I,
region: &str,
)
pub fn set_bucket_regions<I>( &mut self, profile: &Profile, bucket_names: I, region: &str, )
Cache the same region for a set of buckets.
pub fn get_sorted_folder_content( &self, profile_id: &str, bucket_name: &str, prefix: &str, sort_field: &str, sort_direction: &str, ) -> Option<&FolderContent>
pub fn set_sorted_folder_content( &mut self, profile_id: &str, bucket_name: &str, prefix: &str, sort_field: &str, sort_direction: &str, content: FolderContent, )
Sourcepub fn remove_bucket_cache(&mut self, profile_id: &str, bucket_name: &str)
pub fn remove_bucket_cache(&mut self, profile_id: &str, bucket_name: &str)
Remove cached sorted results for a specific profile and bucket.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for S3ClientManager
impl !UnwindSafe for S3ClientManager
impl Forget for S3ClientManager
impl Freeze for S3ClientManager
impl Move for S3ClientManager
impl Send for S3ClientManager
impl Sync for S3ClientManager
impl Unpin for S3ClientManager
impl UnsafeUnpin for S3ClientManager
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreCreates a shared type from an unshared type.