Trait WasmReadable

Source
pub trait WasmReadable: Sized {
    // Required method
    fn read(wasm: &mut WasmReader<'_>) -> Result<Self, ValidationError>;
}

Required Methods§

Source

fn read(wasm: &mut WasmReader<'_>) -> Result<Self, ValidationError>

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.

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.

Implementors§