pub trait UserProvider:
Send
+ Sync
+ 'static {
type User: Clone + Send + Sync + 'static;
// Required method
fn find_by_id(
&self,
id: &str,
) -> impl Future<Output = Result<Option<Self::User>, Error>> + Send;
}Expand description
Trait for loading a user by their session-stored ID.
Implement this on your own type (e.g., a repository struct that holds a DB pool)
and register it via app.service(UserProviderService::new(your_impl)).
Required Associated Types§
Required Methods§
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.