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>,
Source§type Response = WebResponse
type Response = WebResponse
Responses given by the service.
Source§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§async fn ready(&self, ctx: ServiceCtx<'_, Self>) -> Result<(), Self::Error>
async fn ready(&self, ctx: ServiceCtx<'_, Self>) -> Result<(), Self::Error>
Returns when the service is able to process requests. Read more
Source§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
Source§fn poll(&self, cx: &mut Context<'_>) -> Result<(), Self::Error>
fn poll(&self, cx: &mut Context<'_>) -> Result<(), Self::Error>
Polls service from the current task. Read more
Auto Trait Implementations§
impl<S> Freeze for CorsMiddleware<S>where
S: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Svc, Req> IntoService<Svc, Req> for Svcwhere
Svc: Service<Req>,
impl<Svc, Req> IntoService<Svc, Req> for Svcwhere
Svc: Service<Req>,
Source§fn into_service(self) -> Svc
fn into_service(self) -> Svc
Convert to a
Service