pub struct Builder<C> { /* private fields */ }Expand description
Configure an HTTP cookie with the builder pattern.
Implementations§
Source§impl<C: Cookie> Builder<C>
impl<C: Cookie> Builder<C>
Sourcepub fn wrap(cookie: C) -> Builder<C>
pub fn wrap(cookie: C) -> Builder<C>
Wrap an existing Cookie in a builder, in order to change attributes.
Sourcepub fn value(self, value: impl AsRef<str>) -> Builder<impl Cookie>
pub fn value(self, value: impl AsRef<str>) -> Builder<impl Cookie>
Set the value of this cookie.
Useful for overriding a value from a previous cookie.
Sourcepub fn path(self, path: impl AsRef<str>) -> Builder<impl Cookie>
pub fn path(self, path: impl AsRef<str>) -> Builder<impl Cookie>
Set the Path attribute of this cookie.
Sourcepub fn domain(self, domain: impl AsRef<str>) -> Builder<impl Cookie>
pub fn domain(self, domain: impl AsRef<str>) -> Builder<impl Cookie>
Set the Domain attribute of this cookie.
Sourcepub fn max_age(self, max_age: Duration) -> Builder<impl Cookie>
pub fn max_age(self, max_age: Duration) -> Builder<impl Cookie>
Set the Max-Age attribute of this cookie.
Sourcepub fn secure(self, secure: bool) -> Builder<impl Cookie>
pub fn secure(self, secure: bool) -> Builder<impl Cookie>
Enable or disable the Secure attribute of this cookie.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Builder<C>where
C: Freeze,
impl<C> RefUnwindSafe for Builder<C>where
C: RefUnwindSafe,
impl<C> Send for Builder<C>where
C: Send,
impl<C> Sync for Builder<C>where
C: Sync,
impl<C> Unpin for Builder<C>where
C: Unpin,
impl<C> UnwindSafe for Builder<C>where
C: UnwindSafe,
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