#[non_exhaustive]pub enum SessionIdFormat {
Ulid,
Uuid,
Custom(Regex),
}Expand description
Format whitelist entry for SessionIdPolicy.
Built-in Self::Ulid and Self::Uuid cases carry conservative entropy
estimates; Self::Custom takes an adopter-supplied regex and contributes
zero entropy by default (the policy’s min_entropy_bits decides whether
it passes).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ulid
Crockford Base32 ULID (26 ASCII characters; first character 0..='7').
Effective entropy: 80 bits (random component).
Uuid
Canonical hyphenated UUID (8-4-4-4-12 lowercase or uppercase hex).
Effective entropy: 122 bits (assuming v4).
Custom(Regex)
Adopter-defined format. Validation is just the regex match; entropy
estimation is left to the adopter (defaults to 0 bits — combine with
a lower min_entropy_bits or an explicit override on the policy).
Implementations§
Source§impl SessionIdFormat
impl SessionIdFormat
Sourcepub fn effective_entropy_bits(&self) -> u32
pub fn effective_entropy_bits(&self) -> u32
Conservative lower bound on the effective entropy of an id matching
this format. Custom returns 0 — adopters with a tight regex can lower
SessionIdPolicy::min_entropy_bits to a value the regex’s structure
guarantees, or wrap their own pre-validation upstream.
Trait Implementations§
Source§impl Clone for SessionIdFormat
impl Clone for SessionIdFormat
Source§fn clone(&self) -> SessionIdFormat
fn clone(&self) -> SessionIdFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SessionIdFormat
impl RefUnwindSafe for SessionIdFormat
impl Send for SessionIdFormat
impl Sync for SessionIdFormat
impl Unpin for SessionIdFormat
impl UnsafeUnpin for SessionIdFormat
impl UnwindSafe for SessionIdFormat
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
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>
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