pub struct Cors { /* private fields */ }Implementations§
source§impl Cors
impl Cors
sourcepub fn allow_origin(self, origin: &str) -> Self
pub fn allow_origin(self, origin: &str) -> Self
Consumes the Response and return an altered response with origin and vary_origin set
sourcepub fn any(self) -> Self
pub fn any(self) -> Self
Consumes the Response and return an altered response with origin set to “*”
sourcepub fn credentials(self, value: bool) -> Self
pub fn credentials(self, value: bool) -> Self
Consumes the Response and set credentials
sourcepub fn exposed_headers(self, headers: Vec<&str>) -> Self
pub fn exposed_headers(self, headers: Vec<&str>) -> Self
Consumes the CORS, set expose_headers to passed headers and returns changed CORS
sourcepub fn allow_headers(self, headers: Vec<&str>) -> Self
pub fn allow_headers(self, headers: Vec<&str>) -> Self
Consumes the CORS, set allow_headers to passed headers and returns changed CORS
sourcepub fn max_age(self, value: Option<usize>) -> Self
pub fn max_age(self, value: Option<usize>) -> Self
Consumes the CORS, set max_age to passed value and returns changed CORS
sourcepub fn allow_methods(self, methods: Vec<Method>) -> Self
pub fn allow_methods(self, methods: Vec<Method>) -> Self
Consumes the CORS, set allow_methods to passed methods and returns changed CORS
sourcepub fn merge(&self, response: &mut HttpResponse)
pub fn merge(&self, response: &mut HttpResponse)
Merge CORS headers with an existing rocket::Response.
This will overwrite any existing CORS headers
Trait Implementations§
source§impl PartialEq for Cors
impl PartialEq for Cors
impl Eq for Cors
impl StructuralPartialEq for Cors
Auto Trait Implementations§
impl Freeze for Cors
impl RefUnwindSafe for Cors
impl Send for Cors
impl Sync for Cors
impl Unpin 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