pub struct CloudStorageConfig {
pub storage_type: StorageType,
pub bucket: String,
pub region: Option<String>,
pub base_path: String,
pub endpoint: Option<String>,
pub access_key_id: Option<String>,
pub secret_access_key: Option<String>,
pub session_token: Option<String>,
}Expand description
Configuration for any storage backend.
Pure data: no I/O, no policy decisions. Embedders construct this to describe “use this storage backend” via the stable contract surface.
Fields§
§storage_type: StorageTypeStorage type (file, s3, gcs, azure)
bucket: StringBucket/container name
region: Option<String>Region for S3, project ID for GCS
base_path: StringBase path within the bucket
endpoint: Option<String>Custom endpoint (for S3-compatible services like MinIO, DigitalOcean Spaces)
access_key_id: Option<String>Access key ID
secret_access_key: Option<String>Secret access key
session_token: Option<String>Session token (for temporary credentials)
Implementations§
Source§impl CloudStorageConfig
impl CloudStorageConfig
Sourcepub fn new(storage_type: StorageType, bucket: impl Into<String>) -> Self
pub fn new(storage_type: StorageType, bucket: impl Into<String>) -> Self
Create a new CloudStorageConfig with the given bucket
Sourcepub fn with_region(self, region: impl Into<String>) -> Self
pub fn with_region(self, region: impl Into<String>) -> Self
Set the region
Sourcepub fn with_base_path(self, path: impl Into<String>) -> Self
pub fn with_base_path(self, path: impl Into<String>) -> Self
Set the base path
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
Set custom endpoint (for S3-compatible services)
Sourcepub fn with_credentials(
self,
access_key_id: impl Into<String>,
secret_access_key: impl Into<String>,
) -> Self
pub fn with_credentials( self, access_key_id: impl Into<String>, secret_access_key: impl Into<String>, ) -> Self
Set credentials
Sourcepub fn with_session_token(self, token: impl Into<String>) -> Self
pub fn with_session_token(self, token: impl Into<String>) -> Self
Set session token
Sourcepub fn validate(&self) -> Result<(), ValidateStorageConfigError>
pub fn validate(&self) -> Result<(), ValidateStorageConfigError>
Validate the configuration
Trait Implementations§
Source§impl Clone for CloudStorageConfig
impl Clone for CloudStorageConfig
Source§fn clone(&self) -> CloudStorageConfig
fn clone(&self) -> CloudStorageConfig
Returns a duplicate 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 CloudStorageConfig
impl Debug for CloudStorageConfig
Source§impl Default for CloudStorageConfig
impl Default for CloudStorageConfig
Source§impl<'de> Deserialize<'de> for CloudStorageConfig
impl<'de> Deserialize<'de> for CloudStorageConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CloudStorageConfig
impl RefUnwindSafe for CloudStorageConfig
impl Send for CloudStorageConfig
impl Sync for CloudStorageConfig
impl Unpin for CloudStorageConfig
impl UnsafeUnpin for CloudStorageConfig
impl UnwindSafe for CloudStorageConfig
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