Trait FixedElementState

Source
pub trait FixedElementState: Default {
    type Output: Sized;

    const TAG: &'static str;

    // Required method
    fn parse_element_finish(self) -> Result<Self::Output>;

    // Provided methods
    fn parse_element_attribute(
        &mut self,
        key: &str,
        value: Cow<'_, str>,
    ) -> Result<()> { ... }
    fn parse_element_inner_text(&mut self, text: Cow<'_, str>) -> Result<()> { ... }
    fn parse_element_inner_node<P: ElementParser>(
        &mut self,
        tag: &str,
        parser: P,
    ) -> Result<()> { ... }
}
Expand description

Convenience trait to implement instead of ElementState if your element has a fixed tag.

Required Associated Constants§

Source

const TAG: &'static str

Fixed tag

Required Associated Types§

Source

type Output: Sized

Same as ElementState::Output

Required Methods§

Source

fn parse_element_finish(self) -> Result<Self::Output>

Same as ElementState::parse_element_finish

Provided Methods§

Source

fn parse_element_attribute( &mut self, key: &str, value: Cow<'_, str>, ) -> Result<()>

Same as ElementState::parse_element_attribute

Source

fn parse_element_inner_text(&mut self, text: Cow<'_, str>) -> Result<()>

Same as ElementState::parse_element_inner_text

Source

fn parse_element_inner_node<P: ElementParser>( &mut self, tag: &str, parser: P, ) -> Result<()>

Same as ElementState::parse_element_inner_node

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§