Enum object_store::ObjectStoreScheme
source · #[non_exhaustive]pub enum ObjectStoreScheme {
Local,
Memory,
AmazonS3,
GoogleCloudStorage,
MicrosoftAzure,
Http,
}
Expand description
Recognizes various URL formats, identifying the relevant ObjectStore
See ObjectStoreScheme::parse
for more details
§Supported formats:
file:///path/to/my/file
->LocalFileSystem
memory:///
->InMemory
s3://bucket/path
->AmazonS3
(also supportss3a
)gs://bucket/path
->GoogleCloudStorage
az://account/container/path
->MicrosoftAzure
(also supportsadl
,azure
,abfs
,abfss
)http://mydomain/path
->HttpStore
https://mydomain/path
->HttpStore
There are also special cases for AWS and Azure for https://{host?}/path
paths:
dfs.core.windows.net
,blob.core.windows.net
,dfs.fabric.microsoft.com
,blob.fabric.microsoft.com
->MicrosoftAzure
amazonaws.com
->AmazonS3
r2.cloudflarestorage.com
->AmazonS3
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Local
Url corresponding to LocalFileSystem
Memory
Url corresponding to InMemory
AmazonS3
Url corresponding to AmazonS3
GoogleCloudStorage
Url corresponding to GoogleCloudStorage
MicrosoftAzure
Url corresponding to MicrosoftAzure
Http
Url corresponding to HttpStore
Implementations§
source§impl ObjectStoreScheme
impl ObjectStoreScheme
sourcepub fn parse(url: &Url) -> Result<(Self, Path), Error>
pub fn parse(url: &Url) -> Result<(Self, Path), Error>
Create an ObjectStoreScheme
from the provided Url
Returns the ObjectStoreScheme
and the remaining Path
§Example
let url: Url = "file:///path/to/my/file".parse().unwrap();
let (scheme, path) = ObjectStoreScheme::parse(&url).unwrap();
assert_eq!(scheme, ObjectStoreScheme::Local);
assert_eq!(path.as_ref(), "path/to/my/file");
let url: Url = "https://blob.core.windows.net/path/to/my/file".parse().unwrap();
let (scheme, path) = ObjectStoreScheme::parse(&url).unwrap();
assert_eq!(scheme, ObjectStoreScheme::MicrosoftAzure);
assert_eq!(path.as_ref(), "path/to/my/file");
let url: Url = "https://example.com/path/to/my/file".parse().unwrap();
let (scheme, path) = ObjectStoreScheme::parse(&url).unwrap();
assert_eq!(scheme, ObjectStoreScheme::Http);
assert_eq!(path.as_ref(), "path/to/my/file");
Trait Implementations§
source§impl Clone for ObjectStoreScheme
impl Clone for ObjectStoreScheme
source§fn clone(&self) -> ObjectStoreScheme
fn clone(&self) -> ObjectStoreScheme
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 moresource§impl Debug for ObjectStoreScheme
impl Debug for ObjectStoreScheme
source§impl PartialEq for ObjectStoreScheme
impl PartialEq for ObjectStoreScheme
impl Eq for ObjectStoreScheme
impl StructuralPartialEq for ObjectStoreScheme
Auto Trait Implementations§
impl Freeze for ObjectStoreScheme
impl RefUnwindSafe for ObjectStoreScheme
impl Send for ObjectStoreScheme
impl Sync for ObjectStoreScheme
impl Unpin for ObjectStoreScheme
impl UnwindSafe for ObjectStoreScheme
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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