If T is DomainDecode, so is &mut T.

This commit is contained in:
Tony Garnock-Jones 2021-07-05 20:24:40 +02:00
parent 7c8a5c61ca
commit 64593436a8
1 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,16 @@ pub trait DomainEncode<D: Embeddable> {
) -> io::Result<()>;
}
impl <'a, D: Embeddable, T: DomainDecode<D>> DomainDecode<D> for &'a mut T {
fn decode_embedded<'de, 'src, S: BinarySource<'de>>(
&mut self,
src: &'src mut S,
read_annotations: bool,
) -> io::Result<D> {
(**self).decode_embedded(src, read_annotations)
}
}
pub struct IOValueDomainCodec;
impl DomainDecode<IOValue> for IOValueDomainCodec {