pub struct Cookies { /* private fields */ }Expand description
Request cookies plus pending changes, shared between the request, the render context and the response.
Implementations§
Source§impl Cookies
impl Cookies
pub fn from_headers(headers: &HeaderMap, secure_default: bool) -> Cookies
Sourcepub fn get(&self, name: &str) -> Option<String>
pub fn get(&self, name: &str) -> Option<String>
Current value, reflecting changes made during this request.
Sourcepub fn get_decoded(&self, name: &str) -> Option<String>
pub fn get_decoded(&self, name: &str) -> Option<String>
Value decoded with percent-decoding (see Cookie::encoded).
pub fn all(&self) -> Vec<(String, String)>
Sourcepub fn set(&self, cookie: Cookie)
pub fn set(&self, cookie: Cookie)
Set a cookie (secure defaults are applied to unset attributes).
pub fn delete_with_path(&self, name: &str, path: &str)
Set-Cookie header values for all changes (invalid cookies are
skipped and reported).
Sourcepub fn secure_default(&self) -> bool
pub fn secure_default(&self) -> bool
Whether cookies default to Secure (outside development).
pub fn has_changes(&self) -> bool
Trait Implementations§
Source§impl FromContext for Cookies
impl FromContext for Cookies
fn from_context(ctx: &Arc<RequestContext>) -> Result<Cookies, Error>
Auto Trait Implementations§
impl Forget for Cookies
impl Freeze for Cookies
impl Move for Cookies
impl RefUnwindSafe for Cookies
impl Send for Cookies
impl Sync for Cookies
impl Unpin for Cookies
impl UnsafeUnpin for Cookies
impl UnwindSafe for Cookies
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