pub struct SandboxBuilder { /* private fields */ }Expand description
A builder for WasmSandbox
Implementations§
Source§impl SandboxBuilder
impl SandboxBuilder
Sourcepub fn with_host_print_fn(
self,
host_print_fn: impl Into<HostFunction<i32, (String,)>>,
) -> Self
pub fn with_host_print_fn( self, host_print_fn: impl Into<HostFunction<i32, (String,)>>, ) -> Self
Set the host print function
Sourcepub fn with_guest_output_buffer_size(
self,
guest_output_buffer_size: usize,
) -> Self
pub fn with_guest_output_buffer_size( self, guest_output_buffer_size: usize, ) -> Self
Set the guest output buffer size
Sourcepub fn with_guest_input_buffer_size(
self,
guest_input_buffer_size: usize,
) -> Self
pub fn with_guest_input_buffer_size( self, guest_input_buffer_size: usize, ) -> Self
Set the guest input buffer size This is the size of the buffer that the guest can write to to send data to the host The host can read from this buffer The guest can write to this buffer
Sourcepub fn with_guest_scratch_size(self, guest_scratch_size: usize) -> Self
pub fn with_guest_scratch_size(self, guest_scratch_size: usize) -> Self
Set the guest scratch size in bytes. The scratch region provides writable memory for the guest, including the dynamically-sized stack. Increase this if your guest code needs deep recursion or large local variables. Values smaller than the default (288 KiB) are ignored.
Sourcepub fn with_guest_heap_size(self, guest_heap_size: u64) -> Self
pub fn with_guest_heap_size(self, guest_heap_size: u64) -> Self
Set the guest heap size This is the size of the heap that code executing in the guest can use. If this value is too small then the guest will fail, usually with a malloc failed error The default (and minimum) value for this is set to the value of the MIN_HEAP_SIZE const.
Sourcepub fn build(self) -> Result<ProtoWasmSandbox>
pub fn build(self) -> Result<ProtoWasmSandbox>
Build the ProtoWasmSandbox
Trait Implementations§
Source§impl Clone for SandboxBuilder
impl Clone for SandboxBuilder
Source§fn clone(&self) -> SandboxBuilder
fn clone(&self) -> SandboxBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more