Skip to content

Commit 7de4d1d

Browse files
authored
added method that gives current length of the module in bytes (#1804)
1 parent 6cea1f3 commit 7de4d1d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crates/wasm-encoder/src/core.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ impl Module {
154154
&self.bytes
155155
}
156156

157+
/// Give the current size of the module in bytes.
158+
pub fn len(&self) -> usize {
159+
self.bytes.len()
160+
}
161+
157162
/// Finish writing this Wasm module and extract ownership of the encoded
158163
/// bytes.
159164
pub fn finish(self) -> Vec<u8> {

0 commit comments

Comments
 (0)