pub enum BgpkitCommonsError {
Show 13 variants
ModuleNotLoaded {
module: &'static str,
load_method: &'static str,
},
ModuleNotConfigured {
module: &'static str,
requirement: &'static str,
load_method: &'static str,
},
DataSourceError {
data_source: String,
details: String,
},
InvalidFormat {
data_type: &'static str,
input: String,
reason: String,
},
FeatureNotEnabled {
feature: &'static str,
},
NetworkError(Error),
JsonError(Error),
ChronoError(ParseError),
IpNetError(AddrParseError),
OneIoError(OneIoError),
ParseIntError(ParseIntError),
ParseFloatError(ParseFloatError),
Internal(String),
}Expand description
Main error type for bgpkit-commons operations
Variants§
ModuleNotLoaded
Error when trying to access data from a module that hasn’t been loaded yet
ModuleNotConfigured
Error when trying to access specific functionality that requires additional configuration
DataSourceError
Error when external data sources are unavailable or return invalid data
InvalidFormat
Error when input data format is invalid
FeatureNotEnabled
Error when required features are not enabled
NetworkError(Error)
Network or I/O related errors
JsonError(Error)
JSON parsing errors
ChronoError(ParseError)
Date/time parsing errors
IpNetError(AddrParseError)
IP network parsing errors
OneIoError(OneIoError)
OneIO errors (file/network operations)
ParseIntError(ParseIntError)
Parsing errors (int, float, etc.)
ParseFloatError(ParseFloatError)
Parsing errors (int, float, etc.)
Internal(String)
Generic error for cases not covered by specific error types
Implementations§
Source§impl BgpkitCommonsError
impl BgpkitCommonsError
Sourcepub fn module_not_loaded(
module: &'static str,
load_method: &'static str,
) -> Self
pub fn module_not_loaded( module: &'static str, load_method: &'static str, ) -> Self
Create a module not loaded error
Sourcepub fn module_not_configured(
module: &'static str,
requirement: &'static str,
load_method: &'static str,
) -> Self
pub fn module_not_configured( module: &'static str, requirement: &'static str, load_method: &'static str, ) -> Self
Create a module not configured error
Sourcepub fn data_source_error(
source: impl Into<String>,
details: impl Into<String>,
) -> Self
pub fn data_source_error( source: impl Into<String>, details: impl Into<String>, ) -> Self
Create a data source error
Sourcepub fn invalid_format(
data_type: &'static str,
input: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn invalid_format( data_type: &'static str, input: impl Into<String>, reason: impl Into<String>, ) -> Self
Create an invalid format error
Sourcepub fn feature_not_enabled(feature: &'static str) -> Self
pub fn feature_not_enabled(feature: &'static str) -> Self
Create a feature not enabled error
Trait Implementations§
Source§impl Debug for BgpkitCommonsError
impl Debug for BgpkitCommonsError
Source§impl Display for BgpkitCommonsError
impl Display for BgpkitCommonsError
Source§impl Error for BgpkitCommonsError
impl Error for BgpkitCommonsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<AddrParseError> for BgpkitCommonsError
impl From<AddrParseError> for BgpkitCommonsError
Source§fn from(source: AddrParseError) -> Self
fn from(source: AddrParseError) -> Self
Source§impl From<Error> for BgpkitCommonsError
impl From<Error> for BgpkitCommonsError
Source§impl From<Error> for BgpkitCommonsError
impl From<Error> for BgpkitCommonsError
Source§impl From<OneIoError> for BgpkitCommonsError
impl From<OneIoError> for BgpkitCommonsError
Source§fn from(source: OneIoError) -> Self
fn from(source: OneIoError) -> Self
Source§impl From<ParseError> for BgpkitCommonsError
impl From<ParseError> for BgpkitCommonsError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Source§impl From<ParseFloatError> for BgpkitCommonsError
impl From<ParseFloatError> for BgpkitCommonsError
Source§fn from(source: ParseFloatError) -> Self
fn from(source: ParseFloatError) -> Self
Source§impl From<ParseIntError> for BgpkitCommonsError
impl From<ParseIntError> for BgpkitCommonsError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Auto Trait Implementations§
impl Freeze for BgpkitCommonsError
impl !RefUnwindSafe for BgpkitCommonsError
impl Send for BgpkitCommonsError
impl Sync for BgpkitCommonsError
impl Unpin for BgpkitCommonsError
impl !UnwindSafe for BgpkitCommonsError
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.