quick-xml
quick-xml copied to clipboard
Send events through channel
Look at this broken piece of code:
let mut xml = Reader::from_reader(...);
let (tx, rx) = mpsc::channel::<Event>();
let mut buf = Vec::new();
loop {
let ev = xml.read_event(&mut buf);
tx.send(ev.unwrap());
}
}
I'd like to decode the XML in one thread and send the events via a channel. Do you have a minimum example on how to do this?