diff --git a/src/core/reader/mod.rs b/src/core/reader/mod.rs index 4e1fd85c..b7e6bf32 100644 --- a/src/core/reader/mod.rs +++ b/src/core/reader/mod.rs @@ -173,6 +173,15 @@ pub trait WasmReadable: Sized { /// which may lead to unexpected behaviour. /// To avoid this consider using the [`WasmReader::handle_transaction`] method to wrap this function call. fn read(wasm: &mut WasmReader) -> Result; + + /// Like [`read`](WasmReadable::read), but may panic + /// + /// Allows to read a value, directly returning the Value instead of a `Result`. + /// Useful, when prior validation already assured that a matching readable thing is in place. + /// + /// # Panic + /// + /// Panics if reading the given thing fails. fn read_unvalidated(wasm: &mut WasmReader) -> Self; }