pub fn read<R: std::io::Read, D: Deserialize>(source: R) -> Result<D, Error> {
    let mut reader = Reader::new(source);
    let v = D::deserialize(reader.root()?).map_err(|e| e.wrap(reader.stack(), reader.pos()))?;
    reader.end()?;
    Ok(v)
}
/// Reads and returns the root element of the given XML document.
///
/// *TODO:* currently this does no validation of the name of the root element.
/// Maybe we need a `DeserializeRoot` trait to match [`crate::ser::SerializeRoot`].
Reads and returns the root element of the given XML document.
TODO:* currently this does no validation of the name of the root element.
Maybe we need a `DeserializeRoot` trait to match [`crate::ser::SerializeRoot`].
Reads and returns the root element of the given XML document . TODO : * currently this does no validation of the name of the root element . Maybe we need a ` DeserializeRoot ` trait to match [ ` crate :: ser :: SerializeRoot ` ] .
pub fn read<R: std::io::Read, D: Deserialize>(source: R) -> Result<D, Error> {
    let mut reader = Reader::new(source);
    let v = D::deserialize(reader.root()?).map_err(|e| e.wrap(reader.stack(), reader.pos()))?;
    reader.end()?;
    Ok(v)
}
pub fn read < R : std :: io :: Read , D : Deserialize > ( source : R ) -> Result < D , Error > { let mut reader = Reader :: new ( source ) ; let v = D :: deserialize ( reader . root ( ) ? ) . map_err ( | e | e . wrap ( reader . stack ( ) , reader . pos ( ) ) ) ? ; reader . end ( ) ? ; Ok ( v ) }
Reads and returns the root element of the given XML document.
Reads and returns the root element of the given XML document .
source
R