Struct zcking_minigrep::Config
[−]
[src]
pub struct Config { pub query: String, pub filename: String, pub case_sensitive: bool, }
Holds the command-line arguments given.
Examples
extern crate zcking_minigrep; let config = zcking_minigrep::Config { query: String::from("Ishmael"), filename: String::from("moby_dick.txt"), case_sensitive: true, };
Fields
query: String
The term to search for
filename: String
Path to the file to search in
case_sensitive: bool
Whether case should be ignored or not when searching
Methods
impl Config
[src]
pub fn new(args: Args) -> Result<Config, &'static str>
[src]
Creates a new Config
by parsing arguments.
Errors
If the query or filename arguments were omitted, an error will be returned with a message indicating as such.