pub struct Config {Show 15 fields
pub server: ServerConfig,
pub data: HashMap<String, DataSource>,
pub cache: CacheConfig,
pub session: SessionConfig,
pub auth: AuthConfig,
pub uploads: UploadConfig,
pub database: Option<DatabaseConfig>,
pub rate_limit: RateLimitConfig,
pub email: Option<EmailConfig>,
pub redirects: HashMap<String, String>,
pub strict: bool,
pub cloudflare: Option<CloudflareConfig>,
pub supabase: Option<SupabaseConfig>,
pub datasources: HashMap<String, DatasourceConfig>,
pub collections: HashMap<String, CollectionPolicyConfig>,
}Expand description
Main configuration structure parsed from what.toml
Fields§
§server: ServerConfigServer configuration
data: HashMap<String, DataSource>Central data store definitions
cache: CacheConfigCache configuration
session: SessionConfigSession configuration
auth: AuthConfigAuthentication configuration
uploads: UploadConfigUpload configuration
database: Option<DatabaseConfig>Database configuration (when absent, auto-defaults to SQLite)
rate_limit: RateLimitConfigRate limiting configuration
email: Option<EmailConfig>Email configuration
redirects: HashMap<String, String>Global redirect rules: old path → new path Supports exact matches and wildcard prefixes (“/old/*” → “/new”)
strict: boolStrict mode: warn about unresolved template variables
cloudflare: Option<CloudflareConfig>Cloudflare configuration (shared credentials for D1, R2, Turnstile)
supabase: Option<SupabaseConfig>Supabase configuration
datasources: HashMap<String, DatasourceConfig>Named datasources — multiple backends accessible via dsn:name in fetch directives
collections: HashMap<String, CollectionPolicyConfig>Collection authorization policies — one entry per [collections.<name>].
Collections without an entry get the implicit owner-protected default:
create = “all”, update/delete = “owner”, read = “all”, owner = “auto”.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self>
pub fn load(path: impl AsRef<Path>) -> Result<Self>
Load configuration from a what.toml file.
Unknown keys are warned about instead of silently dropped — a typo
like prt = 3000 otherwise falls back to the default port with no
symptom at all — but never fail the load (forward compatibility).
Sourcepub fn load_from_current_dir() -> Result<Self>
pub fn load_from_current_dir() -> Result<Self>
Load configuration from the current directory
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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