pub struct Config { /* private fields */ }
Expand description
The config for the generation of passwords. Taken as an argument by the run
function.
You can create an instance of this struct using Config::new
or
Config::build
.
Implementations§
Source§impl Config
impl Config
Sourcepub fn build(
args: impl Iterator<Item = String>,
) -> Result<Config, Box<dyn Error>>
pub fn build( args: impl Iterator<Item = String>, ) -> Result<Config, Box<dyn Error>>
Creates a Config
type using the command line arguments of the binary, passed in
as arguments. Assumes the first iteration of args
is the program name, so it’s
ignored.
Parameter:
args
- An iterator, meant to iterate over the binary’s arguments and flags.
§Errors
This function can result in an error if the length parameter could not be parsed into a
usize
.
Sourcepub fn new(length: usize) -> Config
pub fn new(length: usize) -> Config
Creates a Config
type. Recommended over Config::build
for
most use cases.
Parameter:
length
- Ausize
to act as the length of the password.
Sourcepub fn print_config()
pub fn print_config()
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