Struct tower_http::cors::MaxAge
source · pub struct MaxAge(/* private fields */);
Expand description
Holds configuration for how to set the Access-Control-Max-Age
header.
See CorsLayer::max_age
for more details.
Implementations§
source§impl MaxAge
impl MaxAge
sourcepub fn exact(max_age: Duration) -> Self
pub fn exact(max_age: Duration) -> Self
Set a static max-age value
See CorsLayer::max_age
for more details.
sourcepub fn dynamic<F>(f: F) -> Self
pub fn dynamic<F>(f: F) -> Self
Set the max-age based on the preflight request parts
See CorsLayer::max_age
for more details.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MaxAge
impl !RefUnwindSafe for MaxAge
impl Send for MaxAge
impl Sync for MaxAge
impl Unpin for MaxAge
impl !UnwindSafe for MaxAge
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
)