Struct tower_http::cors::AllowHeaders
source · pub struct AllowHeaders(/* private fields */);
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>> for AllowHeaders
impl From<Vec<HeaderName>> for AllowHeaders
source§fn from(vec: Vec<HeaderName>) -> Self
fn from(vec: Vec<HeaderName>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for AllowHeaders
impl RefUnwindSafe for AllowHeaders
impl Send for AllowHeaders
impl Sync for AllowHeaders
impl Unpin for AllowHeaders
impl UnwindSafe for AllowHeaders
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)