pub struct CFIPs {
pub ipsv4: Vec<String>,
pub ipsv6: Vec<String>,
}
Fields§
§ipsv4: Vec<String>
§ipsv6: Vec<String>
Implementations§
Source§impl CFIPs
impl CFIPs
Sourcepub fn check_ip_v4(&self, ip: &str) -> bool
pub fn check_ip_v4(&self, ip: &str) -> bool
Checks if an IPv4 is CF’s. #Example:
use cfd::cf_ips::CFIPs;
#[tokio::main]
async fn main(){
let cf_ips = CFIPs::load().await.unwrap();
assert!(cf_ips.check_ip_v4("131.0.72.1"));
}
Sourcepub fn check_ip_in_cidr(ip: &str, cidr_range: &str) -> bool
pub fn check_ip_in_cidr(ip: &str, cidr_range: &str) -> bool
Checks if an IPv4 address is in a given CIDR range #Example:
use cfd::cf_ips::CFIPs;
assert!(CFIPs::check_ip_in_cidr("131.0.72.1", "131.0.72.0/22"));
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CFIPs
impl RefUnwindSafe for CFIPs
impl Send for CFIPs
impl Sync for CFIPs
impl Unpin for CFIPs
impl UnwindSafe for CFIPs
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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