Struct wasmer_vm::LinearTable
source · [−]pub struct LinearTable { /* private fields */ }
Expand description
A table instance.
Implementations
sourceimpl LinearTable
impl LinearTable
sourcepub fn new(table: &TableType, style: &TableStyle) -> Result<Self, String>
pub fn new(table: &TableType, style: &TableStyle) -> Result<Self, String>
Create a new linear table instance with specified minimum and maximum number of elements.
This creates a LinearTable
with metadata owned by a VM, pointed to by
vm_table_location
: this can be used to create a local table.
sourcepub unsafe fn from_definition(
table: &TableType,
style: &TableStyle,
vm_table_location: NonNull<VMTableDefinition>
) -> Result<Self, String>
pub unsafe fn from_definition(
table: &TableType,
style: &TableStyle,
vm_table_location: NonNull<VMTableDefinition>
) -> Result<Self, String>
Create a new linear table instance with specified minimum and maximum number of elements.
This creates a LinearTable
with metadata owned by a VM, pointed to by
vm_table_location
: this can be used to create a local table.
Safety
vm_table_location
must point to a valid location in VM memory.
Trait Implementations
sourceimpl Debug for LinearTable
impl Debug for LinearTable
sourceimpl MemoryUsage for LinearTable
impl MemoryUsage for LinearTable
sourcefn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
Returns the size of the referenced value in bytes. Read more
sourceimpl Table for LinearTable
impl Table for LinearTable
sourcefn style(&self) -> &TableStyle
fn style(&self) -> &TableStyle
Returns the style for this Table.
sourcefn grow(&self, delta: u32, init_value: TableElement) -> Option<u32>
fn grow(&self, delta: u32, init_value: TableElement) -> Option<u32>
Grow table by the specified amount of elements.
Returns None
if table can’t be grown by the specified amount
of elements, otherwise returns the previous size of the table.
sourcefn get(&self, index: u32) -> Option<TableElement>
fn get(&self, index: u32) -> Option<TableElement>
Get reference to the specified element.
Returns None
if the index is out of bounds.
sourcefn vmtable(&self) -> NonNull<VMTableDefinition>
fn vmtable(&self) -> NonNull<VMTableDefinition>
Return a VMTableDefinition
for exposing the table to compiled wasm code.
impl Send for LinearTable
This is correct because there is no thread-specific data tied to this type.
impl Sync for LinearTable
This is correct because all internal mutability is protected by a mutex.
Auto Trait Implementations
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.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<T> Upcastable for T where
T: 'static + Any + Send + Sync,
impl<T> Upcastable for T where
T: 'static + Any + Send + Sync,
sourcefn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
sourcefn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref