Struct chry_minigrep::Config[][src]

pub struct Config {
    pub query: String,
    pub filename: String,
    pub case_sensitive: bool,
}

Fields

query: Stringfilename: Stringcase_sensitive: bool

Implementations

根据运行参数,创建并返回一个Config结构体

Examples

let cfg = chry_minigrep::Config::new(std::env::args());
/*
let cfg = chry_minigrep::Config::new(std::env::args()).unwrap_or_else(|err| {
   eprintln!("Problem parsing arguments: {}", err);
   process::exit(1);
});
*/

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.