pub trait Deserializer {
// Required methods
fn de_tag<De: DeserializeTagged>(
&mut self,
tag_name: &str,
ignore_end: IgnoreEnd,
) -> Result<De, Error<De::Error>>;
fn de_tag_with<Output, Err, Func>(
&mut self,
tag_name: &str,
ignore_end: IgnoreEnd,
deserialize: Func,
) -> Result<Output, Error<Err>>
where Output: MaybeStatic,
Err: Error + Send + Sync + 'static,
Func: FnOnce(&TagStart<'_>, &mut Self) -> Result<Output, Err> + MaybeStatic;
fn de_tag_list<De, TagName>(
&mut self,
tag_name: Option<TagName>,
) -> Result<Vec<De>, Error<De::Error>>
where De: DeserializeTagged,
TagName: AsRef<str> + MaybeStatic;
fn de_text(&mut self) -> Result<String, Error<Infallible>>;
fn skip_to_tag_start(
&mut self,
tag_name: &str,
) -> Result<(), Error<Infallible>>;
fn skip_to_tag_end(
&mut self,
tag_name: &str,
) -> Result<(), Error<Infallible>>;
}
Expand description
XML deserializer.
Required Methods§
Sourcefn de_tag<De: DeserializeTagged>(
&mut self,
tag_name: &str,
ignore_end: IgnoreEnd,
) -> Result<De, Error<De::Error>>
fn de_tag<De: DeserializeTagged>( &mut self, tag_name: &str, ignore_end: IgnoreEnd, ) -> Result<De, Error<De::Error>>
Sourcefn de_tag_with<Output, Err, Func>(
&mut self,
tag_name: &str,
ignore_end: IgnoreEnd,
deserialize: Func,
) -> Result<Output, Error<Err>>where
Output: MaybeStatic,
Err: Error + Send + Sync + 'static,
Func: FnOnce(&TagStart<'_>, &mut Self) -> Result<Output, Err> + MaybeStatic,
fn de_tag_with<Output, Err, Func>(
&mut self,
tag_name: &str,
ignore_end: IgnoreEnd,
deserialize: Func,
) -> Result<Output, Error<Err>>where
Output: MaybeStatic,
Err: Error + Send + Sync + 'static,
Func: FnOnce(&TagStart<'_>, &mut Self) -> Result<Output, Err> + MaybeStatic,
Deserializes a tagged element using the given function.
§Errors
Returns Err
if deserialization fails.
Sourcefn de_tag_list<De, TagName>(
&mut self,
tag_name: Option<TagName>,
) -> Result<Vec<De>, Error<De::Error>>
fn de_tag_list<De, TagName>( &mut self, tag_name: Option<TagName>, ) -> Result<Vec<De>, Error<De::Error>>
Sourcefn skip_to_tag_start(&mut self, tag_name: &str) -> Result<(), Error<Infallible>>
fn skip_to_tag_start(&mut self, tag_name: &str) -> Result<(), Error<Infallible>>
Skips past all elements until a tagged element with the name tag_name
is
reached.
§Errors
Returns Err
if unsuccessful.
Sourcefn skip_to_tag_end(&mut self, tag_name: &str) -> Result<(), Error<Infallible>>
fn skip_to_tag_end(&mut self, tag_name: &str) -> Result<(), Error<Infallible>>
Skips past all elements until the end of a tagged element with the name tag_name
is reached.
§Errors
Returns Err
if unsuccessful.
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.