pub struct CorsConfig {
pub enabled: bool,
pub allow_origins: Option<Vec<String>>,
pub allow_methods: Option<Vec<String>>,
pub allow_headers: Option<Vec<String>>,
pub allow_credentials: Option<bool>,
pub max_age: Option<TimeConfig>,
pub display: bool,
}Expand description
§CORS Configuration
Configuration for the CORS Layer This configuration allows you to control cross-origin resource sharing policies.
Fields§
§enabled: boolBoolean indicating if CORS is enabled.
allow_origins: Option<Vec<String>>A list of allowed origins for cross-origin requests.
allow_methods: Option<Vec<String>>A list of allowed HTTP methods (e.g., “GET”, “POST”).
allow_headers: Option<Vec<String>>A list of allowed HTTP headers.
allow_credentials: Option<bool>A boolean indicating if credentials are allowed in cross-origin requests.
max_age: Option<TimeConfig>The maximum age in seconds for CORS preflight responses.
display: boolWhether to display the configuration details.
Trait Implementations§
Source§impl Clone for CorsConfig
impl Clone for CorsConfig
Source§fn clone(&self) -> CorsConfig
fn clone(&self) -> CorsConfig
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 moreSource§impl Debug for CorsConfig
impl Debug for CorsConfig
Source§impl Default for CorsConfig
impl Default for CorsConfig
Source§impl<'de> Deserialize<'de> for CorsConfigwhere
CorsConfig: Default,
impl<'de> Deserialize<'de> for CorsConfigwhere
CorsConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DisplayConfig for CorsConfig
impl DisplayConfig for CorsConfig
Auto Trait Implementations§
impl Freeze for CorsConfig
impl RefUnwindSafe for CorsConfig
impl Send for CorsConfig
impl Sync for CorsConfig
impl Unpin for CorsConfig
impl UnwindSafe for CorsConfig
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