pub trait RefFromBinaryDecode {
type Anchor: Deref<Target = Self>;
// Required method
fn ref_decode(
decoder: &mut DecodedData<'_>,
) -> Result<Self::Anchor, DecodeError>;
}Expand description
Trait for types that can be decoded as references from binary data.
This is the wry-bindgen equivalent of wasm-bindgen’s RefFromWasmAbi.
The Anchor type holds the decoded value and keeps the reference valid
during callback invocation.
Required Associated Types§
Required Methods§
Sourcefn ref_decode(
decoder: &mut DecodedData<'_>,
) -> Result<Self::Anchor, DecodeError>
fn ref_decode( decoder: &mut DecodedData<'_>, ) -> Result<Self::Anchor, DecodeError>
Decode a reference anchor from binary data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.