pub struct ProviderUserId(/* private fields */);Expand description
Type-safe wrapper for provider-specific user identifiers.
This provides compile-time safety to prevent mixing up provider user IDs with database user IDs. Provider user IDs are external identifiers from OAuth2 providers (e.g., Google user ID).
Implementations§
Source§impl ProviderUserId
impl ProviderUserId
Sourcepub fn new(id: String) -> Result<Self, OAuth2Error>
pub fn new(id: String) -> Result<Self, OAuth2Error>
Creates a new ProviderUserId from a string with validation.
§Arguments
id- The provider user ID string
§Returns
Ok(ProviderUserId)- If the ID is validErr(OAuth2Error)- If the ID is invalid
§Validation Rules
- Must not be empty
- Must contain only safe characters (alphanumeric + basic symbols)
- Must not contain control characters or dangerous sequences
Trait Implementations§
Source§impl Clone for ProviderUserId
impl Clone for ProviderUserId
Source§fn clone(&self) -> ProviderUserId
fn clone(&self) -> ProviderUserId
Returns a duplicate 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 ProviderUserId
impl Debug for ProviderUserId
Source§impl PartialEq for ProviderUserId
impl PartialEq for ProviderUserId
impl StructuralPartialEq for ProviderUserId
Auto Trait Implementations§
impl Freeze for ProviderUserId
impl RefUnwindSafe for ProviderUserId
impl Send for ProviderUserId
impl Sync for ProviderUserId
impl Unpin for ProviderUserId
impl UnwindSafe for ProviderUserId
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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