Trait AuthUser

Source
pub trait AuthUser {
    // Required methods
    fn new(username: String, pwd_hash: String) -> Self;
    fn existing(
        id: i32,
        username: String,
        pwd_hash: String,
        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 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) -> Self

Creates new user

Source

fn existing( id: i32, username: String, pwd_hash: String, 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 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)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§