1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
use std::convert::Infallible;
use mockall::mock;
use xml_stinks::deserializer::{Deserializer, Error, IgnoreEnd, MaybeStatic};
use xml_stinks::tagged::TagStart;
use xml_stinks::DeserializeTagged;
mock! {
pub Deserializer {}
impl Deserializer for Deserializer
{
fn de_tag<De: DeserializeTagged>(
&mut self,
tag_name: &str,
ignore_end: IgnoreEnd,
) -> Result<De, Error<De::Error>>;
fn de_tag_with<TOutput, Err, Func>(
&mut self,
tag_name: &str,
ignore_end: IgnoreEnd,
deserialize: Func,
) -> Result<TOutput, Error<Err>>
where
TOutput: MaybeStatic,
Err: std::error::Error + Send + Sync + 'static,
Func: FnOnce(&TagStart, &mut MockDeserializer) -> Result<TOutput, 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>>;
}
}
|