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)
}
}