pub struct AccessControl { /* private fields */ }
Expand description
Define access on control on HTTP layer.
Implementations§
Source§impl AccessControl
impl AccessControl
Sourcepub fn verify_host(&self, host: &str) -> Result<(), Error>
pub fn verify_host(&self, host: &str) -> Result<(), Error>
Validate incoming request by host.
host
is the return value from the host header
Sourcepub fn verify_origin(
&self,
origin: Option<&str>,
host: &str,
) -> Result<(), Error>
pub fn verify_origin( &self, origin: Option<&str>, host: &str, ) -> Result<(), Error>
Validate incoming request by origin.
host
is the return value from the host header
origin
is the value from the origin header
.
Sourcepub fn verify_headers<T, I, II>(
&self,
header_names: I,
cors_request_headers: II,
) -> Result<(), Error>
pub fn verify_headers<T, I, II>( &self, header_names: I, cors_request_headers: II, ) -> Result<(), Error>
Validate incoming request by CORS(access-control-request-headers
).
header_name: all keys of the header in the request
cors_request_headers: values of access-control-request-headers
headers.
Sourcepub fn allowed_headers(&self) -> &AllowHeaders
pub fn allowed_headers(&self) -> &AllowHeaders
Return the allowed headers we’ve set
Trait Implementations§
Source§impl Clone for AccessControl
impl Clone for AccessControl
Source§fn clone(&self) -> AccessControl
fn clone(&self) -> AccessControl
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AccessControl
impl Debug for AccessControl
Source§impl Default for AccessControl
impl Default for AccessControl
Source§fn default() -> AccessControl
fn default() -> AccessControl
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AccessControl
impl RefUnwindSafe for AccessControl
impl Send for AccessControl
impl Sync for AccessControl
impl Unpin for AccessControl
impl UnwindSafe for AccessControl
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