pub struct StorageSectionConfig {
pub backend: String,
pub path: Option<String>,
pub bucket: Option<String>,
pub region: Option<String>,
pub endpoint: Option<String>,
pub project_id: Option<String>,
pub account_name: Option<String>,
pub access: Option<String>,
pub max_object_bytes: Option<u64>,
pub allowed_mime_types: Option<Vec<String>>,
pub serve_inline: Option<bool>,
}Expand description
A single [storage.<name>] configuration section.
Combines the storage backend connection settings (mapped to
fraiseql_storage::config::StorageConfig and passed to
fraiseql_storage::create_backend) with the optional logical-bucket access
policy (mapped to fraiseql_storage::config::BucketConfig). The section name
becomes the logical bucket name in the URL path.
The connection fields mirror fraiseql_storage::config::StorageConfig; the
policy fields (access, max_object_bytes, allowed_mime_types,
serve_inline) are optional and default to a private, force-download bucket.
Fields§
§backend: StringBackend type: "local", "s3" (and S3-compatible providers "hetzner",
"scaleway", "ovh", "exoscale", "backblaze", "r2"), "gcs",
"azure". Non-local backends require the matching Cargo feature
(aws-s3, gcs, azure-blob) to be compiled in.
path: Option<String>Filesystem path for the local backend.
bucket: Option<String>Physical bucket name for S3/GCS/Azure backends.
region: Option<String>Region for S3-compatible backends.
endpoint: Option<String>Custom endpoint URL for S3-compatible services and cloud emulators.
project_id: Option<String>GCP project ID for the GCS backend.
account_name: Option<String>Azure storage account name.
access: Option<String>Access policy for the logical bucket: "private" (default) or
"public_read". An unrecognised value is a startup error.
max_object_bytes: Option<u64>Maximum object size in bytes for the logical bucket (None = unlimited, subject to the route-wide body limit).
allowed_mime_types: Option<Vec<String>>Allowed MIME types for uploads (None = any). Supports image/*-style
wildcards.
serve_inline: Option<bool>Serve downloads with Content-Disposition: inline instead of the default
attachment. Active-content types (text/html, image/svg+xml, …) are
always served as attachment regardless of this flag.
Trait Implementations§
Source§impl Clone for StorageSectionConfig
impl Clone for StorageSectionConfig
Source§fn clone(&self) -> StorageSectionConfig
fn clone(&self) -> StorageSectionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StorageSectionConfig
impl Debug for StorageSectionConfig
Source§impl<'de> Deserialize<'de> for StorageSectionConfig
impl<'de> Deserialize<'de> for StorageSectionConfig
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>,
Auto Trait Implementations§
impl Freeze for StorageSectionConfig
impl RefUnwindSafe for StorageSectionConfig
impl Send for StorageSectionConfig
impl Sync for StorageSectionConfig
impl Unpin for StorageSectionConfig
impl UnsafeUnpin for StorageSectionConfig
impl UnwindSafe for StorageSectionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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