From 0498125070d15e1f4dc6ce2977872d82291c06a5 Mon Sep 17 00:00:00 2001 From: Andrew Dirksen Date: Wed, 21 Nov 2018 09:44:35 -0800 Subject: [PATCH] add doctest for with_stacks --- src/runner.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/runner.rs b/src/runner.rs index 97ba7f3..43ba860 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -183,6 +183,21 @@ impl Interpreter { /// Initialize an interpreter that will use `value_stack` and `call_stack`. /// /// `value_stack` `call_stack` determine the allowed stack size during later executions. + /// + /// ``` + /// # extern crate wasmi; + /// use wasmi::{Interpreter, StackWithLimit, StackSize}; + /// let interpreter = Interpreter::with_stacks( + /// StackWithLimit::with_size(StackSize::from_byte_count(8192)), + /// StackWithLimit::with_size(StackSize::from_element_count(2048)), + /// ); + /// # let value_stack_size = StackSize::from_byte_count(8192); + /// # let value_stack = StackWithLimit::with_size(value_stack_size); + /// # let interpreter = Interpreter::with_stacks( + /// # value_stack, + /// # StackWithLimit::with_size(StackSize::from_element_count(2048)), + /// # ); + /// ``` pub fn with_stacks( value_stack: StackWithLimit, call_stack: StackWithLimit,