tool: Support for owned and unowned generic Ec
This commit is contained in:
committed by
Jeremy Soller
parent
f4458aebca
commit
0c1584385c
@ -244,6 +244,23 @@ impl<A: Access> Ec<A> {
|
||||
];
|
||||
self.command(Cmd::LedSetColor, &mut data)
|
||||
}
|
||||
|
||||
pub fn as_dyn(&mut self) -> Ec<&mut dyn Access> {
|
||||
Ec {
|
||||
access: &mut self.access,
|
||||
version: self.version,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into_dyn(self) -> Ec<Box<dyn Access>>
|
||||
where A: 'static {
|
||||
Ec {
|
||||
access: Box::new(self.access),
|
||||
version: self.version,
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EcSpi<'a, A: Access> {
|
||||
|
Reference in New Issue
Block a user