Skip to content

Commit

Permalink
chore: extend documentation on WasmReadable
Browse files Browse the repository at this point in the history
Signed-off-by: wucke13 <[email protected]>
  • Loading branch information
wucke13 committed Aug 19, 2024
1 parent 13c2e72 commit 12d0c5a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self>;

/// 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;
}

Expand Down

0 comments on commit 12d0c5a

Please sign in to comment.