pub struct StorageOptions(pub HashMap<String, String>);Tuple Fields§
§0: HashMap<String, String>Implementations§
Source§impl StorageOptions
impl StorageOptions
Sourcepub fn with_env_s3(&mut self)
pub fn with_env_s3(&mut self)
Add values from the environment to storage options.
Explicitly-set options (including aliases, case variants, and empty-string sentinels) always take precedence over env vars.
Sourcepub fn as_s3_options(&self) -> HashMap<AmazonS3ConfigKey, String>
pub fn as_s3_options(&self) -> HashMap<AmazonS3ConfigKey, String>
Return options recognized by AmazonS3ConfigKey, ignoring unknown keys.
When aliases conflict, the exact canonical name (such as aws_region)
wins, followed by case variants of that name. Remaining ties use the
lexicographically smallest original key. Empty values are preserved.
use std::collections::HashMap;
use lance_io::object_store::StorageOptions;
use object_store::aws::AmazonS3ConfigKey;
let options = StorageOptions(HashMap::from([
("region".into(), "us-east-1".into()),
("aws_region".into(), "eu-west-1".into()),
]));
assert_eq!(options.as_s3_options()[&AmazonS3ConfigKey::Region], "eu-west-1");Sourcepub fn aws_provider_scheme(&self) -> Result<Option<AwsProviderScheme>>
pub fn aws_provider_scheme(&self) -> Result<Option<AwsProviderScheme>>
Parse the aws_provider_scheme storage option, if set.
Source§impl StorageOptions
impl StorageOptions
Sourcepub fn with_env_azure(&mut self)
pub fn with_env_azure(&mut self)
Add values from the environment without overriding explicit options, including aliases, case variants, and empty-string values.
Sourcepub fn as_azure_options(&self) -> HashMap<AzureConfigKey, String>
pub fn as_azure_options(&self) -> HashMap<AzureConfigKey, String>
Return options recognized by AzureConfigKey, ignoring unknown keys.
When aliases conflict, the exact canonical name (such as
azure_storage_account_name) wins, followed by case variants of that name.
Remaining ties use the lexicographically smallest original key. Empty
values are preserved.
use std::collections::HashMap;
use lance_io::object_store::StorageOptions;
use object_store::azure::AzureConfigKey;
let options = StorageOptions(HashMap::from([
("account_name".into(), "alias".into()),
("azure_storage_account_name".into(), "canonical".into()),
]));
assert_eq!(options.as_azure_options()[&AzureConfigKey::AccountName], "canonical");Source§impl StorageOptions
impl StorageOptions
Sourcepub fn with_env_gcs(&mut self)
pub fn with_env_gcs(&mut self)
Add values from the environment without overriding explicit options, including aliases, case variants, and empty-string values.
Sourcepub fn as_gcs_options(&self) -> HashMap<GoogleConfigKey, String>
pub fn as_gcs_options(&self) -> HashMap<GoogleConfigKey, String>
Return options recognized by GoogleConfigKey, ignoring unknown keys.
When aliases conflict, the exact canonical name (such as
google_service_account) wins, followed by case variants of that name.
Remaining ties use the lexicographically smallest original key. Empty
values are preserved.
use std::collections::HashMap;
use lance_io::object_store::StorageOptions;
use object_store::gcp::GoogleConfigKey;
let options = StorageOptions(HashMap::from([
("service_account".into(), "alias.json".into()),
("google_service_account".into(), "canonical.json".into()),
]));
assert_eq!(options.as_gcs_options()[&GoogleConfigKey::ServiceAccount], "canonical.json");Source§impl StorageOptions
impl StorageOptions
Sourcepub fn allow_http(&self) -> bool
pub fn allow_http(&self) -> bool
Denotes if unsecure connections via http are allowed
Sourcepub fn block_size(&self) -> Result<Option<usize>>
pub fn block_size(&self) -> Result<Option<usize>>
Byte gap below which the I/O scheduler merges two reads of one file into a single request, overriding the store’s default.
Sourcepub fn download_retry_count(&self) -> usize
pub fn download_retry_count(&self) -> usize
Number of times to retry a download that fails
Sourcepub fn client_max_retries(&self) -> usize
pub fn client_max_retries(&self) -> usize
Max retry times to set in RetryConfig for object store client
Sourcepub fn client_retry_timeout(&self) -> u64
pub fn client_retry_timeout(&self) -> u64
Seconds of timeout to set in RetryConfig for object store client
pub fn get(&self, key: &str) -> Option<&String>
Sourcepub fn client_options(&self) -> Result<ClientOptions>
pub fn client_options(&self) -> Result<ClientOptions>
Build ClientOptions with default headers extracted from headers.* keys.
Keys prefixed with headers. are parsed into HTTP headers. For example,
headers.x-ms-version = 2023-11-03 results in a default header
x-ms-version: 2023-11-03.
Returns an error if any headers.* key has an invalid header name or value.
Sourcepub fn expires_at_millis(&self) -> Option<u64>
pub fn expires_at_millis(&self) -> Option<u64>
Get the expiration time in milliseconds since epoch, if present
Trait Implementations§
Source§impl Clone for StorageOptions
impl Clone for StorageOptions
Source§impl Debug for StorageOptions
impl Debug for StorageOptions
Source§impl Default for StorageOptions
impl Default for StorageOptions
Auto Trait Implementations§
impl Freeze for StorageOptions
impl RefUnwindSafe for StorageOptions
impl Send for StorageOptions
impl Sync for StorageOptions
impl Unpin for StorageOptions
impl UnsafeUnpin for StorageOptions
impl UnwindSafe for StorageOptions
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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