pub struct Cookie { /* private fields */ }
Expand description
Main object for cookie management.
Implementations
sourceimpl Cookie
impl Cookie
sourcepub fn new() -> Cookie
pub fn new() -> Cookie
Creates and returns an instance of Cookie
struct with the default fields.
sourcepub fn create(&self) -> String
pub fn create(&self) -> String
Creates a string with all the cookie data to be sent to the browser.
sourcepub fn set_from_settings(&mut self, cookie_name: &str) -> &mut Self
pub fn set_from_settings(&mut self, cookie_name: &str) -> &mut Self
Creates and returns an instance of Cookie
struct with the fields defined in the settings file for the given cookie name.
sourcepub fn set_name(&mut self, name: String) -> &mut Self
pub fn set_name(&mut self, name: String) -> &mut Self
Sets the name of the cookie and returns the instance.
sourcepub fn set_value(&mut self, value: String) -> &mut Self
pub fn set_value(&mut self, value: String) -> &mut Self
Sets the value of the cookie and returns the instance.
sourcepub fn set_max_age(&mut self, max_age: usize) -> &mut Self
pub fn set_max_age(&mut self, max_age: usize) -> &mut Self
Sets the max age of the cookie and returns the instance.
sourcepub fn set_expires(&mut self, expires: String) -> &mut Self
pub fn set_expires(&mut self, expires: String) -> &mut Self
Sets the expire date of the cookie and returns the instance.
sourcepub fn set_domain(&mut self, domain: String) -> &mut Self
pub fn set_domain(&mut self, domain: String) -> &mut Self
Sets the domain of the cookie and returns the instance.
sourcepub fn set_path(&mut self, path: String) -> &mut Self
pub fn set_path(&mut self, path: String) -> &mut Self
Sets the path of the cookie and returns the instance.
sourcepub fn set_http_only(&mut self, http_only: bool) -> &mut Self
pub fn set_http_only(&mut self, http_only: bool) -> &mut Self
Sets the http only field of the cookie and returns the instance.
sourcepub fn set_secure(&mut self, secure: bool) -> &mut Self
pub fn set_secure(&mut self, secure: bool) -> &mut Self
Sets the secure field of the cookie and returns the instance.
Trait Implementations
impl StructuralPartialEq for Cookie
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more