use crate::error::{self, Error};
pub trait HasParameters {
fn set<T: Parameter<Self>>(&mut self, value: T) -> error::Result<()> {
value.set(self)
}
fn get<T: Parameter<Self>>(&mut self) -> error::Result<T> {
T::get(self)
}
}
pub trait Parameter<T: ?Sized>: Sized {
#[allow(unused_variables)]
fn set(self, to: &mut T) -> error::Result<()> {
Err(Error::Unsupported("parameter not supported".into()))
}
#[allow(unused_variables)]
fn get(from: &mut T) -> error::Result<Self> {
Err(Error::Unsupported("parameter not supported".into()))
}
}