pub trait WasmReadable: Sized {
// Required methods
fn read(wasm: &mut WasmReader<'_>) -> Result<Self>;
fn read_unvalidated(wasm: &mut WasmReader<'_>) -> Self;
}
Required Methods§
Sourcefn read(wasm: &mut WasmReader<'_>) -> Result<Self>
fn read(wasm: &mut WasmReader<'_>) -> Result<Self>
Reads a new Self
from given WasmReader
.
Note that if this function returns Err(_)
, the WasmReader
may still have been advanced,
which may lead to unexpected behaviour.
To avoid this consider using the WasmReader::handle_transaction
method to wrap this function call.
Sourcefn read_unvalidated(wasm: &mut WasmReader<'_>) -> Self
fn read_unvalidated(wasm: &mut WasmReader<'_>) -> Self
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.