pub struct CustomTunables<T: Tunables> { /* private fields */ }
Expand description
CustomTunables allows the setting of an upper limit on the guest memory of the VM. CustomTunables also conists of a base Tunables attribute which all the existing logic is delegated to after guest memory adjustment
Implementations§
Trait Implementations§
Source§impl<T: Tunables> MemoryUsage for CustomTunables<T>
impl<T: Tunables> MemoryUsage for CustomTunables<T>
Source§fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
Source§impl<T: Tunables> Tunables for CustomTunables<T>
impl<T: Tunables> Tunables for CustomTunables<T>
Source§fn memory_style(&self, memory: &MemoryType) -> MemoryStyle
fn memory_style(&self, memory: &MemoryType) -> MemoryStyle
memory_style
is used to construct a WebAssembly MemoryStyle
for the provided MemoryType
using base tunables
For more information on memory_style
: See https://github.com/wasmerio/wasmer/blob/master/examples/tunables_limit_memory.rs
Source§fn table_style(&self, table: &TableType) -> TableStyle
fn table_style(&self, table: &TableType) -> TableStyle
table_style
is used to construct a WebAssembly TableStyle
for the provided TableType
using base tunables
For more information on table_style
: See https://github.com/wasmerio/wasmer/blob/master/examples/tunables_limit_memory.rs
Source§fn create_host_memory(
&self,
ty: &MemoryType,
style: &MemoryStyle,
) -> Result<Arc<dyn Memory>, MemoryError>
fn create_host_memory( &self, ty: &MemoryType, style: &MemoryStyle, ) -> Result<Arc<dyn Memory>, MemoryError>
create_host_memory
creates memory owned by the host given a WebAssembly MemoryType
and a MemoryStyle
The requested memory type is validated, adjusted to the limited and then passed to base tunables
For more information on create_host_memory
: See https://github.com/wasmerio/wasmer/blob/master/examples/tunables_limit_memory.rs
Source§unsafe fn create_vm_memory(
&self,
ty: &MemoryType,
style: &MemoryStyle,
vm_definition_location: NonNull<VMMemoryDefinition>,
) -> Result<Arc<dyn Memory>, MemoryError>
unsafe fn create_vm_memory( &self, ty: &MemoryType, style: &MemoryStyle, vm_definition_location: NonNull<VMMemoryDefinition>, ) -> Result<Arc<dyn Memory>, MemoryError>
create_vm_memory
creates memory owned by the VM given a WebAssembly MemoryType
and a MemoryStyle
.
For more information on create_vm_memory
: See https://github.com/wasmerio/wasmer/blob/master/examples/tunables_limit_memory.rs
Source§fn create_host_table(
&self,
ty: &TableType,
style: &TableStyle,
) -> Result<Arc<dyn Table>, String>
fn create_host_table( &self, ty: &TableType, style: &TableStyle, ) -> Result<Arc<dyn Table>, String>
TableType
and a TableStyle
.Source§unsafe fn create_vm_table(
&self,
ty: &TableType,
style: &TableStyle,
vm_definition_location: NonNull<VMTableDefinition>,
) -> Result<Arc<dyn Table>, String>
unsafe fn create_vm_table( &self, ty: &TableType, style: &TableStyle, vm_definition_location: NonNull<VMTableDefinition>, ) -> Result<Arc<dyn Table>, String>
Source§fn create_global(&self, ty: GlobalType) -> Result<Arc<Global>, String>
fn create_global(&self, ty: GlobalType) -> Result<Arc<Global>, String>
Source§unsafe fn create_memories(
&self,
module: &ModuleInfo,
memory_styles: &PrimaryMap<MemoryIndex, MemoryStyle>,
memory_definition_locations: &[NonNull<VMMemoryDefinition>],
) -> Result<PrimaryMap<LocalMemoryIndex, Arc<dyn Memory>>, LinkError>
unsafe fn create_memories( &self, module: &ModuleInfo, memory_styles: &PrimaryMap<MemoryIndex, MemoryStyle>, memory_definition_locations: &[NonNull<VMMemoryDefinition>], ) -> Result<PrimaryMap<LocalMemoryIndex, Arc<dyn Memory>>, LinkError>
Source§unsafe fn create_tables(
&self,
module: &ModuleInfo,
table_styles: &PrimaryMap<TableIndex, TableStyle>,
table_definition_locations: &[NonNull<VMTableDefinition>],
) -> Result<PrimaryMap<LocalTableIndex, Arc<dyn Table>>, LinkError>
unsafe fn create_tables( &self, module: &ModuleInfo, table_styles: &PrimaryMap<TableIndex, TableStyle>, table_definition_locations: &[NonNull<VMTableDefinition>], ) -> Result<PrimaryMap<LocalTableIndex, Arc<dyn Table>>, LinkError>
Source§fn create_globals(
&self,
module: &ModuleInfo,
) -> Result<PrimaryMap<LocalGlobalIndex, Arc<Global>>, LinkError>
fn create_globals( &self, module: &ModuleInfo, ) -> Result<PrimaryMap<LocalGlobalIndex, Arc<Global>>, LinkError>
Auto Trait Implementations§
impl<T> Freeze for CustomTunables<T>where
T: Freeze,
impl<T> RefUnwindSafe for CustomTunables<T>where
T: RefUnwindSafe,
impl<T> Send for CustomTunables<T>where
T: Send,
impl<T> Sync for CustomTunables<T>where
T: Sync,
impl<T> Unpin for CustomTunables<T>where
T: Unpin,
impl<T> UnwindSafe for CustomTunables<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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