pub struct Cors { /* private fields */ }Expand description
CORS configuration.
Implementations§
Source§impl Cors
impl Cors
Sourcepub fn permissive() -> Cors
pub fn permissive() -> Cors
Allow any origin (without credentials).
pub fn allow_origin(self, origin: impl Into<String>) -> Cors
pub fn allow_methods(self, methods: &[&str]) -> Cors
pub fn allow_headers(self, headers: &[&str]) -> Cors
pub fn expose_headers(self, headers: &[&str]) -> Cors
pub fn allow_credentials(self, v: bool) -> Cors
pub fn max_age(self, d: Duration) -> Cors
Trait Implementations§
Auto Trait Implementations§
impl Forget for Cors
impl Freeze for Cors
impl Move 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