pub struct HttpAclBuilder { /* private fields */ }Expand description
A builder for HttpAcl.
Implementations§
source§impl HttpAclBuilder
impl HttpAclBuilder
sourcepub fn new() -> HttpAclBuilder
pub fn new() -> HttpAclBuilder
Create a new HttpAclBuilder.
sourcepub fn http(self, allow: bool) -> HttpAclBuilder
pub fn http(self, allow: bool) -> HttpAclBuilder
Sets whether HTTP is allowed.
sourcepub fn https(self, allow: bool) -> HttpAclBuilder
pub fn https(self, allow: bool) -> HttpAclBuilder
Sets whether HTTPS is allowed.
sourcepub fn private_ip_ranges(self, allow: bool) -> HttpAclBuilder
pub fn private_ip_ranges(self, allow: bool) -> HttpAclBuilder
Sets whether private IP ranges are allowed.
sourcepub fn method_acl_default(self, allow: bool) -> HttpAclBuilder
pub fn method_acl_default(self, allow: bool) -> HttpAclBuilder
Set default action for HTTP methods if no ACL match is found.
sourcepub fn host_acl_default(self, allow: bool) -> HttpAclBuilder
pub fn host_acl_default(self, allow: bool) -> HttpAclBuilder
Set default action for hosts if no ACL match is found.
sourcepub fn port_acl_default(self, allow: bool) -> HttpAclBuilder
pub fn port_acl_default(self, allow: bool) -> HttpAclBuilder
Set default action for ports if no ACL match is found.
sourcepub fn ip_acl_default(self, allow: bool) -> HttpAclBuilder
pub fn ip_acl_default(self, allow: bool) -> HttpAclBuilder
Set default action for IPs if no ACL match is found.
sourcepub fn url_path_acl_default(self, allow: bool) -> HttpAclBuilder
pub fn url_path_acl_default(self, allow: bool) -> HttpAclBuilder
Set default action for URL paths if no ACL match is found.
sourcepub fn add_allowed_method(
self,
method: impl Into<HttpRequestMethod>,
) -> Result<HttpAclBuilder, AddError>
pub fn add_allowed_method( self, method: impl Into<HttpRequestMethod>, ) -> Result<HttpAclBuilder, AddError>
Adds a method to the allowed methods.
sourcepub fn remove_allowed_method(
self,
method: impl Into<HttpRequestMethod>,
) -> HttpAclBuilder
pub fn remove_allowed_method( self, method: impl Into<HttpRequestMethod>, ) -> HttpAclBuilder
Removes a method from the allowed methods.
sourcepub fn allowed_methods(
self,
methods: Vec<impl Into<HttpRequestMethod>>,
) -> Result<HttpAclBuilder, AddError>
pub fn allowed_methods( self, methods: Vec<impl Into<HttpRequestMethod>>, ) -> Result<HttpAclBuilder, AddError>
Sets the allowed methods.
sourcepub fn clear_allowed_methods(self) -> HttpAclBuilder
pub fn clear_allowed_methods(self) -> HttpAclBuilder
Clears the allowed methods.
sourcepub fn add_denied_method(
self,
method: impl Into<HttpRequestMethod>,
) -> Result<HttpAclBuilder, AddError>
pub fn add_denied_method( self, method: impl Into<HttpRequestMethod>, ) -> Result<HttpAclBuilder, AddError>
Adds a method to the denied methods.
sourcepub fn remove_denied_method(
self,
method: impl Into<HttpRequestMethod>,
) -> HttpAclBuilder
pub fn remove_denied_method( self, method: impl Into<HttpRequestMethod>, ) -> HttpAclBuilder
Removes a method from the denied methods.
sourcepub fn denied_methods(
self,
methods: Vec<impl Into<HttpRequestMethod>>,
) -> Result<HttpAclBuilder, AddError>
pub fn denied_methods( self, methods: Vec<impl Into<HttpRequestMethod>>, ) -> Result<HttpAclBuilder, AddError>
Sets the denied methods.
sourcepub fn clear_denied_methods(self) -> HttpAclBuilder
pub fn clear_denied_methods(self) -> HttpAclBuilder
Clears the denied methods.
sourcepub fn add_allowed_host(self, host: String) -> Result<HttpAclBuilder, AddError>
pub fn add_allowed_host(self, host: String) -> Result<HttpAclBuilder, AddError>
Sets whether public IP ranges are allowed.
sourcepub fn remove_allowed_host(self, host: String) -> HttpAclBuilder
pub fn remove_allowed_host(self, host: String) -> HttpAclBuilder
Removes a host from the allowed hosts.
sourcepub fn allowed_hosts(
self,
hosts: Vec<String>,
) -> Result<HttpAclBuilder, AddError>
pub fn allowed_hosts( self, hosts: Vec<String>, ) -> Result<HttpAclBuilder, AddError>
Sets the allowed hosts.
sourcepub fn clear_allowed_hosts(self) -> HttpAclBuilder
pub fn clear_allowed_hosts(self) -> HttpAclBuilder
Clears the allowed hosts.
sourcepub fn add_denied_host(self, host: String) -> Result<HttpAclBuilder, AddError>
pub fn add_denied_host(self, host: String) -> Result<HttpAclBuilder, AddError>
Adds a host to the denied hosts.
sourcepub fn remove_denied_host(self, host: String) -> HttpAclBuilder
pub fn remove_denied_host(self, host: String) -> HttpAclBuilder
Removes a host from the denied hosts.
sourcepub fn denied_hosts(
self,
hosts: Vec<String>,
) -> Result<HttpAclBuilder, AddError>
pub fn denied_hosts( self, hosts: Vec<String>, ) -> Result<HttpAclBuilder, AddError>
Sets the denied hosts.
sourcepub fn clear_denied_hosts(self) -> HttpAclBuilder
pub fn clear_denied_hosts(self) -> HttpAclBuilder
Clears the denied hosts.
sourcepub fn add_allowed_port_range(
self,
port_range: RangeInclusive<u16>,
) -> Result<HttpAclBuilder, AddError>
pub fn add_allowed_port_range( self, port_range: RangeInclusive<u16>, ) -> Result<HttpAclBuilder, AddError>
Adds a port range to the allowed port ranges.
sourcepub fn remove_allowed_port_range(
self,
port_range: RangeInclusive<u16>,
) -> HttpAclBuilder
pub fn remove_allowed_port_range( self, port_range: RangeInclusive<u16>, ) -> HttpAclBuilder
Removes a port range from the allowed port ranges.
sourcepub fn allowed_port_ranges(
self,
port_ranges: Vec<RangeInclusive<u16>>,
) -> Result<HttpAclBuilder, AddError>
pub fn allowed_port_ranges( self, port_ranges: Vec<RangeInclusive<u16>>, ) -> Result<HttpAclBuilder, AddError>
Sets the allowed port ranges.
sourcepub fn clear_allowed_port_ranges(self) -> HttpAclBuilder
pub fn clear_allowed_port_ranges(self) -> HttpAclBuilder
Clears the allowed port ranges.
sourcepub fn add_denied_port_range(
self,
port_range: RangeInclusive<u16>,
) -> Result<HttpAclBuilder, AddError>
pub fn add_denied_port_range( self, port_range: RangeInclusive<u16>, ) -> Result<HttpAclBuilder, AddError>
Adds a port range to the denied port ranges.
sourcepub fn remove_denied_port_range(
self,
port_range: RangeInclusive<u16>,
) -> HttpAclBuilder
pub fn remove_denied_port_range( self, port_range: RangeInclusive<u16>, ) -> HttpAclBuilder
Removes a port range from the denied port ranges.
sourcepub fn denied_port_ranges(
self,
port_ranges: Vec<RangeInclusive<u16>>,
) -> Result<HttpAclBuilder, AddError>
pub fn denied_port_ranges( self, port_ranges: Vec<RangeInclusive<u16>>, ) -> Result<HttpAclBuilder, AddError>
Sets the denied port ranges.
sourcepub fn clear_denied_port_ranges(self) -> HttpAclBuilder
pub fn clear_denied_port_ranges(self) -> HttpAclBuilder
Clears the denied port ranges.
sourcepub fn add_allowed_ip_range<Ip>(
self,
ip_range: Ip,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
pub fn add_allowed_ip_range<Ip>(
self,
ip_range: Ip,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
Adds an IP range to the allowed IP ranges.
sourcepub fn remove_allowed_ip_range<Ip>(
self,
ip_range: Ip,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
pub fn remove_allowed_ip_range<Ip>(
self,
ip_range: Ip,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
Removes an IP range from the allowed IP ranges.
sourcepub fn allowed_ip_ranges<Ip>(
self,
ip_ranges: Vec<Ip>,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
pub fn allowed_ip_ranges<Ip>(
self,
ip_ranges: Vec<Ip>,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
Sets the allowed IP ranges.
sourcepub fn clear_allowed_ip_ranges(self) -> HttpAclBuilder
pub fn clear_allowed_ip_ranges(self) -> HttpAclBuilder
Clears the allowed IP ranges.
sourcepub fn add_denied_ip_range<Ip>(
self,
ip_range: Ip,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
pub fn add_denied_ip_range<Ip>(
self,
ip_range: Ip,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
Adds an IP range to the denied IP ranges.
sourcepub fn remove_denied_ip_range<Ip>(
self,
ip_range: Ip,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
pub fn remove_denied_ip_range<Ip>(
self,
ip_range: Ip,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
Removes an IP range from the denied IP ranges.
sourcepub fn denied_ip_ranges<Ip>(
self,
ip_ranges: Vec<Ip>,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
pub fn denied_ip_ranges<Ip>(
self,
ip_ranges: Vec<Ip>,
) -> Result<HttpAclBuilder, AddError>where
Ip: IntoIpRange,
Sets the denied IP ranges.
sourcepub fn clear_denied_ip_ranges(self) -> HttpAclBuilder
pub fn clear_denied_ip_ranges(self) -> HttpAclBuilder
Clears the denied IP ranges.
sourcepub fn add_static_dns_mapping(
self,
host: String,
sock_addr: SocketAddr,
) -> Result<HttpAclBuilder, AddError>
pub fn add_static_dns_mapping( self, host: String, sock_addr: SocketAddr, ) -> Result<HttpAclBuilder, AddError>
Add a static DNS mapping.
sourcepub fn remove_static_dns_mapping(self, host: &str) -> HttpAclBuilder
pub fn remove_static_dns_mapping(self, host: &str) -> HttpAclBuilder
Removes a static DNS mapping.
sourcepub fn static_dns_mappings(
self,
mappings: HashMap<String, SocketAddr>,
) -> Result<HttpAclBuilder, AddError>
pub fn static_dns_mappings( self, mappings: HashMap<String, SocketAddr>, ) -> Result<HttpAclBuilder, AddError>
Sets the static DNS mappings.
sourcepub fn clear_static_dns_mappings(self) -> HttpAclBuilder
pub fn clear_static_dns_mappings(self) -> HttpAclBuilder
Clears the static DNS mappings.
sourcepub fn add_allowed_url_path(
self,
url_path: String,
) -> Result<HttpAclBuilder, AddError>
pub fn add_allowed_url_path( self, url_path: String, ) -> Result<HttpAclBuilder, AddError>
Adds a URL path to the allowed URL paths.
sourcepub fn remove_allowed_url_path(self, url_path: &str) -> HttpAclBuilder
pub fn remove_allowed_url_path(self, url_path: &str) -> HttpAclBuilder
Removes a URL path from the allowed URL paths.
sourcepub fn allowed_url_paths(
self,
url_paths: Vec<String>,
) -> Result<HttpAclBuilder, AddError>
pub fn allowed_url_paths( self, url_paths: Vec<String>, ) -> Result<HttpAclBuilder, AddError>
Sets the allowed URL paths.
sourcepub fn clear_allowed_url_paths(self) -> HttpAclBuilder
pub fn clear_allowed_url_paths(self) -> HttpAclBuilder
Clears the allowed URL paths.
sourcepub fn add_denied_url_path(
self,
url_path: String,
) -> Result<HttpAclBuilder, AddError>
pub fn add_denied_url_path( self, url_path: String, ) -> Result<HttpAclBuilder, AddError>
Adds a URL path to the denied URL paths.
sourcepub fn remove_denied_url_path(self, url_path: &str) -> HttpAclBuilder
pub fn remove_denied_url_path(self, url_path: &str) -> HttpAclBuilder
Removes a URL path from the denied URL paths.
sourcepub fn denied_url_paths(
self,
url_paths: Vec<String>,
) -> Result<HttpAclBuilder, AddError>
pub fn denied_url_paths( self, url_paths: Vec<String>, ) -> Result<HttpAclBuilder, AddError>
Sets the denied URL paths.
sourcepub fn clear_denied_url_paths(self) -> HttpAclBuilder
pub fn clear_denied_url_paths(self) -> HttpAclBuilder
Clears the denied URL paths.
Trait Implementations§
source§impl Clone for HttpAclBuilder
impl Clone for HttpAclBuilder
source§fn clone(&self) -> HttpAclBuilder
fn clone(&self) -> HttpAclBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for HttpAclBuilder
impl Debug for HttpAclBuilder
source§impl Default for HttpAclBuilder
impl Default for HttpAclBuilder
source§fn default() -> HttpAclBuilder
fn default() -> HttpAclBuilder
source§impl PartialEq for HttpAclBuilder
impl PartialEq for HttpAclBuilder
Auto Trait Implementations§
impl !Freeze for HttpAclBuilder
impl !RefUnwindSafe for HttpAclBuilder
impl Send for HttpAclBuilder
impl Sync for HttpAclBuilder
impl Unpin for HttpAclBuilder
impl UnwindSafe for HttpAclBuilder
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)