pub trait PlatformDeserializableUntrusted {
// Required method
fn deserialize_from_bytes_untrusted_no_limit(
data: &[u8],
) -> Result<Self, ProtocolError>
where Self: Sized;
// Provided method
fn deserialize_from_bytes_untrusted(
data: &[u8],
) -> Result<Self, ProtocolError>
where Self: Sized { ... }
}Expand description
Deserialization of bytes from outside this node: state transitions, query requests and cursors, proofs, SDK responses, host-supplied input.
Runs bincode’s untrusted decoder, which reserves nothing from a length prefix before the elements it announces have actually been read, so a short input claiming a huge collection fails instead of allocating.
Required Methods§
fn deserialize_from_bytes_untrusted_no_limit(
data: &[u8],
) -> Result<Self, ProtocolError>where
Self: Sized,
Provided Methods§
fn deserialize_from_bytes_untrusted(data: &[u8]) -> Result<Self, ProtocolError>where
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".