pub struct AzureBlobClient {
container_client: ContainerClient,
pub container_name: String,
}
Expand description
A client for interacting with Azure Blob Storage.
Fields§
§container_client: ContainerClient
§container_name: String
Implementations§
Source§impl AzureBlobClient
impl AzureBlobClient
pub async fn new( app_config: &ApplicationConfiguration, container_name_prefix: &str, ) -> Result<Self>
Sourcepub async fn ensure_container_exists(&self) -> Result<()>
pub async fn ensure_container_exists(&self) -> Result<()>
Ensures the container used to store the blobs exists. If it does not, the container is created.
Sourcepub async fn upload_file(
&self,
blob_path: &str,
file_bytes: &[u8],
metadata: Option<HashMap<String, Bytes>>,
) -> Result<()>
pub async fn upload_file( &self, blob_path: &str, file_bytes: &[u8], metadata: Option<HashMap<String, Bytes>>, ) -> Result<()>
Uploads a file to the specified container.
Sourcepub async fn delete_file(&self, path: &str) -> Result<()>
pub async fn delete_file(&self, path: &str) -> Result<()>
Deletes a file (blob) from the specified container.
pub async fn list_files_with_prefix(&self, prefix: &str) -> Result<Vec<String>>
Auto Trait Implementations§
impl Freeze for AzureBlobClient
impl !RefUnwindSafe for AzureBlobClient
impl Send for AzureBlobClient
impl Sync for AzureBlobClient
impl Unpin for AzureBlobClient
impl !UnwindSafe for AzureBlobClient
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> 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 more