pub struct Unparsed { /* private fields */ }
Expand description
Unparsed
keeps the XML struct and will be serialized to XML with nothing change.
It is helpful when you are debugging on deserializeing certain element.
ⓘ
use xmlserde::Unparsed;
use xmlserde_derive::{XmlSerialize, XmlDeserialize};
#[derive(XmlSerialize, Deserialize)]
pub struct Person {
#[xmlserde(name=b"gender", ty = "attr")]
pub gender: Gender,
#[xmlserde(name=b"hobbies", ty = "child")]
pub hobbies: Unparsed
}
In the example above, <hobbies>
element keeps unchange after serializing and deserializing.
You can easily make a diff the former and latter version to check if other elments work well.
Implementations§
Source§impl Unparsed
impl Unparsed
pub fn deserialize_to<T>(self) -> Result<T, String>where
T: XmlDeserialize + Sized,
Trait Implementations§
Source§impl XmlDeserialize for Unparsed
impl XmlDeserialize for Unparsed
fn deserialize<B: BufRead>( tag: &[u8], reader: &mut Reader<B>, attrs: Attributes<'_>, is_empty: bool, ) -> Self
Source§fn __deserialize_from_unparsed_array(
_array: Vec<(&'static [u8], Unparsed)>,
) -> Self
fn __deserialize_from_unparsed_array( _array: Vec<(&'static [u8], Unparsed)>, ) -> Self
A helper function used when handling the untag types. Read more
fn de_root() -> Option<&'static [u8]>
A helper function used when ty =
untag
. It could help
us to find out the children tags when deserializingfn __deserialize_from_text(_: &str) -> Option<Self>where
Self: Sized,
Auto Trait Implementations§
impl Freeze for Unparsed
impl RefUnwindSafe for Unparsed
impl Send for Unparsed
impl Sync for Unparsed
impl Unpin for Unparsed
impl UnwindSafe for Unparsed
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more