Struct choices::warp::filters::cors::Builder [−][src]
pub struct Builder { /* fields omitted */ }
A constructed via warp::cors()
.
Implementations
impl Builder
[src]
impl Builder
[src]pub fn allow_credentials(self, allow: bool) -> Builder
[src]
pub fn allow_credentials(self, allow: bool) -> Builder
[src]Sets whether to add the Access-Control-Allow-Credentials
header.
pub fn allow_method<M>(self, method: M) -> Builder where
Method: TryFrom<M>,
[src]
pub fn allow_method<M>(self, method: M) -> Builder where
Method: TryFrom<M>,
[src]Adds a method to the existing list of allowed request methods.
Panics
Panics if the provided argument is not a valid http::Method
.
pub fn allow_methods<I>(self, methods: I) -> Builder where
I: IntoIterator,
Method: TryFrom<<I as IntoIterator>::Item>,
[src]
pub fn allow_methods<I>(self, methods: I) -> Builder where
I: IntoIterator,
Method: TryFrom<<I as IntoIterator>::Item>,
[src]Adds multiple methods to the existing list of allowed request methods.
Panics
Panics if the provided argument is not a valid http::Method
.
pub fn allow_header<H>(self, header: H) -> Builder where
HeaderName: TryFrom<H>,
[src]
pub fn allow_header<H>(self, header: H) -> Builder where
HeaderName: TryFrom<H>,
[src]Adds a header to the list of allowed request headers.
Note: These should match the values the browser sends via Access-Control-Request-Headers
, e.g. content-type
.
Panics
Panics if the provided argument is not a valid http::header::HeaderName
.
pub fn allow_headers<I>(self, headers: I) -> Builder where
I: IntoIterator,
HeaderName: TryFrom<<I as IntoIterator>::Item>,
[src]
pub fn allow_headers<I>(self, headers: I) -> Builder where
I: IntoIterator,
HeaderName: TryFrom<<I as IntoIterator>::Item>,
[src]Adds multiple headers to the list of allowed request headers.
Note: These should match the values the browser sends via Access-Control-Request-Headers
, e.g.content-type
.
Panics
Panics if any of the headers are not a valid http::header::HeaderName
.
pub fn expose_header<H>(self, header: H) -> Builder where
HeaderName: TryFrom<H>,
[src]
pub fn expose_header<H>(self, header: H) -> Builder where
HeaderName: TryFrom<H>,
[src]Adds a header to the list of exposed headers.
Panics
Panics if the provided argument is not a valid http::header::HeaderName
.
pub fn expose_headers<I>(self, headers: I) -> Builder where
I: IntoIterator,
HeaderName: TryFrom<<I as IntoIterator>::Item>,
[src]
pub fn expose_headers<I>(self, headers: I) -> Builder where
I: IntoIterator,
HeaderName: TryFrom<<I as IntoIterator>::Item>,
[src]Adds multiple headers to the list of exposed headers.
Panics
Panics if any of the headers are not a valid http::header::HeaderName
.
pub fn allow_any_origin(self) -> Builder
[src]
pub fn allow_any_origin(self) -> Builder
[src]Sets that any Origin
header is allowed.
Warning
This can allow websites you didn’t intend to access this resource, it is usually better to set an explicit list.
pub fn allow_origin(self, origin: impl IntoOrigin) -> Builder
[src]
pub fn allow_origin(self, origin: impl IntoOrigin) -> Builder
[src]Add an origin to the existing list of allowed Origin
s.
Panics
Panics if the provided argument is not a valid Origin
.
pub fn allow_origins<I>(self, origins: I) -> Builder where
I: IntoIterator,
<I as IntoIterator>::Item: IntoOrigin,
[src]
pub fn allow_origins<I>(self, origins: I) -> Builder where
I: IntoIterator,
<I as IntoIterator>::Item: IntoOrigin,
[src]Add multiple origins to the existing list of allowed Origin
s.
Panics
Panics if the provided argument is not a valid Origin
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,