From c7c26e8900e86f8b2116648e988b1e34c85f4077 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 24 Jul 2026 14:45:52 +0200 Subject: docs: improve rust docs Signed-off-by: Henry --- crates/parser/src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/parser/src') diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index 7936675..aa5e0b0 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -49,7 +49,10 @@ pub use tinywasm_types::Module; #[non_exhaustive] #[derive(Debug, Clone)] pub struct ParserOptions { - /// Whether to validate modules while parsing. + /// Whether to validate modules while parsing. Enabled by default. + /// + /// Disable this only for trusted input. Parsing without validation may produce + /// a module that violates runtime assumptions. pub validation: bool, /// Whether to optimize local memory allocation by skipping allocation of unused local memories. pub optimize_local_memory_allocation: bool, @@ -81,6 +84,9 @@ impl Default for ParserOptions { impl ParserOptions { /// Enable or disable WebAssembly validation. + /// + /// Disable this only for trusted input. Parsing without validation may produce + /// a module that violates runtime assumptions. pub const fn with_validation(mut self, enabled: bool) -> Self { self.validation = enabled; self @@ -337,7 +343,7 @@ pub fn parse_file(path: impl AsRef + Clone) -> Result Result { Parser::new().parse_module_stream(stream) } -- cgit v1.3.1