pub struct Cookie { /* private fields */ }
Implementations§
Source§impl Cookie
impl Cookie
Sourcepub fn new(name: String, req: &Request<'_>) -> Self
pub fn new(name: String, req: &Request<'_>) -> Self
Create a cookie object from Request
- return a exist cookie if the client provides that
- Otherwise, return a new cookie
Sourcepub fn set_domain(&mut self, domain: String)
pub fn set_domain(&mut self, domain: String)
Set the cookie domain
Sourcepub fn get_domain(&self) -> &String
pub fn get_domain(&self) -> &String
Get the cookie domain
Sourcepub fn set_max_age(&mut self, time: Time)
pub fn set_max_age(&mut self, time: Time)
Set the cookie max_age
Sourcepub fn get_max_age(&self) -> &Option<Time>
pub fn get_max_age(&self) -> &Option<Time>
Get the cookie max_age
Sourcepub fn set_http_only(&mut self, v: bool)
pub fn set_http_only(&mut self, v: bool)
Set the cookie http-only
Sourcepub fn get_http_only(&self) -> bool
pub fn get_http_only(&self) -> bool
Get the cookie http-only
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