pub struct RuntimeCorsConfig { /* private fields */ }Expand description
State for from_fn_with_state(config, runtime_cors). No CORS policy is enabled implicitly.
Implementations§
Source§impl RuntimeCorsConfig
impl RuntimeCorsConfig
Sourcepub fn new<P, X, M>(policy: P, exempt_path: X, map_error: M) -> Self
pub fn new<P, X, M>(policy: P, exempt_path: X, map_error: M) -> Self
Supplies dynamic product policy, exempt paths, and classified error mapping.
Sourcepub fn request_origin<R>(self, resolver: R) -> Self
pub fn request_origin<R>(self, resolver: R) -> Self
Provides a normalized, product-trusted request origin for same-origin bypass.
The default None disables bypass; raw Host/Forwarded headers are never trusted implicitly.
Sourcepub fn allowed_methods(
self,
methods: impl IntoIterator<Item = &'static str>,
) -> Self
pub fn allowed_methods( self, methods: impl IntoIterator<Item = &'static str>, ) -> Self
Sets preflight methods.
Sourcepub fn allowed_headers(
self,
headers: impl IntoIterator<Item = &'static str>,
) -> Self
pub fn allowed_headers( self, headers: impl IntoIterator<Item = &'static str>, ) -> Self
Sets allowed request headers; matching ignores name case.
Sourcepub fn exposed_headers(
self,
headers: impl IntoIterator<Item = &'static str>,
) -> Self
pub fn exposed_headers( self, headers: impl IntoIterator<Item = &'static str>, ) -> Self
Sets response headers exposed to browser JavaScript.
Sourcepub fn additional_origin_schemes(
self,
schemes: impl IntoIterator<Item = &'static str>,
) -> Self
pub fn additional_origin_schemes( self, schemes: impl IntoIterator<Item = &'static str>, ) -> Self
Adds origin schemes to parsing; full origins must still match the policy.
Trait Implementations§
Source§impl Clone for RuntimeCorsConfig
impl Clone for RuntimeCorsConfig
Source§fn clone(&self) -> RuntimeCorsConfig
fn clone(&self) -> RuntimeCorsConfig
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for RuntimeCorsConfig
impl !RefUnwindSafe for RuntimeCorsConfig
impl Send for RuntimeCorsConfig
impl Sync for RuntimeCorsConfig
impl Unpin for RuntimeCorsConfig
impl UnsafeUnpin for RuntimeCorsConfig
impl !UnwindSafe for RuntimeCorsConfig
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