pub struct UserProviderService<U: Clone + Send + Sync + 'static> { /* private fields */ }Expand description
Type-erased wrapper around a UserProvider implementation.
Register with app.service(UserProviderService::new(your_impl)). The service
is stored in the registry keyed by user type U so that Auth<U> and
OptionalAuth<U> can retrieve it by TypeId at request time.
Implementations§
Source§impl<U: Clone + Send + Sync + 'static> UserProviderService<U>
impl<U: Clone + Send + Sync + 'static> UserProviderService<U>
Sourcepub fn new<P: UserProvider<User = U>>(provider: P) -> Self
pub fn new<P: UserProvider<User = U>>(provider: P) -> Self
Wrap a UserProvider implementation for registration in the service registry.
Trait Implementations§
Auto Trait Implementations§
impl<U> Freeze for UserProviderService<U>
impl<U> !RefUnwindSafe for UserProviderService<U>
impl<U> Send for UserProviderService<U>
impl<U> Sync for UserProviderService<U>
impl<U> Unpin for UserProviderService<U>
impl<U> UnsafeUnpin for UserProviderService<U>
impl<U> !UnwindSafe for UserProviderService<U>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DefaultHooks for T
impl<T> DefaultHooks for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more