Skip to main content

Config

Struct Config 

Source
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: String

Build 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: String

The 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: bool

Disable default features

§verbose: bool

Print extra output to help debug problems

§quiet: bool

Suppress all output except errors

§no_samply: bool

Disable the automatic samply start

§dry_run: bool

Print the build and run commands without executing them

§no_profile_inject: bool

Do not modify Cargo.toml to add the samply profile

§list_targets: bool

List all available targets in the workspace and exit

Trait Implementations§

Source§

impl Args for Config

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl FromArgMatches for Config

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.