pub struct StorageLocationUrl { /* private fields */ }Expand description
A URL representing a storage location.
This struct provides a cerntalized place to parse various URLs into more specific service references along with the semantic information that can be extracted from the URL.
Implementations§
Source§impl StorageLocationUrl
impl StorageLocationUrl
pub fn try_new(url: Url) -> Result<Self>
pub fn parse(url: impl AsRef<str>) -> Result<Self>
pub fn raw(&self) -> &Url
pub fn location(&self) -> &Url
pub fn store_url(&self) -> &Url
pub fn scheme(&self) -> &StorageLocationScheme
Sourcepub fn bucket_and_prefix(&self) -> Result<(String, String)>
pub fn bucket_and_prefix(&self) -> Result<(String, String)>
Returns (bucket_or_container, object_prefix) extracted from the URL.
- S3:
s3://bucket/prefix/path→("bucket", "prefix/path") - Azure HTTPS:
https://account.blob.core.windows.net/container/path→("container", "path") - Azurite HTTP:
http://localhost:10000/account/container/path→("container", "path") - Azurite custom scheme:
azurite://container/path→("container", "path")
Sourcepub fn azure_account(&self) -> Option<String>
pub fn azure_account(&self) -> Option<String>
Returns the Azure storage account name parsed from the URL, if present.
- HTTPS:
https://account.blob.core.windows.net/…→Some("account") - ABFSS:
abfss://container@account.dfs.core.windows.net/…→Some("account") - Azurite HTTP:
http://localhost:10000/account/container/path→Some("account") - Azurite custom:
azurite://container/path→None(no account concept)
Auto Trait Implementations§
impl Freeze for StorageLocationUrl
impl RefUnwindSafe for StorageLocationUrl
impl Send for StorageLocationUrl
impl Sync for StorageLocationUrl
impl Unpin for StorageLocationUrl
impl UnsafeUnpin for StorageLocationUrl
impl UnwindSafe for StorageLocationUrl
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> 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