Struct wasmer_ruby::Wasmer::Exports
source · pub struct Exports;
Expand description
Represents all the exports of an instance. It is built by Instance::exports
.
Implementations§
source§impl Exports
impl Exports
sourcepub fn method_missing(name: String) -> Any
pub fn method_missing(name: String) -> Any
Returns either a Function
, a Memory
, a Global
,
or a Table
if the name for the export exists.
Example
module_ = Wasmer::Module.new(
Wasmer::Store.new,
(<<~WAST)
(module
(func (export "func") (param i32 i64))
(global (export "glob") i32 (i32.const 7))
(table (export "tab") 0 funcref)
(memory (export "mem") 1))
WAST
)
instance = Wasmer::Instance.new module_, nil
exports = instance.exports
assert { exports.respond_to? :func }
assert { exports.respond_to? :glob }
assert { exports.respond_to? :tab }
assert { exports.respond_to? :mem }
assert { not(exports.respond_to? :foo) }
assert { exports.func.is_a?(Wasmer::Function) }
assert { exports.mem.is_a?(Wasmer::Memory) }
assert { exports.glob.is_a?(Wasmer::Global) }
assert { exports.tab.is_a?(Wasmer::Table) }
Auto Trait Implementations§
impl RefUnwindSafe for Exports
impl Send for Exports
impl Sync for Exports
impl Unpin for Exports
impl UnwindSafe for Exports
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