pub struct HttpAcl { /* private fields */ }Expand description
Represents an HTTP ACL.
Implementations§
Source§impl HttpAcl
impl HttpAcl
Sourcepub fn builder() -> HttpAclBuilder
pub fn builder() -> HttpAclBuilder
Returns a new HttpAclBuilder.
Sourcepub fn is_scheme_allowed(&self, scheme: &str) -> AclClassification
pub fn is_scheme_allowed(&self, scheme: &str) -> AclClassification
Returns whether the scheme is allowed.
Sourcepub fn is_method_allowed(
&self,
method: impl Into<HttpRequestMethod>,
) -> AclClassification
pub fn is_method_allowed( &self, method: impl Into<HttpRequestMethod>, ) -> AclClassification
Returns whether the method is allowed.
Note: If you pass a string ensure it is uppercased first.
Sourcepub fn is_host_allowed(&self, host: &str) -> AclClassification
pub fn is_host_allowed(&self, host: &str) -> AclClassification
Returns whether the host is allowed.
Note: The host should be in its canonical form (lowercase, punycode for IDN).
Sourcepub fn is_port_allowed(&self, port: u16) -> AclClassification
pub fn is_port_allowed(&self, port: u16) -> AclClassification
Returns whether the port is allowed.
Sourcepub fn is_ip_allowed(&self, ip: &IpAddr) -> AclClassification
pub fn is_ip_allowed(&self, ip: &IpAddr) -> AclClassification
Returns whether an IP is allowed.
Sourcepub fn resolve_static_dns_mapping(&self, host: &str) -> Option<SocketAddr>
pub fn resolve_static_dns_mapping(&self, host: &str) -> Option<SocketAddr>
Resolve static DNS mapping.
Note: The host should be in its canonical form (lowercase, punycode for IDN).
Sourcepub fn is_header_allowed(
&self,
header_name: &str,
header_value: &str,
) -> AclClassification
pub fn is_header_allowed( &self, header_name: &str, header_value: &str, ) -> AclClassification
Returns whether a header is allowed.
Note: Header names are case-insensitive, but this function assumes the caller provides them in a consistent case.
Sourcepub fn is_url_path_allowed(&self, url_path: &str) -> AclClassification
pub fn is_url_path_allowed(&self, url_path: &str) -> AclClassification
Returns whether a URL path is allowed.
Note: The URL path should be percent-decoded before passing it to this function.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HttpAcl
impl !RefUnwindSafe for HttpAcl
impl Send for HttpAcl
impl Sync for HttpAcl
impl Unpin for HttpAcl
impl !UnwindSafe for HttpAcl
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