1
mod component;
2
mod object;
3
mod param;
4
mod property;
5

            
6
/// Conversion trait for converting parser model types to model types.
7
pub trait ToModel {
8
    type Model;
9

            
10
    fn to_model(&self) -> anyhow::Result<Self::Model>;
11
}
12

            
13
impl<T> ToModel for Vec<T>
14
where
15
    T: ToModel,
16
{
17
    type Model = Vec<T::Model>;
18

            
19
2999
    fn to_model(&self) -> anyhow::Result<Self::Model> {
20
2999
        self.iter().map(ToModel::to_model).collect()
21
2999
    }
22
}
23

            
24
5694
fn convert_string(input: &[u8]) -> String {
25
5694
    String::from_utf8_lossy(input).to_string()
26
5694
}