Struct rust_xfinal::cookie::Cookie
source · [−]pub struct Cookie { /* private fields */ }
Implementations
sourceimpl 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 RefUnwindSafe for Cookie
impl Send for Cookie
impl Sync for Cookie
impl Unpin for Cookie
impl UnwindSafe for Cookie
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more