pub struct Config { /* private fields */ }Implementations§
Source§impl Config
impl Config
Sourcepub fn new(args: impl Iterator<Item = String>) -> Result<Config, &'static str>
pub fn new(args: impl Iterator<Item = String>) -> Result<Config, &'static str>
Using Iterator<Item = String> as a parameter because we cannot manually create a env::Args, but we know env::Args will yield a list of strings.
§example
ⓘ
let config = minigrep::Config::new(std::env::args()).unwrap_or_else(|err| {
eprintln!("Problem parsing arguments: {}", err);
std::process::exit(1);
});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