Trait Deserializer

Source
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§

Source

fn de_tag<De: DeserializeTagged>( &mut self, tag_name: &str, ignore_end: IgnoreEnd, ) -> Result<De, Error<De::Error>>

Deserializes a tagged element.

§Errors

Returns Err if deserialization fails.

Source

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.

Source

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,

Deserializes a list of tagged elements.

§Errors

Returns Err if deserialization fails.

Source

fn de_text(&mut self) -> Result<String, Error<Infallible>>

Deserializes a text element.

§Errors

Returns Err if deserialization fails.

Source

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.

Source

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.

Implementors§

Source§

impl<TSource: Source> Deserializer for Buffered<TSource>