pub struct CookieBuilder { /* private fields */ }Expand description
Builder for constructing HTTP cookies.
Provides methods to set various cookie attributes like expiration, domain, path, and security flags before building the final cookie string.
Implementations§
Source§impl CookieBuilder
Implementation for CookieBuilder.
impl CookieBuilder
Implementation for CookieBuilder.
Sourcepub fn parse<C>(cookie: C) -> Self
pub fn parse<C>(cookie: C) -> Self
Parses a Set-Cookie header string into a CookieBuilder.
This method takes a Set-Cookie header string and extracts the various
attributes of a cookie, populating a CookieBuilder instance.
§Arguments
AsRef<str>- TheSet-Cookieheader string to parse.
§Returns
A CookieBuilder instance populated with the parsed cookie attributes.
Source§impl CookieBuilder
impl CookieBuilder
pub fn get_name(&self) -> &CookieKey
pub fn get_mut_name(&mut self) -> &mut CookieKey
pub fn set_name(&mut self, val: CookieKey) -> &mut Self
pub fn get_value(&self) -> &CookieValue
pub fn get_mut_value(&mut self) -> &mut CookieValue
pub fn set_value(&mut self, val: CookieValue) -> &mut Self
pub fn get_expires(&self) -> &Option<String>
pub fn get_mut_expires(&mut self) -> &mut Option<String>
pub fn set_expires(&mut self, val: Option<String>) -> &mut Self
pub fn get_max_age(&self) -> &Option<i64>
pub fn get_mut_max_age(&mut self) -> &mut Option<i64>
pub fn set_max_age(&mut self, val: Option<i64>) -> &mut Self
pub fn get_domain(&self) -> &Option<String>
pub fn get_mut_domain(&mut self) -> &mut Option<String>
pub fn set_domain(&mut self, val: Option<String>) -> &mut Self
pub fn get_path(&self) -> &Option<String>
pub fn get_mut_path(&mut self) -> &mut Option<String>
pub fn set_path(&mut self, val: Option<String>) -> &mut Self
pub fn get_secure(&self) -> &bool
pub fn get_mut_secure(&mut self) -> &mut bool
pub fn set_secure(&mut self, val: bool) -> &mut Self
pub fn get_http_only(&self) -> &bool
pub fn get_mut_http_only(&mut self) -> &mut bool
pub fn set_http_only(&mut self, val: bool) -> &mut Self
pub fn get_same_site(&self) -> &Option<String>
pub fn get_mut_same_site(&mut self) -> &mut Option<String>
pub fn set_same_site(&mut self, val: Option<String>) -> &mut Self
Trait Implementations§
Source§impl Clone for CookieBuilder
impl Clone for CookieBuilder
Source§fn clone(&self) -> CookieBuilder
fn clone(&self) -> CookieBuilder
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 CookieBuilder
impl Debug for CookieBuilder
Source§impl Default for CookieBuilder
impl Default for CookieBuilder
Source§fn default() -> CookieBuilder
fn default() -> CookieBuilder
Returns the “default value” for a type. Read more
Source§impl PartialEq for CookieBuilder
impl PartialEq for CookieBuilder
impl Eq for CookieBuilder
impl StructuralPartialEq for CookieBuilder
Auto Trait Implementations§
impl Freeze for CookieBuilder
impl RefUnwindSafe for CookieBuilder
impl Send for CookieBuilder
impl Sync for CookieBuilder
impl Unpin for CookieBuilder
impl UnwindSafe for CookieBuilder
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