Struct tower_http::cors::MaxAge
source · pub struct MaxAge(_);
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) -> Selfwhere
F: Fn(&HeaderValue, &RequestParts) -> Duration + Send + Sync + 'static,
pub fn dynamic<F>(f: F) -> Selfwhere F: Fn(&HeaderValue, &RequestParts) -> Duration + Send + Sync + 'static,
Set the max-age based on the preflight request parts
See CorsLayer::max_age
for more details.
Trait Implementations§
Auto Trait Implementations§
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