pub struct Cookie { /* private fields */ }
Expand description
Utility struct to manage session cookies
Includes two constructor methods and getters/setters for adjustments
Implementations§
Source§impl Cookie
impl Cookie
Sourcepub fn new_all(
domain: String,
expiry: u64,
same_site: String,
http_only: bool,
name: String,
path: String,
secure: bool,
value: String,
) -> Self
pub fn new_all( domain: String, expiry: u64, same_site: String, http_only: bool, name: String, path: String, secure: bool, value: String, ) -> Self
Create a cookie and initialize all its fields
Sourcepub fn new(name: String, value: String) -> Self
pub fn new(name: String, value: String) -> Self
Create default cookie and set only name and value
pub fn get_domain(&self) -> String
pub fn get_expiry(&self) -> u64
pub fn get_http_only(&self) -> bool
pub fn get_name(&self) -> String
pub fn get_path(&self) -> String
pub fn get_secure(&self) -> bool
pub fn get_value(&self) -> String
pub fn get_same_site(&self) -> String
pub fn set_domain(&mut self, domain: String)
pub fn set_expiry(&mut self, expiry: u64)
pub fn set_http_only(&mut self, http_only: bool)
pub fn set_path(&mut self, path: String)
pub fn set_secure(&mut self, secure: bool)
pub fn set_same_site(&mut self, same_site: String)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cookie
impl<'de> Deserialize<'de> for Cookie
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 Cookie
impl RefUnwindSafe for Cookie
impl Send for Cookie
impl Sync for Cookie
impl Unpin for Cookie
impl UnwindSafe for Cookie
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