pub struct IpBlockList {
blocked_ips: HashSet<IpAddr>,
blocked_cidrs: HashSet<IpCidr>,
}
Expand description
The IP blocklist
Fields§
§blocked_ips: HashSet<IpAddr>
§blocked_cidrs: HashSet<IpCidr>
Implementations§
Source§impl IpBlockList
impl IpBlockList
Sourcepub fn load_from_vec(&mut self, ip_list: Vec<&str>)
pub fn load_from_vec(&mut self, ip_list: Vec<&str>)
Loads the block list from a vector of IP address strings
Sourcepub fn is_blocked(&self, ip: IpAddr) -> bool
pub fn is_blocked(&self, ip: IpAddr) -> bool
Checks if an IP address is blocked
Trait Implementations§
Source§impl Clone for IpBlockList
impl Clone for IpBlockList
Source§fn clone(&self) -> IpBlockList
fn clone(&self) -> IpBlockList
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 IpBlockList
impl Debug for IpBlockList
Source§impl Default for IpBlockList
impl Default for IpBlockList
Source§impl PartialEq for IpBlockList
impl PartialEq for IpBlockList
impl Eq for IpBlockList
impl StructuralPartialEq for IpBlockList
Auto Trait Implementations§
impl Freeze for IpBlockList
impl RefUnwindSafe for IpBlockList
impl Send for IpBlockList
impl Sync for IpBlockList
impl Unpin for IpBlockList
impl UnwindSafe for IpBlockList
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.