#[non_exhaustive]pub enum OpenError {
Open(Error),
Mmap(Error),
InvalidMagic,
UnsupportedVersion(u8),
CouldntReadHeader,
InvalidAsRange,
InvalidNetworkRange,
InvalidNetworkNodeRange,
InvalidCountryRange,
InvalidStringPoolRange,
}
Expand description
Error type for the Locations::open
function.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Open(Error)
Error opening database file.
The file might not exist or you might not have permissions to read it.
The inner error is the one returned from std::fs::File::open
.
Mmap(Error)
Error memory-mapping database file.
InvalidMagic
Invalid database file magic, likely not the correct format.
UnsupportedVersion(u8)
Unsupported database version.
CouldntReadHeader
Couldn’t read database file header, database corrupted.
InvalidAsRange
Invalid database header field: as
, database corrupted.
InvalidNetworkRange
Invalid database header field: network
, database corrupted.
InvalidNetworkNodeRange
Invalid database header field: network_node
, database corrupted.
InvalidCountryRange
Invalid database header field: country
, database corrupted.
InvalidStringPoolRange
Invalid database header field: string_pool
, database corrupted.
Trait Implementations§
source§impl Error for OpenError
impl Error for OpenError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for OpenError
impl Send for OpenError
impl Sync for OpenError
impl Unpin for OpenError
impl !UnwindSafe for OpenError
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
Mutably borrows from an owned value. Read more