pub struct Protected<Auth, E> { /* private fields */ }Expand description
An endpoint that requires authentication.
Auth is the authentication extractor type (e.g., AuthUser).
E is the underlying endpoint type.
Handlers bound to Protected endpoints via bind_auth!() must accept
Auth as their first argument. This is enforced at compile time by
the AuthHandler trait — using bind!() (without auth) for a
Protected endpoint produces a type mismatch.
Trait Implementations§
Source§impl<Auth, E: BindableEndpoint> ProtectedEndpoint for Protected<Auth, E>
impl<Auth, E: BindableEndpoint> ProtectedEndpoint for Protected<Auth, E>
impl<Auth, E, Provided, Idx> AllProvided<Provided, Idx> for Protected<Auth, E>where
E: AllProvided<Provided, Idx>,
impl<Auth, E: ApiSpec> ApiSpec for Protected<Auth, E>
Auto Trait Implementations§
impl<Auth, E> Freeze for Protected<Auth, E>
impl<Auth, E> RefUnwindSafe for Protected<Auth, E>where
Auth: RefUnwindSafe,
E: RefUnwindSafe,
impl<Auth, E> Send for Protected<Auth, E>
impl<Auth, E> Sync for Protected<Auth, E>
impl<Auth, E> Unpin for Protected<Auth, E>
impl<Auth, E> UnsafeUnpin for Protected<Auth, E>
impl<Auth, E> UnwindSafe for Protected<Auth, E>where
Auth: UnwindSafe,
E: UnwindSafe,
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