Struct tower_cookies::Cookies
source · pub struct Cookies { /* private fields */ }
Expand description
A parsed on-demand cookie jar.
Implementations§
source§impl Cookies
impl Cookies
sourcepub fn signed<'a>(&self, key: &'a Key) -> SignedCookies<'a>
pub fn signed<'a>(&self, key: &'a Key) -> SignedCookies<'a>
Returns a child SignedCookies
jar for interations with signed by the key
cookies.
§Example:
use cookie::{Cookie, Key};
use tower_cookies::Cookies;
let cookies = Cookies::default();
let key = Key::generate();
let signed = cookies.signed(&key);
let foo = Cookie::new("foo", "bar");
signed.add(foo.clone());
assert_eq!(signed.get("foo"), Some(foo.clone()));
assert_ne!(cookies.get("foo"), Some(foo));
Trait Implementations§
source§impl<S> FromRequestParts<S> for Cookies
impl<S> FromRequestParts<S> for Cookies
§type Rejection = (StatusCode, &'static str)
type Rejection = (StatusCode, &'static str)
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Auto Trait Implementations§
impl Freeze for Cookies
impl !RefUnwindSafe for Cookies
impl Send for Cookies
impl Sync for Cookies
impl Unpin 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
source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.