pub struct ServerCli {Show 17 fields
pub config: Option<PathBuf>,
pub environment: Option<String>,
pub profile: Option<String>,
pub env_prefix: Option<String>,
pub mode: Option<RuntimeMode>,
pub web_platform: bool,
pub no_web_platform: bool,
pub observability: bool,
pub no_observability: bool,
pub max_body_bytes: Option<usize>,
pub request_timeout_ms: Option<u64>,
pub rate_limit_capacity: Option<usize>,
pub rate_limit_refill_tokens: Option<usize>,
pub rate_limit_refill_seconds: Option<u64>,
pub id_generator: Option<IdGeneratorKind>,
pub print_startup_plan: bool,
pub dry_run: bool,
}Expand description
First-party CLI bootstrap for Vantus applications.
This layer is intentionally runtime-focused. It controls configuration selection, module toggles, runtime limits, and startup behavior. Cargo build profiles remain a build-time concern:
- use
cargo runfor debug/dev builds - use
cargo run --releasefor optimized release builds
Fields§
§config: Option<PathBuf>Base configuration file to load instead of auto-discovery.
environment: Option<String>Overrides the runtime environment name.
profile: Option<String>Overrides the active profile used for profile-specific config files.
env_prefix: Option<String>Overrides the environment variable prefix used for config loading.
mode: Option<RuntimeMode>Applies runtime defaults for development or production behavior.
web_platform: boolEnables the built-in web platform module.
no_web_platform: boolDisables the built-in web platform module.
observability: boolEnables the first-party observability module.
no_observability: boolDisables the first-party observability module.
max_body_bytes: Option<usize>Overrides the maximum accepted request body size in bytes.
request_timeout_ms: Option<u64>Overrides the outer request timeout in milliseconds.
rate_limit_capacity: Option<usize>Token bucket capacity for the global rate limiter.
rate_limit_refill_tokens: Option<usize>Number of tokens restored per refill interval.
rate_limit_refill_seconds: Option<u64>Rate-limiter refill interval in seconds.
id_generator: Option<IdGeneratorKind>Chooses the shared request-ID generator implementation.
print_startup_plan: boolPrints the resolved startup plan before booting.
dry_run: boolPrints the startup plan and exits without starting the server.
Implementations§
Source§impl ServerCli
impl ServerCli
Sourcepub fn apply_to_builder(
&self,
builder: &mut HostBuilder,
defaults: CliFeatureDefaults,
) -> Result<(), CliError>
pub fn apply_to_builder( &self, builder: &mut HostBuilder, defaults: CliFeatureDefaults, ) -> Result<(), CliError>
Applies CLI-selected defaults, module toggles, and runtime limits.
Sourcepub fn effective_mode(&self) -> RuntimeMode
pub fn effective_mode(&self) -> RuntimeMode
Returns the resolved runtime mode, defaulting to development.
Sourcepub fn id_generator_kind(&self) -> IdGeneratorKind
pub fn id_generator_kind(&self) -> IdGeneratorKind
Returns the resolved ID generator choice, defaulting to UUIDs.
Sourcepub fn web_platform_enabled(&self, default: bool) -> bool
pub fn web_platform_enabled(&self, default: bool) -> bool
Returns whether the built-in web platform module should be installed.
Sourcepub fn observability_enabled(&self, default: bool) -> bool
pub fn observability_enabled(&self, default: bool) -> bool
Returns whether the first-party observability module should be installed.
Sourcepub fn startup_plan(
&self,
defaults: CliFeatureDefaults,
) -> Result<String, CliError>
pub fn startup_plan( &self, defaults: CliFeatureDefaults, ) -> Result<String, CliError>
Renders a human-readable startup plan suitable for --dry-run.
Trait Implementations§
Source§impl Args for ServerCli
impl Args for ServerCli
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 CommandFactory for ServerCli
impl CommandFactory for ServerCli
Source§impl FromArgMatches for ServerCli
impl FromArgMatches for ServerCli
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.