Skip to main content

GeoIpError

Type Alias GeoIpError 

Source
pub type GeoIpError = MaxMindDbError;
Expand description

An error in the GeoIpLookup.

Aliased Type§

pub enum GeoIpError {
    InvalidDatabase {
        message: String,
        offset: Option<usize>,
    },
    Io(Error),
    Mmap(Error),
    Decoding {
        message: String,
        offset: Option<usize>,
        path: Option<String>,
    },
    ResourceLimit {
        message: String,
        offset: Option<usize>,
        path: Option<String>,
    },
    InvalidNetwork(IpNetworkError),
    InvalidInput {
        message: String,
    },
}

Variants§

§

InvalidDatabase

The database file is invalid or corrupted.

Fields

§message: String

Description of what is invalid.

§offset: Option<usize>

Byte offset where the error was detected. Reader operations report an absolute database-file offset; decoding a standalone section reports an offset relative to that input.

§

Io(Error)

An I/O error occurred while reading the database.

§

Mmap(Error)

Memory mapping failed.

§

Decoding

Error decoding data from the database.

Fields

§message: String

Description of the decoding error.

§offset: Option<usize>

Byte offset relative to the section being decoded: the data section for records, or the metadata value after its marker for metadata.

§path: Option<String>

JSON-pointer-like path to the field (e.g., “/city/names/en”).

§

ResourceLimit

Decoding or verification stopped because it exceeded an expansion or work safety limit.

This does not necessarily mean that the database is structurally invalid. Schema-specific limits reported by a custom Serde visitor use [MaxMindDbError::Decoding] instead. Applications may choose a narrower schema or reject the database as untrusted input.

Fields

§message: String

Description of the limit that was exceeded.

§offset: Option<usize>

Byte offset relative to the section being decoded: the data section for records, or the metadata value after its marker for metadata.

§path: Option<String>

JSON-pointer-like path to the field (e.g., “/subdivisions”).

§

InvalidNetwork(IpNetworkError)

The provided network/CIDR is invalid.

§

InvalidInput

The provided input is invalid for this operation.

Fields

§message: String

Description of what is invalid about the input.