pub struct Cors { /* private fields */ }Expand description
Allows nothing until told; methods default to GET, HEAD and POST.
Implementations§
Source§impl Cors
impl Cors
pub fn new() -> Self
Sourcepub fn origin(self, origin: &str) -> Self
pub fn origin(self, origin: &str) -> Self
Exactly scheme://host[:port], or * for any origin without credentials.
pub fn methods(self, methods: &[Method]) -> Self
pub fn headers(self, names: &[&str]) -> Self
pub fn exposed_headers(self, names: &[&str]) -> Self
Sourcepub fn credentials(self) -> Self
pub fn credentials(self) -> Self
Cookies ride along, so a write from an allowed origin passes the CSRF check with its session.
pub fn max_age(self, age: Duration) -> 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