pub struct BaseTunables {}Expand description
Tunable parameters for WebAssembly compilation.
This is the reference implementation of the Tunables trait,
used by default.
You can use this as a template for creating a custom Tunables implementation or use composition to wrap your Tunables around this one. The later approach is demonstrated in the tunables-limit-memory example.
Implementations§
Source§impl BaseTunables
impl BaseTunables
Trait Implementations§
Source§impl Clone for BaseTunables
impl Clone for BaseTunables
Source§fn clone(&self) -> BaseTunables
fn clone(&self) -> BaseTunables
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for BaseTunables
impl Default for BaseTunables
Source§fn default() -> BaseTunables
fn default() -> BaseTunables
Returns the “default value” for a type. Read more
Source§impl Tunables for BaseTunables
impl Tunables for BaseTunables
Source§fn memory_style(&self, _memory: &MemoryType) -> MemoryStyle
fn memory_style(&self, _memory: &MemoryType) -> MemoryStyle
Always return Static memory style.
Source§fn table_style(&self, _table: &TableType) -> TableStyle
fn table_style(&self, _table: &TableType) -> TableStyle
Get a [TableStyle] for the provided [TableType].
Source§fn create_host_memory(
&self,
ty: &MemoryType,
style: &MemoryStyle,
) -> Result<VMMemory, MemoryError>
fn create_host_memory( &self, ty: &MemoryType, style: &MemoryStyle, ) -> Result<VMMemory, MemoryError>
Create a memory owned by the host given a [MemoryType] and a [MemoryStyle].
Source§unsafe fn create_vm_memory(
&self,
ty: &MemoryType,
style: &MemoryStyle,
vm_definition_location: NonNull<VMMemoryDefinition>,
) -> Result<VMMemory, MemoryError>
unsafe fn create_vm_memory( &self, ty: &MemoryType, style: &MemoryStyle, vm_definition_location: NonNull<VMMemoryDefinition>, ) -> Result<VMMemory, MemoryError>
Create a memory owned by the VM given a [MemoryType] and a [MemoryStyle].
§Safety
vm_definition_locationmust point to a valid, ownedVMMemoryDefinition, for example inVMContext.
Source§fn create_host_table(
&self,
ty: &TableType,
style: &TableStyle,
) -> Result<VMTable, String>
fn create_host_table( &self, ty: &TableType, style: &TableStyle, ) -> Result<VMTable, String>
Create a table owned by the host given a [TableType] and a [TableStyle].
Source§unsafe fn create_vm_table(
&self,
ty: &TableType,
style: &TableStyle,
vm_definition_location: NonNull<VMTableDefinition>,
) -> Result<VMTable, String>
unsafe fn create_vm_table( &self, ty: &TableType, style: &TableStyle, vm_definition_location: NonNull<VMTableDefinition>, ) -> Result<VMTable, String>
Create a table owned by the VM given a [TableType] and a [TableStyle].
§Safety
vm_definition_locationmust point to a valid, ownedVMTableDefinition, for example inVMContext.
Source§fn create_global(&self, ty: GlobalType) -> Result<VMGlobal, String>
fn create_global(&self, ty: GlobalType) -> Result<VMGlobal, String>
Create a global with an unset value.
Source§unsafe fn create_vm_global(
&self,
ty: GlobalType,
vm_definition_location: NonNull<VMGlobalDefinition>,
) -> Result<VMGlobal, String>
unsafe fn create_vm_global( &self, ty: GlobalType, vm_definition_location: NonNull<VMGlobalDefinition>, ) -> Result<VMGlobal, String>
Create a global owned by the VM with backing storage in the
VMContext. Read moreSource§fn create_tag(&self, kind: TagKind, ty: FunctionType) -> Result<VMTag, String>
fn create_tag(&self, kind: TagKind, ty: FunctionType) -> Result<VMTag, String>
Create a new tag.
Source§unsafe fn create_memories(
&self,
context: &mut StoreObjects,
module: &ModuleInfo,
memory_styles: &PrimaryMap<MemoryIndex, MemoryStyle>,
memory_definition_locations: &[NonNull<VMMemoryDefinition>],
) -> Result<PrimaryMap<LocalMemoryIndex, InternalStoreHandle<VMMemory>>, LinkError>
unsafe fn create_memories( &self, context: &mut StoreObjects, module: &ModuleInfo, memory_styles: &PrimaryMap<MemoryIndex, MemoryStyle>, memory_definition_locations: &[NonNull<VMMemoryDefinition>], ) -> Result<PrimaryMap<LocalMemoryIndex, InternalStoreHandle<VMMemory>>, LinkError>
Allocate memory for just the memories of the current module. Read more
Source§unsafe fn create_tables(
&self,
context: &mut StoreObjects,
module: &ModuleInfo,
table_styles: &PrimaryMap<TableIndex, TableStyle>,
table_definition_locations: &[NonNull<VMTableDefinition>],
) -> Result<PrimaryMap<LocalTableIndex, InternalStoreHandle<VMTable>>, LinkError>
unsafe fn create_tables( &self, context: &mut StoreObjects, module: &ModuleInfo, table_styles: &PrimaryMap<TableIndex, TableStyle>, table_definition_locations: &[NonNull<VMTableDefinition>], ) -> Result<PrimaryMap<LocalTableIndex, InternalStoreHandle<VMTable>>, LinkError>
Allocate memory for just the tables of the current module. Read more
Source§fn create_globals(
&self,
context: &mut StoreObjects,
module: &ModuleInfo,
vm_definition_locations: &[NonNull<VMGlobalDefinition>],
) -> Result<PrimaryMap<LocalGlobalIndex, InternalStoreHandle<VMGlobal>>, LinkError>
fn create_globals( &self, context: &mut StoreObjects, module: &ModuleInfo, vm_definition_locations: &[NonNull<VMGlobalDefinition>], ) -> Result<PrimaryMap<LocalGlobalIndex, InternalStoreHandle<VMGlobal>>, LinkError>
Allocate memory for just the globals of the current module,
with initializers applied.
Source§fn vmconfig(&self) -> &VMConfig
fn vmconfig(&self) -> &VMConfig
Get the VMConfig for this tunables
Currently, VMConfig have optional Stack size
If wasm_stack_size is left to None (the default value)
then the global stack size will be use
Else the defined stack size will be used. Size is in byte
and the value might be rounded to sane value is needed.
Auto Trait Implementations§
impl Freeze for BaseTunables
impl RefUnwindSafe for BaseTunables
impl Send for BaseTunables
impl Sync for BaseTunables
impl Unpin for BaseTunables
impl UnsafeUnpin for BaseTunables
impl UnwindSafe for BaseTunables
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
Source§impl<T> Upcastable for T
impl<T> Upcastable for T
Source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
Source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref