[][src]Struct abuseipdb::Client

pub struct Client { /* fields omitted */ }

The AbuseIPDB client.

Methods

impl Client[src]

pub fn new<S: Into<String>>(api_key: S) -> Self[src]

Create a new AbuseIPDB client with the given API key and default settings.

pub fn builder() -> ClientBuilder[src]

Returns a AbuseIPDB client builder.

pub async fn check<'_>(
    &'_ self,
    ip_addr: IpAddr,
    max_age_in_days: Option<u16>,
    verbose: bool
) -> Result<Response<Check>, Error>
[src]

Queries AbuseIPDB given a IP address.

The check endpoint accepts a single IP address (v4 or v6). Optionally you may set the max_age_in_days parameter to only return reports within the last x amount of days.

pub async fn check_block<'_, '_>(
    &'_ self,
    network: &'_ str,
    max_age_in_days: Option<u16>
) -> Result<Response<BlockCheck>, Error>
[src]

Queries AbuseIPDB given a subnet.

The check-block endpoint accepts a subnet (v4 or v6) denoted with CIDR notation.

pub async fn blacklist<'_>(
    &'_ self,
    confidence_min: Option<u8>,
    limit: Option<u32>,
    for_self: bool
) -> Result<Response<Blacklist>, Error>
[src]

Queries AbuseIPDB for the blacklist.

The blacklist is the culmination of all of the valiant reporting by AbuseIPDB users. It's a list of the most reported IP addresses.

pub async fn report<'_, '_, '_>(
    &'_ self,
    ip_addr: IpAddr,
    categories: &'_ [Category],
    comment: Option<&'_ str>
) -> Result<Response<AddressAbuse>, Error>
[src]

Reports an IP address to AbuseIPDB.

At least one category is required.

Auto Trait Implementations

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

impl !RefUnwindSafe for Client

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]