Struct tower_http::cors::AllowHeaders
source · pub struct AllowHeaders(_);
Available on crate feature
cors
only.Expand description
Holds configuration for how to set the Access-Control-Allow-Headers
header.
See CorsLayer::allow_headers
for more details.
Implementations§
source§impl AllowHeaders
impl AllowHeaders
sourcepub fn any() -> Self
pub fn any() -> Self
Allow any headers by sending a wildcard (*
)
See CorsLayer::allow_headers
for more details.
sourcepub fn list<I>(headers: I) -> Selfwhere
I: IntoIterator<Item = HeaderName>,
pub fn list<I>(headers: I) -> Selfwhere
I: IntoIterator<Item = HeaderName>,
Set multiple allowed headers
See CorsLayer::allow_headers
for more details.
sourcepub fn mirror_request() -> Self
pub fn mirror_request() -> Self
Allow any headers, by mirroring the preflight Access-Control-Request-Headers
header.
See CorsLayer::allow_headers
for more details.
Trait Implementations§
source§impl Clone for AllowHeaders
impl Clone for AllowHeaders
source§fn clone(&self) -> AllowHeaders
fn clone(&self) -> AllowHeaders
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 Debug for AllowHeaders
impl Debug for AllowHeaders
source§impl Default for AllowHeaders
impl Default for AllowHeaders
source§fn default() -> AllowHeaders
fn default() -> AllowHeaders
Returns the “default value” for a type. Read more
source§impl<const N: usize> From<[HeaderName; N]> for AllowHeaders
impl<const N: usize> From<[HeaderName; N]> for AllowHeaders
source§fn from(arr: [HeaderName; N]) -> Self
fn from(arr: [HeaderName; N]) -> Self
Converts to this type from the input type.
source§impl From<Any> for AllowHeaders
impl From<Any> for AllowHeaders
source§impl From<Vec<HeaderName, Global>> for AllowHeaders
impl From<Vec<HeaderName, Global>> for AllowHeaders
source§fn from(vec: Vec<HeaderName>) -> Self
fn from(vec: Vec<HeaderName>) -> Self
Converts to this type from the input type.