pub enum XdbError {
InvalidIP(String),
InvalidIPVersion(String),
InvalidUtf8,
HeaderParseError(String),
RangeIndexOutError(String),
AddrParseError(AddrParseError),
ParseIntError(ParseIntError),
IoError(Error),
SliceError(TryFromSliceError),
}Expand description
All errors returned by xdb-parse operations.
Wraps I/O errors, parsing errors, invalid input, and corrupt data.
Uses thiserror for automatic std::fmt::Display and std::error::Error impls.
Variants§
InvalidIP(String)
The input string could not be parsed as an IP address or numeric value.
InvalidIPVersion(String)
The xdb file version could not be determined.
InvalidUtf8
Region data in the xdb file is not valid UTF-8.
HeaderParseError(String)
Header parsing failed.
RangeIndexOutError(String)
Index access out of range (corrupt or truncated file).
AddrParseError(AddrParseError)
Wraps std::net::AddrParseError.
ParseIntError(ParseIntError)
Wraps std::num::ParseIntError.
IoError(Error)
Wraps std::io::Error.
SliceError(TryFromSliceError)
Wraps std::array::TryFromSliceError — typically from corrupt data.
Trait Implementations§
Source§impl Error for XdbError
impl Error for XdbError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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()
Source§impl From<AddrParseError> for XdbError
impl From<AddrParseError> for XdbError
Source§fn from(source: AddrParseError) -> Self
fn from(source: AddrParseError) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for XdbError
impl From<ParseIntError> for XdbError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl From<TryFromSliceError> for XdbError
impl From<TryFromSliceError> for XdbError
Source§fn from(source: TryFromSliceError) -> Self
fn from(source: TryFromSliceError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for XdbError
impl !RefUnwindSafe for XdbError
impl Send for XdbError
impl Sync for XdbError
impl Unpin for XdbError
impl UnsafeUnpin for XdbError
impl !UnwindSafe for XdbError
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