pub struct SetCookie { /* private fields */ }Expand description
Response cookie builder (serialized into a Set-Cookie header).
Implementations§
Source§impl SetCookie
impl SetCookie
Sourcepub fn new(name: impl Into<String>, value: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, value: impl Into<String>) -> Self
Create a new cookie with name=value.
Sourcepub fn max_age(self, seconds: i64) -> Self
pub fn max_age(self, seconds: i64) -> Self
Set Max-Age (in seconds). Use 0 to delete the cookie.
Sourcepub fn to_header_value(&self) -> String
pub fn to_header_value(&self) -> String
Serialize into a Set-Cookie header value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SetCookie
impl RefUnwindSafe for SetCookie
impl Send for SetCookie
impl Sync for SetCookie
impl Unpin for SetCookie
impl UnwindSafe for SetCookie
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).