use super::Embeddable; use super::IOResult; use super::IOValue; pub trait DomainDecode { fn decode_embedded_iovalue(&mut self, v: IOValue) -> IOResult; } pub struct IOValueDomainDecode; impl DomainDecode for IOValueDomainDecode { fn decode_embedded_iovalue(&mut self, v: IOValue) -> IOResult { Ok(v) } } pub struct NoEmbeddedDomainDecode; impl DomainDecode for NoEmbeddedDomainDecode { fn decode_embedded_iovalue(&mut self, _v: IOValue) -> IOResult { Err(std::io::Error::new(std::io::ErrorKind::Unsupported, "Embedded values not supported here")) } }