#[non_exhaustive]pub struct CookieKit {
pub request_cookies: Option<Constructor>,
pub response_cookies: Option<Constructor>,
pub processor: Option<Constructor>,
pub processor_config: Option<Constructor>,
pub response_cookie_injector: Option<PostProcessingMiddleware>,
}
Expand description
A collection of components required to work with request and response cookies.
§Guide
Check out the cookie installation section of Pavex’s guide for a thorough introduction to cookies and how to customize them.
§Example
use pavex::blueprint::Blueprint;
use pavex::cookie::CookieKit;
let mut bp = Blueprint::new();
let kit = CookieKit::new().register(&mut bp);
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.The constructor for RequestCookies
.
By default, it uses extract_request_cookies
.
The error is handled by ExtractRequestCookiesError::into_response
.
The constructor for ResponseCookies
.
By default, it uses ResponseCookies::new
.
processor: Option<Constructor>
The constructor for Processor
.
By default, it uses Processor::from
processor_config: Option<Constructor>
The constructor for ProcessorConfig
.
By default, it’s None
.
You can use with_default_processor_config
to set it ProcessorConfig::default
.
A post-processing middleware to inject response cookies into the outgoing response
via the Set-Cookie
header.
By default, it’s set to inject_response_cookies
.
The error is handled by InjectResponseCookiesError::into_response
.
Implementations§
source§impl CookieKit
impl CookieKit
sourcepub fn with_default_processor_config(self) -> Self
pub fn with_default_processor_config(self) -> Self
Set the ProcessorConfig
constructor to ProcessorConfig::default
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CookieKit
impl RefUnwindSafe for CookieKit
impl Send for CookieKit
impl Sync for CookieKit
impl Unpin for CookieKit
impl UnwindSafe for CookieKit
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)