pub struct StorageConfig {
pub storage_type: Option<String>,
pub endpoint: Option<String>,
pub bucket: Option<String>,
pub region: Option<String>,
pub url_prefix: Option<String>,
pub access_key_id: Option<String>,
pub secret_access_key: Option<String>,
}Expand description
Storage configuration for external asset storage Per [[RFC-0004:C-STORAGE-CONFIG]]
Fields§
§storage_type: Option<String>Storage type (e.g., “s3”)
endpoint: Option<String>S3-compatible endpoint URL (optional)
bucket: Option<String>Bucket name
region: Option<String>Region (e.g., “us-east-1”, “auto” for R2)
url_prefix: Option<String>URL prefix for constructing public asset URLs
access_key_id: Option<String>Access key ID (or use S3_ACCESS_KEY_ID env var)
secret_access_key: Option<String>Secret access key (or use S3_SECRET_ACCESS_KEY env var)
Implementations§
Source§impl StorageConfig
impl StorageConfig
Sourcepub fn resolve(
global: Option<&StorageConfig>,
platform: Option<&StorageConfig>,
platform_id: &str,
) -> StorageConfig
pub fn resolve( global: Option<&StorageConfig>, platform: Option<&StorageConfig>, platform_id: &str, ) -> StorageConfig
Merge global and platform-specific config with env var precedence Per [[RFC-0004:C-STORAGE-CONFIG]] precedence ladder
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate required fields are present Per [[RFC-0004:C-STORAGE-CONFIG]]
Sourcepub fn config_id(&self) -> String
pub fn config_id(&self) -> String
Compute storage configuration identifier (64-char SHA-256 hex) Per [[RFC-0004:C-STORAGE-CONFIG]] Excludes credentials, includes all other fields with normalization.
Sourcepub fn normalized_url_prefix(&self) -> Option<String>
pub fn normalized_url_prefix(&self) -> Option<String>
Get normalized URL prefix (trailing slashes removed)
Trait Implementations§
Source§impl Clone for StorageConfig
impl Clone for StorageConfig
Source§fn clone(&self) -> StorageConfig
fn clone(&self) -> StorageConfig
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 StorageConfig
impl Debug for StorageConfig
Source§impl Default for StorageConfig
impl Default for StorageConfig
Source§fn default() -> StorageConfig
fn default() -> StorageConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StorageConfig
impl<'de> Deserialize<'de> for StorageConfig
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 StorageConfig
impl RefUnwindSafe for StorageConfig
impl Send for StorageConfig
impl Sync for StorageConfig
impl Unpin for StorageConfig
impl UnsafeUnpin for StorageConfig
impl UnwindSafe for StorageConfig
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