Trait some_auth::AuthUser

source ·
pub trait AuthUser {
    // Required methods
    fn new(username: String, pwd_hash: String, admin: bool) -> Self;
    fn existing(
        id: i32,
        username: String,
        pwd_hash: String,
        admin: bool,
        blocked: bool,
        created_at: DateTime<Utc>,
        updated_at: DateTime<Utc>,
    ) -> Self;
    fn id(&self) -> i32;
    fn username(&self) -> &str;
    fn pwd_hash(&self) -> &str;
    fn admin(&self) -> bool;
    fn blocked(&self) -> bool;
    fn created_at(&self) -> DateTime<Utc>;
    fn updated_at(&self) -> DateTime<Utc>;
    fn set_pwd_hash(&mut self, value: String);
    fn set_updated_at(&mut self, value: DateTime<Utc>);
    fn set_blocked(&mut self, value: bool);
}
Expand description

User in auth context

Required Methods§

source

fn new(username: String, pwd_hash: String, admin: bool) -> Self

Creates new user (implement validation in validation requires in implementation)

source

fn existing( id: i32, username: String, pwd_hash: String, admin: bool, blocked: bool, created_at: DateTime<Utc>, updated_at: DateTime<Utc>, ) -> Self

for mapping purposes

source

fn id(&self) -> i32

source

fn username(&self) -> &str

source

fn pwd_hash(&self) -> &str

Password hash

source

fn admin(&self) -> bool

source

fn blocked(&self) -> bool

source

fn created_at(&self) -> DateTime<Utc>

source

fn updated_at(&self) -> DateTime<Utc>

source

fn set_pwd_hash(&mut self, value: String)

source

fn set_updated_at(&mut self, value: DateTime<Utc>)

source

fn set_blocked(&mut self, value: bool)

Object Safety§

This trait is not object safe.

Implementors§