pub struct Date;
Expand description
Middleware to add the HTTP Date header (as defined in RFC 9110, Section 5.6.7). This is technically required for all servers that have a clock, so I may move it to the core library at some point.
Example
Date.attach(&mut server);
Trait Implementations§
source§impl Middleware for Date
impl Middleware for Date
source§fn post(&self, _req: &Request, res: &mut Response) -> MiddleResult
fn post(&self, _req: &Request, res: &mut Response) -> MiddleResult
Middleware to run After Routes
source§fn pre_raw(&self, req: &mut Result<Request>) -> MiddleResult
fn pre_raw(&self, req: &mut Result<Request>) -> MiddleResult
Middleware to run before routes.
Because this is the
raw
version of Middleware::pre
, it is passed a Result
.
The default implementation calls Middleware::pre
if the Result
is Ok
.source§fn pre(&self, _req: &mut Request) -> MiddleResult
fn pre(&self, _req: &mut Request) -> MiddleResult
Middleware to run Before Routes
source§fn post_raw(
&self,
req: Result<Rc<Request>>,
res: &mut Result<Response>
) -> MiddleResult
fn post_raw( &self, req: Result<Rc<Request>>, res: &mut Result<Response> ) -> MiddleResult
Middleware to run after routes.
Because this is the
raw
version of Middleware::post
, it is passed a Result
.
The default implementation calls Middleware::post
if the Result
is Ok
.source§fn end_raw(&self, req: &Result<Request>, res: &Result<Response>)
fn end_raw(&self, req: &Result<Request>, res: &Result<Response>)
Middleware to run after the response has been handled.
Because this is the
raw
version of Middleware::end
, it is passed a Result
.
The default implementation calls Middleware::end
if the Result
is Ok
.Auto Trait Implementations§
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnwindSafe for Date
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