pub struct CorsConfig {
pub allow_origin: String,
pub allow_methods: Vec<String>,
pub allow_headers: Vec<String>,
pub max_age: u32,
pub allow_credentials: bool,
}Expand description
CORS configuration
Fields§
§allow_origin: String§allow_methods: Vec<String>§allow_headers: Vec<String>§max_age: u32§allow_credentials: boolImplementations§
Source§impl CorsConfig
impl CorsConfig
pub fn new() -> Self
pub fn allow_origin(self, origin: impl Into<String>) -> Self
pub fn allow_methods(self, methods: Vec<String>) -> Self
pub fn allow_headers(self, headers: Vec<String>) -> Self
pub fn max_age(self, max_age: u32) -> Self
pub fn allow_credentials(self, allow: bool) -> Self
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
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