pub struct RememberMeConfig { /* private fields */ }Expand description
Remember-Me configuration.
§Spring Security Equivalent
Similar to RememberMeConfigurer in Spring Security.
Implementations§
Source§impl RememberMeConfig
impl RememberMeConfig
Sourcepub fn new(key: &str) -> Self
pub fn new(key: &str) -> Self
Create a new remember-me configuration with the given secret key.
The key is used to sign tokens and should be kept secret.
Sourcepub fn token_validity_days(self, days: u64) -> Self
pub fn token_validity_days(self, days: u64) -> Self
Set token validity in days.
Sourcepub fn token_validity_seconds(self, seconds: u64) -> Self
pub fn token_validity_seconds(self, seconds: u64) -> Self
Set token validity in seconds.
Set the cookie name.
Set the cookie path.
Set the cookie domain.
Set whether the cookie requires HTTPS.
Set whether the cookie is HTTP only.
Set the cookie SameSite attribute.
Sourcepub fn parameter_name(self, name: &str) -> Self
pub fn parameter_name(self, name: &str) -> Self
Set the form parameter name for remember-me checkbox.
Sourcepub fn always_remember(self, always: bool) -> Self
pub fn always_remember(self, always: bool) -> Self
Set whether to always remember (ignore checkbox).
Sourcepub fn get_token_validity(&self) -> Duration
pub fn get_token_validity(&self) -> Duration
Get token validity duration.
Get the cookie name.
Sourcepub fn get_parameter_name(&self) -> &str
pub fn get_parameter_name(&self) -> &str
Get the parameter name.
Sourcepub fn is_always_remember(&self) -> bool
pub fn is_always_remember(&self) -> bool
Check if always remember is enabled.
Trait Implementations§
Source§impl Clone for RememberMeConfig
impl Clone for RememberMeConfig
Source§fn clone(&self) -> RememberMeConfig
fn clone(&self) -> RememberMeConfig
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 moreAuto Trait Implementations§
impl Freeze for RememberMeConfig
impl RefUnwindSafe for RememberMeConfig
impl Send for RememberMeConfig
impl Sync for RememberMeConfig
impl Unpin for RememberMeConfig
impl UnwindSafe for RememberMeConfig
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,
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