pub struct CorsConfig { /* private fields */ }Expand description
User-facing configuration for CorsPlugin.
Implementations§
Source§impl CorsConfig
Inherent builders and presets for CorsConfig.
impl CorsConfig
Inherent builders and presets for CorsConfig.
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Builds a permissive development policy allowing any origin, method, and header.
§Returns
Self- Permissive CORS configuration.
Sourcepub fn with_allow_origin(self, allow_origin: AllowOrigin) -> Self
pub fn with_allow_origin(self, allow_origin: AllowOrigin) -> Self
Sets the AllowOrigin policy.
§Arguments
AllowOrigin- Desired origin matching policy.
§Returns
Self- Updated configuration.
Sourcepub fn with_allow_methods<I, S>(self, methods: I) -> Self
pub fn with_allow_methods<I, S>(self, methods: I) -> Self
Sourcepub fn with_allow_headers<I, S>(self, headers: I) -> Self
pub fn with_allow_headers<I, S>(self, headers: I) -> Self
Sourcepub fn with_expose_headers<I, S>(self, headers: I) -> Self
pub fn with_expose_headers<I, S>(self, headers: I) -> Self
Sourcepub fn with_allow_credentials(self, allow_credentials: bool) -> Self
pub fn with_allow_credentials(self, allow_credentials: bool) -> Self
Sourcepub fn with_max_age_secs(self, max_age_secs: Option<u64>) -> Self
pub fn with_max_age_secs(self, max_age_secs: Option<u64>) -> Self
Sourcepub fn with_allow_private_network(self, allow_private_network: bool) -> Self
pub fn with_allow_private_network(self, allow_private_network: bool) -> Self
Source§impl CorsConfig
impl CorsConfig
pub fn get_allow_origin(&self) -> &AllowOrigin
pub fn get_mut_allow_origin(&mut self) -> &mut AllowOrigin
pub fn set_allow_origin(&mut self, val: AllowOrigin) -> &mut Self
pub fn get_allow_methods(&self) -> &Vec<String>
pub fn get_mut_allow_methods(&mut self) -> &mut Vec<String>
pub fn set_allow_methods(&mut self, val: Vec<String>) -> &mut Self
pub fn get_allow_headers(&self) -> &Vec<String>
pub fn get_mut_allow_headers(&mut self) -> &mut Vec<String>
pub fn set_allow_headers(&mut self, val: Vec<String>) -> &mut Self
pub fn get_expose_headers(&self) -> &Vec<String>
pub fn get_mut_expose_headers(&mut self) -> &mut Vec<String>
pub fn set_expose_headers(&mut self, val: Vec<String>) -> &mut Self
pub fn get_allow_credentials(&self) -> bool
pub fn get_mut_allow_credentials(&mut self) -> &mut bool
pub fn set_allow_credentials(&mut self, val: bool) -> &mut Self
pub fn get_max_age_secs(&self) -> Option<u64>
pub fn try_get_max_age_secs(&self) -> Option<u64>
pub fn get_mut_max_age_secs(&mut self) -> &mut Option<u64>
pub fn set_max_age_secs(&mut self, val: Option<u64>) -> &mut Self
pub fn get_allow_private_network(&self) -> bool
pub fn get_mut_allow_private_network(&mut self) -> &mut bool
pub fn set_allow_private_network(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl Clone for CorsConfig
impl Clone for CorsConfig
Source§impl Debug for CorsConfig
impl Debug for CorsConfig
Source§impl Default for CorsConfig
Default construction for CorsConfig.
impl Default for CorsConfig
Default construction for CorsConfig.
Source§fn default() -> Self
fn default() -> Self
Constructs a conservative default CorsConfig allowing any origin without credentials.
Auto Trait Implementations§
impl !RefUnwindSafe for CorsConfig
impl !UnwindSafe for CorsConfig
impl Forget for CorsConfig
impl Freeze for CorsConfig
impl Move for CorsConfig
impl Send for CorsConfig
impl Sync for CorsConfig
impl Unpin for CorsConfig
impl UnsafeUnpin for CorsConfigwhere
PhantomData<fn() -> XxHash3_64>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, ())>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<dyn Fn(&str) -> bool + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&str) -> bool + Sync + Send>>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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