pub struct PasswordBuilder<U, V> { /* private fields */ }
Expand description

Definines the password builder that implements default values and can be cloned.

Implementations§

source§

impl PasswordBuilder<NoUnique, NoVariable>

Implementation of PasswordBuilder when nothing is set yet.

source

pub fn new() -> Self

source§

impl<U, V> PasswordBuilder<U, V>

Implementation of PasswordBuilder when it is already instantiated.

source

pub fn unique(self, word: impl Into<String>) -> PasswordBuilder<Unique, V>

Sets the unique word to build the passoword.

source

pub fn variable(self, word: impl Into<String>) -> PasswordBuilder<U, Variable>

Sets the variable word to build the password.

source§

impl PasswordBuilder<Unique, Variable>

Implementation of PasswordBuilder when “unique” and “variable” fields are set.

source

pub fn repeat(self, number: impl Into<u8>) -> Self

Sets a number of repetitions to use on the following specified method.

source

pub async fn method<T: Method + Default + PartialEq + Clone>( self, method: T ) -> Result<Self>

Generates a password based on a method. Can be chained with multiple methods.

source

pub async fn method_ptr( self, method: Arc<dyn Method + Sync + Send> ) -> Result<Self>

Generates a password based on a method from a pointer. Can be chained with multiple methods.

source

pub fn build(self) -> String

Trait Implementations§

source§

impl<U: Clone, V: Clone> Clone for PasswordBuilder<U, V>

source§

fn clone(&self) -> PasswordBuilder<U, V>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<U: Debug, V: Debug> Debug for PasswordBuilder<U, V>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<U: Default, V: Default> Default for PasswordBuilder<U, V>

source§

fn default() -> PasswordBuilder<U, V>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<U, V> Freeze for PasswordBuilder<U, V>
where U: Freeze, V: Freeze,

§

impl<U, V> RefUnwindSafe for PasswordBuilder<U, V>

§

impl<U, V> Send for PasswordBuilder<U, V>
where U: Send, V: Send,

§

impl<U, V> Sync for PasswordBuilder<U, V>
where U: Sync, V: Sync,

§

impl<U, V> Unpin for PasswordBuilder<U, V>
where U: Unpin, V: Unpin,

§

impl<U, V> UnwindSafe for PasswordBuilder<U, V>
where U: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.