pub trait Proxiable<Tag = ()> {
type Proxy;
// Required methods
fn encode_proxy(&self) -> Self::Proxy;
fn decode_proxy(
&mut self,
proxy: Self::Proxy,
) -> Result<(), DecodeErrorKind>;
}Expand description
Implement this trait to make a type supported for encoding by proxy; this can be thought of like
a special pair of Into and TryFrom implementations that are dedicated to this proxy
specification and are used every time this type is encoded or decoded, since that is essentially
exactly what happens.
Required Associated Types§
Required Methods§
Sourcefn encode_proxy(&self) -> Self::Proxy
fn encode_proxy(&self) -> Self::Proxy
Convert this value into a value of the proxy’s type.
Sourcefn decode_proxy(&mut self, proxy: Self::Proxy) -> Result<(), DecodeErrorKind>
fn decode_proxy(&mut self, proxy: Self::Proxy) -> Result<(), DecodeErrorKind>
Try to store the value represented in the proxy’s type in this value, returning an error if
the value is not valid (ideally the error should be OutOfDomainValue, InvalidValue, or
Other).