pub struct DefaultSessionCookieGenerator;
Expand description
The default cookie generator with focus on security.
It uses ThreadRng
as a random source and the Alphanumeric
distribution
to generate cookie strings. This gives log_2(26+26+10) ≥ 5.95
bits of entropy per character.
Trait Implementations§
Source§impl Clone for DefaultSessionCookieGenerator
impl Clone for DefaultSessionCookieGenerator
Source§fn clone(&self) -> DefaultSessionCookieGenerator
fn clone(&self) -> DefaultSessionCookieGenerator
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 Default for DefaultSessionCookieGenerator
impl Default for DefaultSessionCookieGenerator
Source§fn default() -> DefaultSessionCookieGenerator
fn default() -> DefaultSessionCookieGenerator
Returns the “default value” for a type. Read more
Source§impl SessionCookieGenerator for DefaultSessionCookieGenerator
impl SessionCookieGenerator for DefaultSessionCookieGenerator
Source§const COOKIE_LENGTH: usize = 32usize
const COOKIE_LENGTH: usize = 32usize
The length of the session cookie, in characters.
The default choice is
32
, which is secure.
It should be a multiple of 32
, which is the block size of blake3.Generate a cookie, i.e. a string that is a valid HTTP cookie value.
impl Copy for DefaultSessionCookieGenerator
Auto Trait Implementations§
impl Freeze for DefaultSessionCookieGenerator
impl RefUnwindSafe for DefaultSessionCookieGenerator
impl Send for DefaultSessionCookieGenerator
impl Sync for DefaultSessionCookieGenerator
impl Unpin for DefaultSessionCookieGenerator
impl UnwindSafe for DefaultSessionCookieGenerator
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