pub trait ElementHandler: Send + Sync {
// Required method
fn handle_element(
&self,
name: &str,
text: &str,
attributes: &[(String, String)],
) -> Result<()>;
}
Expand description
A trait for custom element handlers, supporting RSS extensions.
Implement this trait to provide custom parsing logic for specific RSS elements.
Required Methods§
Sourcefn handle_element(
&self,
name: &str,
text: &str,
attributes: &[(String, String)],
) -> Result<()>
fn handle_element( &self, name: &str, text: &str, attributes: &[(String, String)], ) -> Result<()>
Handle a specific RSS element.
This function processes a single RSS element and performs necessary operations based on the element’s name, text content, and attributes.
§Arguments
name
- The name of the RSS element.text
- The text content of the RSS element.attributes
- A slice containing the attributes of the RSS element.
§Returns
This function returns a Result<()>
indicating the success or failure of
the handling operation.
§Errors
This function will return an Err
in the following situations:
- If there is an issue with processing the element, such as invalid attributes, unexpected element names, or a failure in custom parsing logic.