Struct pingora_core::server::configuration::Opt
source · pub struct Opt {
pub upgrade: bool,
pub daemon: bool,
pub nocapture: bool,
pub test: bool,
pub conf: Option<String>,
}
Expand description
Command-line options
Call Opt::from_args()
to build this object from the process’s command line arguments.
Fields§
§upgrade: bool
Whether this server should try to upgrade from a running old server
-u
or --upgrade
can be used
daemon: bool
Whether should run this server in the background
-d
or --daemon
can be used
nocapture: bool
Not actually used. This flag is there so that the server is not upset seeing this flag
passed from cargo test
sometimes
test: bool
Test the configuration and exit
When this flag is set, calling server.bootstrap()
will exit the process without errors
This flag is useful for upgrading service where the user wants to make sure the new service can start before shutting down the old server process.
-t
or --test
can be used
conf: Option<String>
The path to the configuration file.
See ServerConf
for more details of the configuration file.
-c
or --conf
can be used
Trait Implementations§
source§impl Default for Opt
impl Default for Opt
Create the default instance of Opt based on the current command-line args.
This is equivalent to running Opt::from_args
but does not require the
caller to have included the structopt::StructOpt
source§impl StructOpt for Opt
impl StructOpt for Opt
source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by StructOpt::clap
called on
the same type, otherwise it must panic.source§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program.source§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
std::env::args_os
).
Unlike StructOpt::from_args
, returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you.source§fn from_iter<I>(iter: I) -> Self
fn from_iter<I>(iter: I) -> Self
Vec
of your making.
Print the error message and quit the program in case of failure. Read more