Skip to main content

AuthUser

Trait AuthUser 

Source
pub trait AuthUser:
    Clone
    + Send
    + Sync
    + 'static {
    type Id: Clone + Send + Sync + Debug + Serialize + DeserializeOwned + Into<Value> + 'static;

    // Required methods
    fn id(&self) -> Self::Id;
    fn email(&self) -> &str;
    fn password_digest(&self) -> Option<&str>;
    fn find_by_email(
        db: &DatabaseConnection,
        email: &str,
    ) -> impl Future<Output = Result<Option<Self>>> + Send;
    fn find_by_id(
        db: &DatabaseConnection,
        id: Self::Id,
    ) -> impl Future<Output = Result<Option<Self>>> + Send;
}
Expand description

The contract your User SeaORM model implements (manually or via #[auth_user]).

Required Associated Types§

Source

type Id: Clone + Send + Sync + Debug + Serialize + DeserializeOwned + Into<Value> + 'static

Primary key type (i64, Uuid, …).

Required Methods§

Source

fn id(&self) -> Self::Id

Source

fn email(&self) -> &str

Source

fn password_digest(&self) -> Option<&str>

Source

fn find_by_email( db: &DatabaseConnection, email: &str, ) -> impl Future<Output = Result<Option<Self>>> + Send

Source

fn find_by_id( db: &DatabaseConnection, id: Self::Id, ) -> impl Future<Output = Result<Option<Self>>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§