Struct genpass3::Config

source ·
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

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.

Creates a Config type. Recommended over Config::build for most use cases.

Parameter:

  • length - A usize to act as the length of the password.

Prints the configuration options to stderr.

Example
Config::print_config();

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.