pub trait FromEventsBuilder {
type Output;
// Required method
fn feed(
&mut self,
ev: Event,
ctx: &Context<'_>,
) -> Result<Option<Self::Output>, Error>;
}Expand description
Trait for a temporary object allowing to construct a struct from
rxml::Event items.
Objects of this type are generally constructed through
FromXml::from_events and are used to build Rust structs or enums from
XML data. The XML data must be fed as rxml::Event to the
feed method.
Required Associated Types§
Required Methods§
Sourcefn feed(
&mut self,
ev: Event,
ctx: &Context<'_>,
) -> Result<Option<Self::Output>, Error>
fn feed( &mut self, ev: Event, ctx: &Context<'_>, ) -> Result<Option<Self::Output>, Error>
Feed another rxml::Event into the element construction
process.
Once the construction process completes, Ok(Some(_)) is returned.
When valid data has been fed but more events are needed to fully
construct the resulting struct, Ok(None) is returned.
If the construction fails, Err(_) is returned. Errors are generally
fatal and the builder should be assumed to be broken at that point.
Feeding more events after an error may result in panics, errors or
inconsistent result data, though it may never result in unsound or
unsafe behaviour.
Implementations on Foreign Types§
Source§impl<T: FromEventsBuilder + ?Sized> FromEventsBuilder for Box<T>
impl<T: FromEventsBuilder + ?Sized> FromEventsBuilder for Box<T>
Implementors§
Source§impl FromEventsBuilder for ElementFromEvents
Available on crate feature minidom only.
impl FromEventsBuilder for ElementFromEvents
minidom only.Source§impl<E, T: TryFrom<Element, Error = E>> FromEventsBuilder for FromEventsViaElement<T>
Available on crate feature minidom only.
impl<E, T: TryFrom<Element, Error = E>> FromEventsBuilder for FromEventsViaElement<T>
minidom only.