pub struct BannedPeers(/* private fields */);
Expand description
Contains the set of peers currently banned by IP.
Implementations§
Source§impl BannedPeers
impl BannedPeers
Sourcepub fn is_ip_banned(&self, ip: &IpAddr) -> bool
pub fn is_ip_banned(&self, ip: &IpAddr) -> bool
Check whether the given IP address is currently banned.
Sourcepub fn get_banned_ips(&self) -> Vec<IpAddr>
pub fn get_banned_ips(&self) -> Vec<IpAddr>
Get all banned IPs.
Sourcepub fn get_ban_config(&self, ip: IpAddr) -> Option<BanDetails>
pub fn get_ban_config(&self, ip: IpAddr) -> Option<BanDetails>
Get ban config for the given IP address.
Sourcepub fn update_ip_ban(&self, ip: IpAddr)
pub fn update_ip_ban(&self, ip: IpAddr)
Insert or update a banned IP.
Sourcepub fn remove_old_bans(&self, ban_time_in_secs: u64)
pub fn remove_old_bans(&self, ban_time_in_secs: u64)
Remove the expired entries
Trait Implementations§
Source§impl Default for BannedPeers
impl Default for BannedPeers
Source§fn default() -> BannedPeers
fn default() -> BannedPeers
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for BannedPeers
impl !RefUnwindSafe for BannedPeers
impl Send for BannedPeers
impl Sync for BannedPeers
impl Unpin for BannedPeers
impl UnwindSafe for BannedPeers
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