[−][src]Struct roa::cors::Builder
Builder of Cors.
Methods
impl Builder
[src]
pub fn allow_credentials(self, allow: bool) -> Self
[src]
Sets whether to add the Access-Control-Allow-Credentials
header.
pub fn allow_method(self, method: Method) -> Self
[src]
Adds a method to the existing list of allowed request methods.
pub fn allow_methods(self, methods: impl IntoIterator<Item = Method>) -> Self
[src]
Adds multiple methods to the existing list of allowed request methods.
pub fn allow_header<H>(self, header: H) -> Self where
H: TryInto<HeaderName>,
H::Error: Debug,
[src]
H: TryInto<HeaderName>,
H::Error: Debug,
Adds a header to the list of allowed request headers.
Panics
Panics if header is not a valid http::header::HeaderName
.
pub fn allow_headers<I>(self, headers: I) -> Self where
I: IntoIterator,
I::Item: TryInto<HeaderName>,
<I::Item as TryInto<HeaderName>>::Error: Debug,
[src]
I: IntoIterator,
I::Item: TryInto<HeaderName>,
<I::Item as TryInto<HeaderName>>::Error: Debug,
Adds multiple headers to the list of allowed request headers.
Panics
Panics if any of the headers are not a valid http::header::HeaderName
.
pub fn expose_header<H>(self, header: H) -> Self where
H: TryInto<HeaderName>,
H::Error: Debug,
[src]
H: TryInto<HeaderName>,
H::Error: Debug,
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) -> Self where
I: IntoIterator,
I::Item: TryInto<HeaderName>,
<I::Item as TryInto<HeaderName>>::Error: Debug,
[src]
I: IntoIterator,
I::Item: TryInto<HeaderName>,
<I::Item as TryInto<HeaderName>>::Error: Debug,
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_origin<H>(self, origin: H) -> Self where
H: TryInto<HeaderValue>,
H::Error: Debug,
[src]
H: TryInto<HeaderValue>,
H::Error: Debug,
Add an origin to the existing list of allowed Origin
s.
Panics
Panics if the provided argument is not a valid HeaderValue
.
pub fn max_age(self, seconds: u64) -> Self
[src]
Sets the Access-Control-Max-Age
header.
pub fn build(self) -> Cors
[src]
Builds the Cors
wrapper from the configured settings.
This step isn't required, as the Builder
itself can be passed
to Filter::with
. This just allows constructing once, thus not needing
to pay the cost of "building" every time.
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> State for T where
T: 'static + Clone + Send + Sync,
[src]
T: 'static + Clone + Send + Sync,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,