pub struct Config {Show 17 fields
pub args: Vec<String>,
pub profile: String,
pub package: Option<String>,
pub bin: Option<String>,
pub example: Option<String>,
pub bench: Option<String>,
pub test: Option<String>,
pub bench_flag: String,
pub samply_args: Option<String>,
pub features: Vec<String>,
pub no_default_features: bool,
pub verbose: bool,
pub quiet: bool,
pub no_samply: bool,
pub dry_run: bool,
pub no_profile_inject: bool,
pub list_targets: bool,
}Expand description
Configuration structure for the cargo-samply command.
This struct contains all the command-line options and arguments that can be passed to cargo-samply.
§Examples
use cargo_samply::cli::Config;
let config = Config {
args: vec!["--help".to_string()],
profile: "samply".to_string(),
package: None,
bin: Some("my-binary".to_string()),
example: None,
bench: None,
test: None,
features: vec!["feature1".to_string(), "feature2".to_string()],
no_default_features: false,
verbose: false,
quiet: false,
no_samply: false,
dry_run: false,
no_profile_inject: false,
bench_flag: "--bench".to_string(),
samply_args: None,
list_targets: false,
};Fields§
§args: Vec<String>Trailing arguments passed to the binary being profiled
profile: StringBuild with the specified profile
package: Option<String>Package to profile (in a workspace)
bin: Option<String>Binary to run
example: Option<String>Example to run
bench: Option<String>Benchmark target to run (e.g. cargo samply --bench throughput)
test: Option<String>Test target to run (e.g. cargo samply --test integration_test)
bench_flag: StringThe flag to use when running the benchmark target
samply_args: Option<String>Arguments to pass to samply (e.g. --samply-args="--rate 2000").
Use = so the full string is parsed as the value of --samply-args,
even when it starts with --.
features: Vec<String>Build features to enable
no_default_features: boolDisable default features
verbose: boolPrint extra output to help debug problems
quiet: boolSuppress all output except errors
no_samply: boolDisable the automatic samply start
dry_run: boolPrint the build and run commands without executing them
no_profile_inject: boolDo not modify Cargo.toml to add the samply profile
list_targets: boolList all available targets in the workspace and exit
Trait Implementations§
Source§impl Args for Config
impl Args for Config
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 FromArgMatches for Config
impl FromArgMatches for Config
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.