Releases: oschwald/maxminddb-rust
Releases · oschwald/maxminddb-rust
0.26.0
- BREAKING CHANGE: The
lookup
andlookup_prefix
methods now return
Ok(None)
orOk((None, prefix_len))
respectively when an IP address is
valid but not found in the database (or has no associated data record),
instead of returning anErr(MaxMindDbError::AddressNotFoundError)
.
Code previously matching onAddressNotFoundError
must be updated to
handle theOk(None)
/Ok((None, prefix_len))
variants. - BREAKING CHANGE: The
MaxMindDBError
enum has been renamed
MaxMindDbError
and variants have been renamed and refactored. For
example,IoError
is nowIo
,InvalidDatabaseError
is now
InvalidDatabase
,DecodingError
is nowDecoding
,
InvalidNetworkError
is nowInvalidNetwork
. TheMapError
variant has
been replaced byMmap
(under themmap
feature flag). Code explicitly
matching on the old variant names must be updated. - BREAKING CHANGE:
MaxMindDbError
no longer implementsPartialEq
.
This is because underlying error types likestd::io::Error
(now
wrapped by theIo
andMmap
variants) do not implementPartialEq
.
Code comparing errors directly using==
orassert_eq!
must be
updated, typically by usingmatches!
or by matching on the error
kind and potentially its contents. - Refactored
MaxMindDbError
handling using thethiserror
crate.
Variants likeIo
,Mmap
, andInvalidNetwork
now directly wrap
the underlying error types (std::io::Error
,ipnetwork::IpNetworkError
). - Errors wrapping underlying types (
Io
,Mmap
,InvalidNetwork
) now
correctly implementstd::error::Error::source()
, allowing inspection
of the original cause. - The
Display
implementation forMaxMindDbError
has been refined to
generally show only the specific error details, often including the
message from the source error, rather than prefixing with the variant
name. lookup_prefix
now returns the prefix length of the entry even when the
value is not found.- Fixed an internal bounds checking error when resolving data pointers.
The previous logic could cause a panic on a corrupt database.
0.25.0
- Serde will now skip serialization of the GeoIP2 struct fields
whenOption
is none. Pull request by Stefan Sundin. GitHub #79. Serialize
andClone
were added to theMetadata
struct. Pull
request by Stefan Sundin. GitHub #80.- Added feature to use
simdutf8
as a faster alternative when
unsafe-str-decode
is too risky. Pull request by Jakub Onderka.
GitHub #88. - Minor internal refactoring and performance improvements.
0.24.0
0.23.0
0.22.0
- A
within
method has been added to the reader to allow iterating
over all records in the database. Pull request by Ross McFarland.
Github #50. - Database structs in
maxminddb::geoip2
have been updated. Most
noticeably, anEnterprise
struct has been added and themodel
module has been replaced bycity
andcountry
modules. Also,
several missing fields have been added. Mmap
is now re-exported for convenience. Pull request by zhuhaow.
GitHub #54.- Upgraded memmap2 dependency.