pub struct XmlStreamReader<T> { /* private fields */ }
Expand description
XML stream reader specialized for working with OPC-UA XML.
Implementations§
Source§impl<T> XmlStreamReader<T>where
T: Read,
impl<T> XmlStreamReader<T>where
T: Read,
Sourcepub fn new(reader: T) -> XmlStreamReader<T>
pub fn new(reader: T) -> XmlStreamReader<T>
Create a new stream reader with an internal buffer.
Sourcepub fn next_event(&mut self) -> Result<Event<'_>, XmlReadError>
pub fn next_event(&mut self) -> Result<Event<'_>, XmlReadError>
Get the next event from the stream.
Sourcepub fn skip_value(&mut self) -> Result<(), XmlReadError>
pub fn skip_value(&mut self) -> Result<(), XmlReadError>
Skip the current value. This should be called after encountering a
Start
event, and will skip until the corresponding End
event is consumed.
Note that this does not check that the document is coherent, just that an equal number of start and end events are consumed.
Sourcepub fn consume_as_text(&mut self) -> Result<String, XmlReadError>
pub fn consume_as_text(&mut self) -> Result<String, XmlReadError>
Consume the current event, skipping any child elements and returning the combined text content with leading and trailing whitespace removed. Note that if there are multiple text elements they will be concatenated, but whitespace between these will not be removed.
Sourcepub fn consume_raw(&mut self) -> Result<Vec<u8>, XmlReadError>
pub fn consume_raw(&mut self) -> Result<Vec<u8>, XmlReadError>
Consume the current element as a raw array of bytes.
Sourcepub fn consume_content<R>(&mut self) -> Result<R, XmlReadError>
pub fn consume_content<R>(&mut self) -> Result<R, XmlReadError>
Consume the current node as a text value and parse it as the given type.