Skip to content

Commit

Permalink
added method that gives current length of the module in bytes (#1804)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesuhas committed Sep 19, 2024
1 parent 6cea1f3 commit 7de4d1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/wasm-encoder/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ impl Module {
&self.bytes
}

/// Give the current size of the module in bytes.
pub fn len(&self) -> usize {
self.bytes.len()
}

/// Finish writing this Wasm module and extract ownership of the encoded
/// bytes.
pub fn finish(self) -> Vec<u8> {
Expand Down

0 comments on commit 7de4d1d

Please sign in to comment.