pub struct MaxAge(/* private fields */);
Available on crate feature
cors
only.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