[][src]Struct splinter::biome::credentials::store::UserCredentialsBuilder

pub struct UserCredentialsBuilder { /* fields omitted */ }

Builder for UsersCredential. It hashes the password upon build.

Methods

impl UserCredentialsBuilder[src]

pub fn with_user_id(self, user_id: &str) -> UserCredentialsBuilder[src]

Sets the user_id for the credentials belong to

Arguments

  • user_id: unique identifier for the user the credentials belong to

pub fn with_username(self, username: &str) -> UserCredentialsBuilder[src]

Sets the username for the credentials

Arguments

  • username: username that will be used to authenticate the user

pub fn with_password(self, password: &str) -> UserCredentialsBuilder[src]

Sets the password for the credentials

Arguments

  • password: password that will be used to authenticate the user

pub fn with_password_encryption_cost(
    self,
    cost: PasswordEncryptionCost
) -> UserCredentialsBuilder
[src]

Sets the cost to encrypt the password for the credentials

Arguments

  • cost: cost of the password encryption, default is high

pub fn build(self) -> Result<UserCredentials, UserCredentialsBuilderError>[src]

Consumes the builder, hashes the password and returns UserCredentials with the hashed password

Trait Implementations

impl Default for UserCredentialsBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoSql for T

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,