pub struct Config { /* private fields */ }Expand description
Configuration for a minigrep run.
Contains the search query, the filename to search, and whether the search is case-sensitive.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(args: &[String]) -> Result<Config, &str>
pub fn new(args: &[String]) -> Result<Config, &str>
Create a new Config from CLI-style arguments.
Expects at least three arguments: program name, query, filename.
The CASE_INSENSITIVE environment variable toggles case sensitivity:
if it is present the search will be case-insensitive.
Returns Err with a short message when args are not sufficient.
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more