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

Required Methods§

source

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.

source

fn read_unvalidated(wasm: &mut WasmReader<'_>) -> Self

Like read, but may panic

Allows to read a Self, directly returning it, instead of a Result. Useful, when prior validation already assures that a Self can be read.

§Panics

Panics if reading a Self fails.

Object Safety§

This trait is not object safe.

Implementors§