Struct rocket_cors::Guard
source ·
[−]pub struct Guard<'r> { /* private fields */ }
Expand description
A request guard to check CORS headers before a route is run. Will not execute the route if checks fail.
See the documentation at the crate root for usage information.
You should not wrap this in an
Option
or Result
because the guard will let non-CORS requests through and will take over
error handling in case of errors.
In essence, this is just a wrapper around Response
with a 'r
borrowed lifetime so users
don’t have to keep specifying the lifetimes in their routes
Implementations
Consumes the Guard and return a Responder
that wraps a
provided rocket:response::Responder
with CORS headers
Trait Implementations
Auto Trait Implementations
impl<'r> RefUnwindSafe for Guard<'r>
impl<'r> UnwindSafe for Guard<'r>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more