pub struct ServerArgs {Show 15 fields
pub config: Option<String>,
pub database_url: Option<String>,
pub bind_addr: Option<SocketAddr>,
pub schema_path: Option<String>,
pub metrics_enabled: Option<bool>,
pub metrics_token: Option<String>,
pub admin_api_enabled: Option<bool>,
pub admin_token: Option<String>,
pub introspection_enabled: Option<bool>,
pub introspection_require_auth: Option<bool>,
pub rate_limiting_enabled: Option<bool>,
pub rate_limit_rps_per_ip: Option<u32>,
pub rate_limit_rps_per_user: Option<u32>,
pub rate_limit_burst_size: Option<u32>,
pub log_format: Option<String>,
}Expand description
Server configuration flags shared between fraiseql-server and
fraiseql run.
Every flag has a corresponding environment variable (clap’s env
attribute). The resolution order is: CLI flag > env var > config
file > built-in default.
Fields§
§config: Option<String>Path to TOML configuration file.
database_url: Option<String>Database connection URL.
bind_addr: Option<SocketAddr>Server bind address (host:port).
schema_path: Option<String>Path to compiled schema JSON file.
metrics_enabled: Option<bool>Enable Prometheus metrics endpoint.
metrics_token: Option<String>Bearer token for metrics endpoint authentication.
admin_api_enabled: Option<bool>Enable admin API endpoints.
admin_token: Option<String>Bearer token for admin API authentication.
introspection_enabled: Option<bool>Enable GraphQL introspection endpoint.
introspection_require_auth: Option<bool>Require authentication for introspection endpoint.
rate_limiting_enabled: Option<bool>Enable per-IP and per-user rate limiting.
rate_limit_rps_per_ip: Option<u32>Rate limit: maximum requests per second per IP.
rate_limit_rps_per_user: Option<u32>Rate limit: maximum requests per second per authenticated user.
rate_limit_burst_size: Option<u32>Rate limit: token bucket burst capacity.
log_format: Option<String>Log output format: json for structured JSON, text for
human-readable (default).
Implementations§
Source§impl ServerArgs
impl ServerArgs
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Construct a ServerArgs from environment variables only (no CLI parsing).
This is useful for consumers that handle their own CLI args (e.g.
fraiseql run) but still want to pick up server-production env vars
like FRAISEQL_METRICS_ENABLED without duplicating the parsing logic.
Unset env vars produce None fields — only explicitly set env vars
generate overrides.
Sourcepub fn apply_to_config(&self, config: &mut ServerConfig)
pub fn apply_to_config(&self, config: &mut ServerConfig)
Apply CLI/env overrides to a ServerConfig loaded from file or
defaults.
Fields that were not provided on the command line and not set via
environment variables are left untouched in config.
Sourcepub fn is_json_log_format(&self) -> bool
pub fn is_json_log_format(&self) -> bool
Whether the log format is JSON.
Trait Implementations§
Source§impl Args for ServerArgs
impl Args for ServerArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for ServerArgs
impl Clone for ServerArgs
Source§fn clone(&self) -> ServerArgs
fn clone(&self) -> ServerArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerArgs
impl Debug for ServerArgs
Source§impl Default for ServerArgs
impl Default for ServerArgs
Source§fn default() -> ServerArgs
fn default() -> ServerArgs
Source§impl FromArgMatches for ServerArgs
impl FromArgMatches for ServerArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for ServerArgs
impl RefUnwindSafe for ServerArgs
impl Send for ServerArgs
impl Sync for ServerArgs
impl Unpin for ServerArgs
impl UnsafeUnpin for ServerArgs
impl UnwindSafe for ServerArgs
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