pub fn decode<T: Decodable>(s: &str) -> Result<Vec<T>, DecoderError> {
    let results = match Xml::from_str(s) {
        Ok(xs) => xs,
        Err(e) => return Err(ParseError(e)),
    };

    let mut out = Vec::new();
    for result in results {
        let mut decoder = Decoder::new(result);
        match Decodable::decode(&mut decoder) {
            Ok(decoded) => out.push(decoded),
            Err(error) => return Err(error),
        }
    }

    Ok(out)
}
/// Shortcut function to decode a XML `&str` into an object
Shortcut function to decode a XML `&str` into an object
Shortcut function to decode a XML ` &str ` into an object
pub fn decode<T: Decodable>(s: &str) -> Result<Vec<T>, DecoderError> {
    let results = match Xml::from_str(s) {
        Ok(xs) => xs,
        Err(e) => return Err(ParseError(e)),
    };
    let mut out = Vec::new();
    for result in results {
        let mut decoder = Decoder::new(result);
        match Decodable::decode(&mut decoder) {
            Ok(decoded) => out.push(decoded),
            Err(error) => return Err(error),
        }
    }
    Ok(out)
}
pub fn decode < T : Decodable > ( s : & str ) -> Result < Vec < T > , DecoderError > { let results = match Xml :: from_str ( s ) { Ok ( xs ) => xs , Err ( e ) => return Err ( ParseError ( e ) ) , } ; let mut out = Vec :: new ( ) ; for result in results { let mut decoder = Decoder :: new ( result ) ; match Decodable :: decode ( & mut decoder ) { Ok ( decoded ) => out . push ( decoded ) , Err ( error ) => return Err ( error ) , } } Ok ( out ) }
Shortcut function to decode a XML `&str` into an object
Shortcut function to decode a XML ` &str ` into an object
s
&str