pub struct RuntimeConfig {Show 20 fields
pub server: HttpServerConfig,
pub database: DatabaseConfig,
pub webhooks: HashMap<String, WebhookRouteConfig>,
pub files: HashMap<String, FileConfig>,
pub auth: Option<AuthConfig>,
pub notifications: Option<NotificationsConfig>,
pub observers: HashMap<String, ObserverConfig>,
pub interceptors: HashMap<String, Vec<String>>,
pub rate_limiting: Option<RateLimitingConfig>,
pub cors: Option<CorsConfig>,
pub metrics: Option<MetricsConfig>,
pub tracing: Option<TracingConfig>,
pub logging: Option<LoggingConfig>,
pub storage: HashMap<String, StorageConfig>,
pub search: Option<SearchConfig>,
pub cache: Option<CacheConfig>,
pub queues: Option<QueueConfig>,
pub realtime: Option<RealtimeConfig>,
pub custom_endpoints: Option<CustomEndpointsConfig>,
pub lifecycle: Option<LifecycleConfig>,
}Expand description
Root configuration structure loaded from fraiseql.toml.
Fields§
§server: HttpServerConfigHTTP server binding, TLS, and connection-limit settings.
database: DatabaseConfigPrimary database connection and pool settings.
webhooks: HashMap<String, WebhookRouteConfig>Named webhook route configurations, keyed by route name.
files: HashMap<String, FileConfig>Named file-upload route configurations, keyed by route name.
auth: Option<AuthConfig>Optional JWT authentication and OAuth provider configuration.
notifications: Option<NotificationsConfig>Reserved: placeholder for future notification system configuration.
observers: HashMap<String, ObserverConfig>Event observer configurations, keyed by observer name.
interceptors: HashMap<String, Vec<String>>Request interceptor chains, keyed by interceptor name.
rate_limiting: Option<RateLimitingConfig>Optional rate-limiting rules and backpressure thresholds.
cors: Option<CorsConfig>Optional CORS origin and header policy.
metrics: Option<MetricsConfig>Optional Prometheus metrics and SLO tracking configuration.
tracing: Option<TracingConfig>Optional distributed-tracing (OTLP/Jaeger) configuration.
logging: Option<LoggingConfig>Optional structured-logging configuration.
storage: HashMap<String, StorageConfig>Named object-storage backend configurations, keyed by storage name.
search: Option<SearchConfig>Reserved: placeholder for future search-indexing configuration.
cache: Option<CacheConfig>Reserved: placeholder for future advanced caching strategy configuration.
queues: Option<QueueConfig>Reserved: placeholder for future job-queue configuration.
realtime: Option<RealtimeConfig>Reserved: placeholder for future real-time update configuration.
custom_endpoints: Option<CustomEndpointsConfig>Reserved: placeholder for future custom-endpoint configuration.
lifecycle: Option<LifecycleConfig>Graceful-shutdown timing and health-check endpoint paths.
Implementations§
Source§impl RuntimeConfig
impl RuntimeConfig
Sourcepub fn from_file(path: impl AsRef<Path>) -> Result<Self, ConfigError>
pub fn from_file(path: impl AsRef<Path>) -> Result<Self, ConfigError>
Load configuration from file with full validation
§Errors
Returns ConfigError::ReadError if the file cannot be read.
Returns ConfigError::ParseError if the file content is not valid TOML.
Returns ConfigError if validation fails or required environment variables are missing.
Sourcepub fn load() -> Result<Self, ConfigError>
pub fn load() -> Result<Self, ConfigError>
Load configuration from default locations
§Errors
Returns ConfigError::NotFound if no configuration file is found in any default location.
Returns ConfigError if the found file cannot be read, parsed, or fails validation.
Sourcepub fn load_with_path(path: Option<&Path>) -> Result<Self, ConfigError>
pub fn load_with_path(path: Option<&Path>) -> Result<Self, ConfigError>
Load configuration with optional file path (CLI argument)
§Errors
Returns ConfigError if loading from the given path or from default locations fails.
Sourcepub fn validate_syntax(content: &str) -> Result<(), ConfigError>
pub fn validate_syntax(content: &str) -> Result<(), ConfigError>
Validate configuration without loading env vars (for dry-run/testing)
§Errors
Returns ConfigError::ParseError if the content is not valid TOML or cannot be
deserialized.
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Source§fn clone(&self) -> RuntimeConfig
fn clone(&self) -> RuntimeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuntimeConfig
impl Debug for RuntimeConfig
Source§impl<'de> Deserialize<'de> for RuntimeConfig
impl<'de> Deserialize<'de> for RuntimeConfig
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 RuntimeConfig
impl RefUnwindSafe for RuntimeConfig
impl Send for RuntimeConfig
impl Sync for RuntimeConfig
impl Unpin for RuntimeConfig
impl UnsafeUnpin for RuntimeConfig
impl UnwindSafe for RuntimeConfig
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,
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