use quick_xml::events::Event; pub trait Parser: Sized { type Output; fn consume<'a>(self: Self, event: &Event<'a>) -> Continuation; } pub enum Continuation { Final(Res), Continue(Parser), } macro_rules! fail_fast { ($errorable: expr) => { match $errorable { Ok(i) => i, Err(e) => return Continuation::Final(Err(e.into())), } }; } pub(crate) use fail_fast;