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§
Required Associated Types§
Required Methods§
Sourcefn parse_element_finish(self) -> Result<Self::Output>
fn parse_element_finish(self) -> Result<Self::Output>
Same as ElementState::parse_element_finish
Provided Methods§
Sourcefn parse_element_attribute(
&mut self,
key: &str,
value: Cow<'_, str>,
) -> Result<()>
fn parse_element_attribute( &mut self, key: &str, value: Cow<'_, str>, ) -> Result<()>
Same as ElementState::parse_element_attribute
Sourcefn parse_element_inner_text(&mut self, text: Cow<'_, str>) -> Result<()>
fn parse_element_inner_text(&mut self, text: Cow<'_, str>) -> Result<()>
Same as ElementState::parse_element_inner_text
Sourcefn parse_element_inner_node<P: ElementParser>(
&mut self,
tag: &str,
parser: P,
) -> Result<()>
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.