pub struct CookieBuilder<'a> { /* 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<'a> CookieBuilder<'a>
Implementation for CookieBuilder.
impl<'a> CookieBuilder<'a>
Implementation for CookieBuilder.
Sourcepub fn parse(cookie: &'a str) -> Self
pub fn parse(cookie: &'a str) -> 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
&'a str- TheSet-Cookieheader string to parse.
§Returns
A CookieBuilder<'a> instance populated with the parsed cookie attributes.
Source§impl<'a> CookieBuilder<'a>
impl<'a> CookieBuilder<'a>
pub fn get_name(&self) -> &CookieKey<'a>
pub fn get_mut_name(&mut self) -> &mut CookieKey<'a>
pub fn set_name(&mut self, val: CookieKey<'a>) -> &mut Self
pub fn get_value(&self) -> &CookieValue<'a>
pub fn get_mut_value(&mut self) -> &mut CookieValue<'a>
pub fn set_value(&mut self, val: CookieValue<'a>) -> &mut Self
pub fn get_expires(&self) -> &&'a str
pub fn get_mut_expires(&mut self) -> &mut &'a str
pub fn set_expires(&mut self, val: &'a str) -> &mut Self
pub fn get_max_age(&self) -> &i64
pub fn get_mut_max_age(&mut self) -> &mut i64
pub fn set_max_age(&mut self, val: i64) -> &mut Self
pub fn get_domain(&self) -> &&'a str
pub fn get_mut_domain(&mut self) -> &mut &'a str
pub fn set_domain(&mut self, val: &'a str) -> &mut Self
pub fn get_path(&self) -> &&'a str
pub fn get_mut_path(&mut self) -> &mut &'a str
pub fn set_path(&mut self, val: &'a str) -> &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) -> &&'a str
pub fn get_mut_same_site(&mut self) -> &mut &'a str
pub fn set_same_site(&mut self, val: &'a str) -> &mut Self
Source§impl<'a> CookieBuilder<'a>
impl<'a> CookieBuilder<'a>
pub fn new(name: CookieKey<'a>, value: CookieValue<'a>) -> Self
Trait Implementations§
Source§impl<'a> Clone for CookieBuilder<'a>
impl<'a> Clone for CookieBuilder<'a>
Source§fn clone(&self) -> CookieBuilder<'a>
fn clone(&self) -> CookieBuilder<'a>
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<'a> Debug for CookieBuilder<'a>
impl<'a> Debug for CookieBuilder<'a>
Source§impl<'a> Default for CookieBuilder<'a>
impl<'a> Default for CookieBuilder<'a>
Source§fn default() -> CookieBuilder<'a>
fn default() -> CookieBuilder<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> PartialEq for CookieBuilder<'a>
impl<'a> PartialEq for CookieBuilder<'a>
impl<'a> Eq for CookieBuilder<'a>
impl<'a> StructuralPartialEq for CookieBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for CookieBuilder<'a>
impl<'a> RefUnwindSafe for CookieBuilder<'a>
impl<'a> Send for CookieBuilder<'a>
impl<'a> Sync for CookieBuilder<'a>
impl<'a> Unpin for CookieBuilder<'a>
impl<'a> UnwindSafe for CookieBuilder<'a>
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