#[non_exhaustive]pub struct StorageConfig {
pub disk: DiskDriver,
pub bucket: Option<String>,
pub region: Option<String>,
pub endpoint: Option<String>,
pub access_key_id: Option<String>,
pub secret_access_key: Option<String>,
pub url: Option<String>,
pub root: Option<PathBuf>,
}Expand description
Settings for state.storage, from STORAGE_DISK and S3_*.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.disk: DiskDriverA local folder or an S3 bucket.
bucket: Option<String>The S3 bucket, from S3_BUCKET.
region: Option<String>The S3 region, from S3_REGION.
endpoint: Option<String>An S3-compatible endpoint, from S3_ENDPOINT (AWS when unset).
access_key_id: Option<String>The S3 access key id, from S3_ACCESS_KEY_ID.
secret_access_key: Option<String>The S3 secret key, from S3_SECRET_ACCESS_KEY.
url: Option<String>Public base URL for keys under public/ (bucket URL or CDN), for S3.
root: Option<PathBuf>Where a local disk keeps its files. None: STORAGE_PATH/app for
state.storage, STORAGE_PATH/<name> for a named disk.
Implementations§
Source§impl StorageConfig
impl StorageConfig
Sourcepub fn from_env(config: &Config, prefix: &str) -> Result<Self>
pub fn from_env(config: &Config, prefix: &str) -> Result<Self>
A disk’s settings from variables starting with prefix, for
App::disk: <PREFIX>_DISK (local or s3,
default local), <PREFIX>_PATH (a local disk’s folder),
<PREFIX>_BUCKET, <PREFIX>_URL, and <PREFIX>_REGION,
<PREFIX>_ENDPOINT, <PREFIX>_ACCESS_KEY_ID,
<PREFIX>_SECRET_ACCESS_KEY, which fall back to the S3_* ones.
Trait Implementations§
Source§impl Clone for StorageConfig
impl Clone for StorageConfig
Source§impl Debug for StorageConfig
impl Debug for StorageConfig
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
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,
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