pub struct AzureBlobStorage { /* private fields */ }Available on crate features
storage-azure or storage-gcs or storage-local or storage-s3 only.Expand description
Azure Blob Storage object storage.
Signs every request with the Shared Key HMAC-SHA256 scheme using the
outbound HTTP client (crate::http_client::Client) — no Azure SDK
dependency. Credentials come from config.account_key when non-empty;
otherwise they’re auto-detected from Managed Identity (App
Service/Container Apps identity endpoint, or VM/AKS IMDS as a last
resort), cached, and refreshed shortly before expiry. See
crate::storage::azure_credentials and crate::storage::azure_signature.
Implementations§
Source§impl AzureBlobStorage
impl AzureBlobStorage
pub fn new(config: AzureBlobConfig) -> AzureBlobStorage
Sourcepub fn from_env() -> Result<AzureBlobStorage, StorageError>
pub fn from_env() -> Result<AzureBlobStorage, StorageError>
Shortcut for AzureBlobStorage::new(AzureBlobConfig::from_env()?).
Trait Implementations§
Source§impl Storage for AzureBlobStorage
impl Storage for AzureBlobStorage
Source§fn put(
&self,
key: &str,
data: &[u8],
content_type: &str,
) -> Result<String, StorageError>
fn put( &self, key: &str, data: &[u8], content_type: &str, ) -> Result<String, StorageError>
Store
data under key, overwriting any existing object at that key.
Returns the key that was stored (backends that normalize or namespace
keys may return a different string than the one passed in).Source§fn get(&self, key: &str) -> Result<Vec<u8>, StorageError>
fn get(&self, key: &str) -> Result<Vec<u8>, StorageError>
Retrieve the bytes stored under
key.Source§fn delete(&self, key: &str) -> Result<(), StorageError>
fn delete(&self, key: &str) -> Result<(), StorageError>
Delete the object stored under
key. Backends generally treat
deleting a missing key as a no-op success, matching S3’s semantics.Source§fn url(&self, key: &str) -> String
fn url(&self, key: &str) -> String
A URL for retrieving
key. For LocalStorage this is only
meaningful if a base URL was configured (e.g. because the directory
is also served as static files); for S3Storage it’s the object’s
HTTPS URL. This performs no I/O and never fails.Source§fn put_stream(
&self,
key: &str,
reader: &mut dyn Read,
content_type: &str,
) -> Result<String, StorageError>
fn put_stream( &self, key: &str, reader: &mut dyn Read, content_type: &str, ) -> Result<String, StorageError>
Store everything
reader yields under key — for a body too large
to hold in memory, e.g. a streamed upload (Request::body read as a
stream, #31). LocalStorage writes as it reads and S3Storage
uploads in parts (S3 multipart upload), so memory stays at one part;
the default reads everything first and calls Storage::put.Auto Trait Implementations§
impl !Freeze for AzureBlobStorage
impl RefUnwindSafe for AzureBlobStorage
impl Send for AzureBlobStorage
impl Sync for AzureBlobStorage
impl Unpin for AzureBlobStorage
impl UnsafeUnpin for AzureBlobStorage
impl UnwindSafe for AzureBlobStorage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more