Struct 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.
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§async fn call(
&self,
req: WebRequest<Err>,
ctx: ServiceCtx<'_, Self>
) -> Result<Self::Response, S::Error>
async fn call( &self, req: WebRequest<Err>, ctx: ServiceCtx<'_, Self> ) -> Result<Self::Response, S::Error>
Process the request and return the response asynchronously. 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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§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