xavier-internal 0.1.7

Internal module of Xavier. Xavier is a lightweight and versatile XML parsing library designed to streamline the process of handling XML data with ease and efficiency.
Documentation
use quick_xml::events::BytesStart;
use quick_xml::Reader;

use crate::deserialize::error::PError;

pub trait WrapWith<F, T> {
    fn wrap(self) -> Option<F>;
}

impl<T, F> WrapWith<F, Option<T>> for Option<T>
where
    F: From<T>,
{
    fn wrap(self) -> Option<F> {
        self.map(F::from)
    }
}

pub trait XmlDeserializable {
    fn from_xml(reader: &mut Reader<&[u8]>, event: Option<&BytesStart>, tag_name: Option<&str>) -> Result<Option<Self>, PError> where Self: Sized;
    fn inner_name() -> Option<String> { None }
}