pub struct StorageClient { /* private fields */ }
Implementations§
source§impl StorageClient
impl StorageClient
pub async fn new( __arg0: StorageConfig, config_values: &HashMap<String, String>, ) -> Self
sourcepub fn unalias<'n, 's: 'n>(&'s self, bucket_or_alias: &'n str) -> &'n str
pub fn unalias<'n, 's: 'n>(&'s self, bucket_or_alias: &'n str) -> &'n str
perform alias lookup on bucket name This can be used either for giving shortcuts to actors in the linkdefs, for example:
- component could use bucket names
alias_today
,alias_images
, etc. and the linkdef aliases will remap them to the real bucket name
The 'alias_'
prefix is not required, so this also works as a general redirect capability
sourcepub async fn container_exists(&self, bucket: &str) -> Result<bool>
pub async fn container_exists(&self, bucket: &str) -> Result<bool>
Check whether a container exists
sourcepub async fn create_container(&self, bucket: &str) -> Result<()>
pub async fn create_container(&self, bucket: &str) -> Result<()>
Create a bucket
pub async fn get_container_info( &self, bucket: &str, ) -> Result<ContainerMetadata>
pub async fn list_container_objects( &self, bucket: &str, limit: Option<u64>, offset: Option<u64>, ) -> Result<impl Iterator<Item = String>>
pub async fn copy_object( &self, src_bucket: &str, src_key: &str, dest_bucket: &str, dest_key: &str, ) -> Result<()>
pub async fn delete_object(&self, container: &str, object: String) -> Result<()>
pub async fn delete_objects( &self, container: &str, objects: impl IntoIterator<Item = String>, ) -> Result<()>
pub async fn delete_container(&self, bucket: &str) -> Result<()>
sourcepub async fn has_object(&self, bucket: &str, key: &str) -> Result<bool>
pub async fn has_object(&self, bucket: &str, key: &str) -> Result<bool>
Find out whether object exists
sourcepub async fn get_object_info(
&self,
bucket: &str,
key: &str,
) -> Result<ObjectMetadata>
pub async fn get_object_info( &self, bucket: &str, key: &str, ) -> Result<ObjectMetadata>
Retrieves metadata about the object
Trait Implementations§
source§impl Clone for StorageClient
impl Clone for StorageClient
source§fn clone(&self) -> StorageClient
fn clone(&self) -> StorageClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for StorageClient
impl !RefUnwindSafe for StorageClient
impl Send for StorageClient
impl Sync for StorageClient
impl Unpin for StorageClient
impl !UnwindSafe for StorageClient
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Creates a shared type from an unshared type.