Struct clia_ntex_cors::CorsMiddleware
source · pub struct CorsMiddleware<S> { /* private fields */ }
Expand description
Middleware
for Cross-origin resource sharing support
The Cors struct contains the settings for CORS requests to be validated and for responses to be generated.
Trait Implementations§
source§impl<S: Clone> Clone for CorsMiddleware<S>
impl<S: Clone> Clone for CorsMiddleware<S>
source§fn clone(&self) -> CorsMiddleware<S>
fn clone(&self) -> CorsMiddleware<S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<S, Err> Service<WebRequest<Err>> for CorsMiddleware<S>where
S: Service<WebRequest<Err>, Response = WebResponse>,
Err: ErrorRenderer,
Err::Container: From<S::Error>,
CorsError: WebResponseError<Err>,
impl<S, Err> Service<WebRequest<Err>> for CorsMiddleware<S>where S: Service<WebRequest<Err>, Response = WebResponse>, Err: ErrorRenderer, Err::Container: From<S::Error>, CorsError: WebResponseError<Err>,
§type Response = WebResponse
type Response = WebResponse
Responses given by the service.
§type Error = <S as Service<WebRequest<Err>>>::Error
type Error = <S as Service<WebRequest<Err>>>::Error
Errors produced by the service when polling readiness or executing call.
§type Future<'f> = Either<Ready<Result<<CorsMiddleware<S> as Service<WebRequest<Err>>>::Response, <S as Service<WebRequest<Err>>>::Error>>, Pin<Box<dyn Future<Output = Result<<CorsMiddleware<S> as Service<WebRequest<Err>>>::Response, <S as Service<WebRequest<Err>>>::Error>> + 'f, Global>>>
where
Self: 'f
type Future<'f> = Either<Ready<Result<<CorsMiddleware<S> as Service<WebRequest<Err>>>::Response, <S as Service<WebRequest<Err>>>::Error>>, Pin<Box<dyn Future<Output = Result<<CorsMiddleware<S> as Service<WebRequest<Err>>>::Response, <S as Service<WebRequest<Err>>>::Error>> + 'f, Global>>> where Self: 'f
The future response value.
source§fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns
Ready
when the service is able to process requests. Read moresource§fn call<'a>(
&'a self,
req: WebRequest<Err>,
ctx: ServiceCtx<'a, Self>
) -> Self::Future<'a>
fn call<'a>( &'a self, req: WebRequest<Err>, ctx: ServiceCtx<'a, Self> ) -> Self::Future<'a>
Process the request and return the response asynchronously. Read more
§fn map<F, Res>(self, f: F) -> ServiceChain<Map<Self, F, Req, Res>, Req>where
Self: Sized,
F: Fn(Self::Response) -> Res,
fn map<F, Res>(self, f: F) -> ServiceChain<Map<Self, F, Req, Res>, Req>where Self: Sized, F: Fn(Self::Response) -> Res,
Map this service’s output to a different type, returning a new service of the resulting type. Read more
Auto Trait Implementations§
impl<S> !RefUnwindSafe for CorsMiddleware<S>
impl<S> !Send for CorsMiddleware<S>
impl<S> !Sync for CorsMiddleware<S>
impl<S> Unpin for CorsMiddleware<S>where S: Unpin,
impl<S> !UnwindSafe for CorsMiddleware<S>
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
§impl<Svc, Req> IntoService<Svc, Req> for Svcwhere
Svc: Service<Req>,
impl<Svc, Req> IntoService<Svc, Req> for Svcwhere Svc: Service<Req>,
§fn into_service(self) -> Svc
fn into_service(self) -> Svc
Convert to a
Service
§fn into_chain(self) -> ServiceChain<Svc, Req>where
Self: Sized,
fn into_chain(self) -> ServiceChain<Svc, Req>where Self: Sized,
Convert
Self
to a ServiceChain