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
use crate::v7400::object::property::PropertyHandle;
pub trait LoadProperty<'a>: Sized {
type Value;
type Error;
fn expecting(&self) -> String;
fn load(self, node: &PropertyHandle<'a>) -> Result<Self::Value, Self::Error>;
}
impl<'a, T> LoadProperty<'a> for &'_ T
where
T: Copy + LoadProperty<'a>,
{
type Value = <T as LoadProperty<'a>>::Value;
type Error = <T as LoadProperty<'a>>::Error;
fn expecting(&self) -> String {
(*self).expecting()
}
fn load(self, node: &PropertyHandle<'a>) -> Result<Self::Value, Self::Error> {
(*self).load(node)
}
}