#[non_exhaustive]pub struct CookieConfig {
pub secret: String,
pub secure: bool,
pub http_only: bool,
pub same_site: String,
}Expand description
Cookie security attributes used by the session and flash middleware.
Deserializes from the cookie section of the application YAML config.
All fields except secret have defaults, so a minimal config only needs
to provide secret.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.secret: StringHMAC signing secret. Must be at least 64 characters long.
secure: boolSet the Secure cookie attribute. Defaults to true.
Set to false during local HTTP development.
http_only: boolSet the HttpOnly cookie attribute. Defaults to true.
same_site: StringSameSite cookie attribute value: "lax", "strict", or "none".
Defaults to "lax".
Implementations§
Trait Implementations§
Source§impl Clone for CookieConfig
impl Clone for CookieConfig
Source§fn clone(&self) -> CookieConfig
fn clone(&self) -> CookieConfig
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 CookieConfig
impl Debug for CookieConfig
Source§impl Default for CookieConfig
impl Default for CookieConfig
Source§impl<'de> Deserialize<'de> for CookieConfig
impl<'de> Deserialize<'de> for CookieConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CookieConfig
impl RefUnwindSafe for CookieConfig
impl Send for CookieConfig
impl Sync for CookieConfig
impl Unpin for CookieConfig
impl UnsafeUnpin for CookieConfig
impl UnwindSafe for CookieConfig
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