#[non_exhaustive]pub enum RssError {
Show 15 variants
XmlWriteError(Error),
XmlParseError(Error),
Utf8Error(FromUtf8Error),
MissingField(String),
DateParseError(String),
IoError(Error),
InvalidInput(String),
InvalidUrl(String),
UnknownElement(String),
ValidationErrors(Vec<String>),
DateSortError(Vec<DateSortError>),
ItemValidationError(String),
UnknownField(String),
Custom(String),
InvalidRssVersion(String),
}
Expand description
Errors that can occur when generating or parsing RSS feeds.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
XmlWriteError(Error)
Error occurred while writing XML.
XmlParseError(Error)
Error occurred during XML parsing.
Utf8Error(FromUtf8Error)
Error occurred during UTF-8 conversion.
MissingField(String)
Error indicating a required field is missing.
DateParseError(String)
Error indicating a date parsing failure.
IoError(Error)
General I/O error.
InvalidInput(String)
Error for invalid input data.
InvalidUrl(String)
Error for invalid URL provided.
UnknownElement(String)
Error for unknown XML elements encountered during parsing.
ValidationErrors(Vec<String>)
Error for validation errors.
DateSortError(Vec<DateSortError>)
Error for date sort errors.
ItemValidationError(String)
Error for item validation errors.
UnknownField(String)
Error for unknown field encountered during parsing.
Custom(String)
Custom error for unforeseen scenarios.
InvalidRssVersion(String)
Error for invalid RSS version.
Implementations§
Source§impl RssError
impl RssError
Sourcepub fn missing_field<S: Into<String>>(field_name: S) -> Self
pub fn missing_field<S: Into<String>>(field_name: S) -> Self
Sourcepub fn date_sort_error<S: Into<String>>(
index: usize,
message: S,
) -> DateSortError
pub fn date_sort_error<S: Into<String>>( index: usize, message: S, ) -> DateSortError
Sourcepub fn invalid_input<S: Into<String>>(message: S) -> Self
pub fn invalid_input<S: Into<String>>(message: S) -> Self
Sourcepub fn log(&self)
pub fn log(&self)
Logs the error using the log
crate.
This method logs the error at the error level. It uses the log
crate,
so the application using this library should configure a logger.
Sourcepub fn to_http_status(&self) -> u16
pub fn to_http_status(&self) -> u16
Converts the RssError
into an appropriate HTTP status code.
This method is useful when the library is used in web services.
§Returns
Returns a u16
representing an HTTP status code.