pub struct CorsConfig { /* private fields */ }Expand description
CORS policy. Build with CorsConfig::new(origins), chain options, install
with App::cors(config).
Implementations§
Source§impl CorsConfig
impl CorsConfig
pub fn new(origins: CorsOrigins) -> Self
pub fn allow_credentials(self, yes: bool) -> Self
pub fn max_age(self, d: Duration) -> Self
pub fn allow_methods<I: IntoIterator<Item = Method>>(self, m: I) -> Self
pub fn allow_headers<I: IntoIterator<Item = S>, S: Into<String>>( self, h: I, ) -> Self
pub fn expose_headers<I: IntoIterator<Item = S>, S: Into<String>>( self, h: I, ) -> Self
Sourcepub fn allow_credentials_enabled(&self) -> bool
pub fn allow_credentials_enabled(&self) -> bool
Public reader (the builder method allow_credentials(bool) can’t share the name).
Sourcepub fn allows_origin(&self, origin: &str) -> bool
pub fn allows_origin(&self, origin: &str) -> bool
True if origin is permitted. Any matches everything; List is exact.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CorsConfig
impl RefUnwindSafe for CorsConfig
impl Send for CorsConfig
impl Sync for CorsConfig
impl Unpin for CorsConfig
impl UnsafeUnpin 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