pub struct Cors {
pub allow_origins: Option<HashSet<String>>,
pub allow_methods: HashSet<String>,
pub allow_headers: HashSet<String>,
pub expose_headers: HashSet<String>,
pub allow_credentials: bool,
pub max_age: Option<Duration>,
}Fields§
§allow_origins: Option<HashSet<String>>§allow_methods: HashSet<String>§allow_headers: HashSet<String>§expose_headers: HashSet<String>§allow_credentials: bool§max_age: Option<Duration>Implementations§
Source§impl Cors
impl Cors
pub fn new() -> Self
pub fn allow_origins<T, I>(self, origins: I) -> Self
pub fn allow_methods<T, I>(self, methods: I) -> Self
pub fn allow_headers<T, I>(self, headers: I) -> Self
pub fn allow_credentials(self, allow: bool) -> Self
pub fn max_age<T: Into<Duration>>(self, duration: T) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cors
impl RefUnwindSafe for Cors
impl Send for Cors
impl Sync for Cors
impl Unpin for Cors
impl UnsafeUnpin for Cors
impl UnwindSafe for Cors
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