pub struct ProviderName(/* private fields */);Expand description
URL-facing identifier of a registered OAuth2/OIDC provider.
Wraps a &'static str that is either a compile-time literal (named
providers, preset defaults) or a Box::leak-ed value produced from an
operator-supplied env var at LazyLock init (custom slots). The value
has been validated for shape via is_valid_custom_provider_name (see
validate_custom_slots) before any ProviderName constructed from env
input reaches callers.
The newtype is not a parser — it does not re-validate its input at
construction. It exists so function signatures can carry
“provider-identifier” as a distinct type from other &str parameters
(display name, client secret, etc.), letting the compiler catch
accidental argument swaps. Construction paths stay pub(crate) so the
invariant holds at the crate boundary.
Implementations§
Source§impl ProviderName
impl ProviderName
Sourcepub fn from_registered(s: &str) -> Option<Self>
pub fn from_registered(s: &str) -> Option<Self>
Resolve a runtime string (URL path segment, DB-stored value) against
the currently-enabled provider registry. Returns Some(ProviderName)
only when the string matches an enabled provider’s name, so the
ProviderName invariant is preserved — callers can treat the result
as “validated, registered identifier” without further checks.
Returns None when the string is empty, does not match any enabled
provider, or matches a named provider whose optional env vars are not
configured.
Trait Implementations§
Source§impl AsRef<str> for ProviderName
impl AsRef<str> for ProviderName
Source§impl Clone for ProviderName
impl Clone for ProviderName
Source§fn clone(&self) -> ProviderName
fn clone(&self) -> ProviderName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProviderName
impl Debug for ProviderName
Source§impl Display for ProviderName
impl Display for ProviderName
Source§impl Hash for ProviderName
impl Hash for ProviderName
Source§impl PartialEq for ProviderName
impl PartialEq for ProviderName
Source§fn eq(&self, other: &ProviderName) -> bool
fn eq(&self, other: &ProviderName) -> bool
self and other values to be equal, and is used by ==.impl Copy for ProviderName
impl Eq for ProviderName
impl StructuralPartialEq for ProviderName
Auto Trait Implementations§
impl Freeze for ProviderName
impl RefUnwindSafe for ProviderName
impl Send for ProviderName
impl Sync for ProviderName
impl Unpin for ProviderName
impl UnsafeUnpin for ProviderName
impl UnwindSafe for ProviderName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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