#[non_exhaustive]pub enum ErrorCode {
Show 20 variants
BadRequest,
DisabledApiKey,
ForbiddenIp,
ForbiddenOrigin,
ForbiddenIpOrigin,
Internal,
InsufficientCredits,
InvalidApiKey,
InvalidAsn,
InvalidFilterSyntax,
InvalidIpAddress,
MissingApiKey,
ReservedAsn,
ReservedIpAddress,
TooManyAsns,
TooManyIps,
TooManyRequests,
TooManyUserAgents,
UnknownAsn,
Other(String),
}Expand description
A strongly typed Ipregistry API error code. It lets callers branch on error conditions without matching on raw strings. See https://ipregistry.co/docs/errors for the authoritative list.
Codes not known to this version of the crate are preserved verbatim in
ErrorCode::Other.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadRequest
The request is malformed.
DisabledApiKey
The API key exists but is disabled.
ForbiddenIp
Lookups for this IP address are not allowed for the API key.
ForbiddenOrigin
Requests from this origin are not allowed for the API key.
ForbiddenIpOrigin
Requests from this IP address or origin are not allowed.
Internal
The API encountered an internal error.
InsufficientCredits
The account has no credits left.
InvalidApiKey
The API key is not valid.
InvalidAsn
The requested Autonomous System Number is malformed.
InvalidFilterSyntax
The fields selection expression is malformed.
InvalidIpAddress
The requested IP address is malformed.
MissingApiKey
No API key was supplied.
ReservedAsn
The requested Autonomous System Number is reserved.
ReservedIpAddress
The requested IP address is reserved (private, loopback, …).
TooManyAsns
The batch request contains more ASNs than allowed.
TooManyIps
The batch request contains more IP addresses than allowed.
TooManyRequests
The API key is rate limited and the limit was exceeded.
TooManyUserAgents
The request contains more User-Agent strings than allowed.
UnknownAsn
The requested Autonomous System Number is unknown.
Other(String)
An error code this version of the crate does not know about, preserved verbatim.
Implementations§
Trait Implementations§
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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§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
key and return true if they are equal.