[][src]Trait xml_data::parser::InnerState

pub trait InnerState: Default {
    type Output: Sized;
    fn parse_inner_finish(self) -> Result<Self::Output>;

    fn parse_inner_node<P: ElementParser>(
        &mut self,
        tag: &str,
        parser: P
    ) -> Result<InnerParseResult<P>> { ... }
fn parse_inner_text<'t>(
        &mut self,
        text: Cow<'t, str>
    ) -> Result<InnerParseResult<Cow<'t, str>>> { ... } }

State to parse multiple elements (on the same level)

Associated Types

type Output: Sized

Once fully parsed this is the resulting output type.

Loading content...

Required methods

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

Finish parsing.

Loading content...

Provided methods

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

Try parsing an element with the given tag

Should not fail if it doesn't recognize the tag; instead it needs to return the parser.

fn parse_inner_text<'t>(
    &mut self,
    text: Cow<'t, str>
) -> Result<InnerParseResult<Cow<'t, str>>>

Try parsing inner text

Should not fail if it doesn't take text (but may fail if it does but can't parse it).

Loading content...

Implementations on Foreign Types

impl InnerState for String[src]

Using String as InnerState to collect all inner text in it (including whitespace in input)

type Output = Self

impl<'_> InnerState for Cow<'_, str>[src]

type Output = Self

Loading content...

Implementors

impl<E: ElementState> InnerState for ParseElementList<E>[src]

type Output = Vec<E::Output>

impl<E: ElementState> InnerState for ParseElementOnce<E>[src]

type Output = E::Output

impl<E: ElementState> InnerState for ParseElementOptional<E>[src]

type Output = Option<E::Output>

impl<I: InnerState> InnerState for ParseInnerOptional<I>[src]

type Output = Option<I::Output>

Loading content...