pub struct CurrentUser {
pub user_id: String,
pub role: Option<String>,
pub internal_id: Option<Uuid>,
}
Expand description
Represents the metadata about the current user.
This is passed throughout the middlewares and also handlers.
Fields§
§user_id: String
Clerk User ID of the current user.
role: Option<String>
Clerk Role (normally None for regular users) of the current user.
internal_id: Option<Uuid>
Database User ID of the current user. Initially, this should be None as we will retrieve the internal ID from the database after authentication occurs.
Trait Implementations§
Source§impl Clone for CurrentUser
impl Clone for CurrentUser
Source§fn clone(&self) -> CurrentUser
fn clone(&self) -> CurrentUser
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CurrentUser
impl Debug for CurrentUser
Source§impl PartialEq for CurrentUser
impl PartialEq for CurrentUser
impl StructuralPartialEq for CurrentUser
Auto Trait Implementations§
impl Freeze for CurrentUser
impl RefUnwindSafe for CurrentUser
impl Send for CurrentUser
impl Sync for CurrentUser
impl Unpin for CurrentUser
impl UnwindSafe for CurrentUser
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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