pub trait XmlReadExt {
// Required methods
fn iter_children_include_empty(
&mut self,
process: impl FnMut(String, Option<&mut Self>, &Context<'_>) -> EncodingResult<()>,
context: &Context<'_>,
) -> EncodingResult<()>;
fn iter_children(
&mut self,
cb: impl FnMut(String, &mut Self, &Context<'_>) -> EncodingResult<()>,
context: &Context<'_>,
) -> EncodingResult<()>;
fn get_single_child<T>(
&mut self,
tag: &str,
cb: impl FnMut(&mut Self, &Context<'_>) -> Result<T, Error>,
context: &Context<'_>,
) -> EncodingResult<Option<T>>;
fn decode_single_child<T: XmlDecodable>(
&mut self,
tag: &str,
context: &Context<'_>,
) -> Result<Option<T>, Error>;
fn get_first_child<T>(
&mut self,
cb: impl FnOnce(String, &mut Self, &Context<'_>) -> Result<T, Error>,
context: &Context<'_>,
) -> EncodingResult<Option<T>>;
}
Expand description
Extensions for XmlStreamReader.
Required Methods§
Sourcefn iter_children_include_empty(
&mut self,
process: impl FnMut(String, Option<&mut Self>, &Context<'_>) -> EncodingResult<()>,
context: &Context<'_>,
) -> EncodingResult<()>
fn iter_children_include_empty( &mut self, process: impl FnMut(String, Option<&mut Self>, &Context<'_>) -> EncodingResult<()>, context: &Context<'_>, ) -> EncodingResult<()>
Iterate over children, calling the provided callback for each tag. The callback must consume the tag, unless no reader is provided, in which case the tag is already closed.
Sourcefn iter_children(
&mut self,
cb: impl FnMut(String, &mut Self, &Context<'_>) -> EncodingResult<()>,
context: &Context<'_>,
) -> EncodingResult<()>
fn iter_children( &mut self, cb: impl FnMut(String, &mut Self, &Context<'_>) -> EncodingResult<()>, context: &Context<'_>, ) -> EncodingResult<()>
Iterate over children, calling the provided callback for each tag. The callback must consume the tag.
Sourcefn get_single_child<T>(
&mut self,
tag: &str,
cb: impl FnMut(&mut Self, &Context<'_>) -> Result<T, Error>,
context: &Context<'_>,
) -> EncodingResult<Option<T>>
fn get_single_child<T>( &mut self, tag: &str, cb: impl FnMut(&mut Self, &Context<'_>) -> Result<T, Error>, context: &Context<'_>, ) -> EncodingResult<Option<T>>
Call a callback for a single child element. This will consume the current node.
Sourcefn decode_single_child<T: XmlDecodable>(
&mut self,
tag: &str,
context: &Context<'_>,
) -> Result<Option<T>, Error>
fn decode_single_child<T: XmlDecodable>( &mut self, tag: &str, context: &Context<'_>, ) -> Result<Option<T>, Error>
Decode a single child element. This will consume the current node.
Sourcefn get_first_child<T>(
&mut self,
cb: impl FnOnce(String, &mut Self, &Context<'_>) -> Result<T, Error>,
context: &Context<'_>,
) -> EncodingResult<Option<T>>
fn get_first_child<T>( &mut self, cb: impl FnOnce(String, &mut Self, &Context<'_>) -> Result<T, Error>, context: &Context<'_>, ) -> EncodingResult<Option<T>>
Call a callback for the first child element, then skip the rest. This will consume the current node.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.