diff --git a/.lock b/.lock new file mode 100644 index 000000000..e69de29bb diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/async_wasi/all.html b/async_wasi/all.html new file mode 100644 index 000000000..c693ad70f --- /dev/null +++ b/async_wasi/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Unions

Traits

Functions

Type Aliases

Constants

\ No newline at end of file diff --git a/async_wasi/index.html b/async_wasi/index.html new file mode 100644 index 000000000..eea5e0d63 --- /dev/null +++ b/async_wasi/index.html @@ -0,0 +1,7 @@ +async_wasi - Rust

Crate async_wasi

source ·
Expand description

The async-wasi crate implements WASI spec for the asynchronous scenarios.

+

See also

+ +

Re-exports

Modules

\ No newline at end of file diff --git a/async_wasi/object_pool/index.html b/async_wasi/object_pool/index.html new file mode 100644 index 000000000..5efa44231 --- /dev/null +++ b/async_wasi/object_pool/index.html @@ -0,0 +1 @@ +async_wasi::object_pool - Rust

Module async_wasi::object_pool

source ·

Structs

\ No newline at end of file diff --git a/async_wasi/object_pool/sidebar-items.js b/async_wasi/object_pool/sidebar-items.js new file mode 100644 index 000000000..c741527aa --- /dev/null +++ b/async_wasi/object_pool/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ObjectNode","ObjectPool","SerialObjectPool"]}; \ No newline at end of file diff --git a/async_wasi/object_pool/struct.ObjectNode.html b/async_wasi/object_pool/struct.ObjectNode.html new file mode 100644 index 000000000..9eb85de25 --- /dev/null +++ b/async_wasi/object_pool/struct.ObjectNode.html @@ -0,0 +1,17 @@ +ObjectNode in async_wasi::object_pool - Rust
pub struct ObjectNode<T> { /* private fields */ }

Trait Implementations§

source§

impl<T: Clone> Clone for ObjectNode<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for ObjectNode<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Default for ObjectNode<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for ObjectNode<T>where + T: RefUnwindSafe,

§

impl<T> Send for ObjectNode<T>where + T: Send,

§

impl<T> Sync for ObjectNode<T>where + T: Sync,

§

impl<T> Unpin for ObjectNode<T>where + T: Unpin,

§

impl<T> UnwindSafe for ObjectNode<T>where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/object_pool/struct.ObjectPool.html b/async_wasi/object_pool/struct.ObjectPool.html new file mode 100644 index 000000000..002e44f7f --- /dev/null +++ b/async_wasi/object_pool/struct.ObjectPool.html @@ -0,0 +1,17 @@ +ObjectPool in async_wasi::object_pool - Rust
pub struct ObjectPool<T> { /* private fields */ }

Implementations§

source§

impl<T> ObjectPool<T>

source

pub fn new() -> Self

source

pub fn push(&mut self, value: T) -> (usize, Option<T>)

source

pub fn remove(&mut self, index: usize) -> Option<T>

source

pub fn cleanup_stores(&mut self)

source

pub fn get(&self, index: usize) -> Option<&T>

source

pub fn get_mut(&mut self, index: usize) -> Option<&mut T>

source§

impl<T> ObjectPool<T>

source

pub fn iter(&self) -> impl Iterator<Item = Option<&T>>

source

pub fn iter_mut(&mut self) -> impl Iterator<Item = Option<&mut T>>

Trait Implementations§

source§

impl<T: Clone> Clone for ObjectPool<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for ObjectPool<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Default for ObjectPool<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for ObjectPool<T>where + T: RefUnwindSafe,

§

impl<T> Send for ObjectPool<T>where + T: Send,

§

impl<T> Sync for ObjectPool<T>where + T: Sync,

§

impl<T> Unpin for ObjectPool<T>where + T: Unpin,

§

impl<T> UnwindSafe for ObjectPool<T>where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/object_pool/struct.SerialObjectPool.html b/async_wasi/object_pool/struct.SerialObjectPool.html new file mode 100644 index 000000000..3452fc6ad --- /dev/null +++ b/async_wasi/object_pool/struct.SerialObjectPool.html @@ -0,0 +1,28 @@ +SerialObjectPool in async_wasi::object_pool - Rust
pub struct SerialObjectPool<T>(/* private fields */);

Implementations§

source§

impl<T> SerialObjectPool<T>

source

pub fn into<U, F: FnMut(T) -> U>(self, f: F) -> ObjectPool<U>

source

pub fn from_ref<U, F: FnMut(&U) -> T>( + pool: &ObjectPool<U>, + f: F +) -> SerialObjectPool<T>

source

pub fn from<U, F: FnMut(U) -> T>( + pool: ObjectPool<U>, + f: F +) -> SerialObjectPool<T>

Trait Implementations§

source§

impl<T: Clone> Clone for SerialObjectPool<T>

source§

fn clone(&self) -> SerialObjectPool<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for SerialObjectPool<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, T> Deserialize<'de> for SerialObjectPool<T>where + T: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Serialize for SerialObjectPool<T>where + T: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for SerialObjectPool<T>where + T: RefUnwindSafe,

§

impl<T> Send for SerialObjectPool<T>where + T: Send,

§

impl<T> Sync for SerialObjectPool<T>where + T: Sync,

§

impl<T> Unpin for SerialObjectPool<T>where + T: Unpin,

§

impl<T> UnwindSafe for SerialObjectPool<T>where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/sidebar-items.js b/async_wasi/sidebar-items.js new file mode 100644 index 000000000..6ce18d74e --- /dev/null +++ b/async_wasi/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["object_pool","snapshots"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/clock/fn.wasi_clock_res_get.html b/async_wasi/snapshots/common/clock/fn.wasi_clock_res_get.html new file mode 100644 index 000000000..ab4d9bf1e --- /dev/null +++ b/async_wasi/snapshots/common/clock/fn.wasi_clock_res_get.html @@ -0,0 +1 @@ +wasi_clock_res_get in async_wasi::snapshots::common::clock - Rust
pub fn wasi_clock_res_get(clock_id: Type) -> Result<u64, Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/common/clock/fn.wasi_clock_time_get.html b/async_wasi/snapshots/common/clock/fn.wasi_clock_time_get.html new file mode 100644 index 000000000..172a12c8c --- /dev/null +++ b/async_wasi/snapshots/common/clock/fn.wasi_clock_time_get.html @@ -0,0 +1,5 @@ +wasi_clock_time_get in async_wasi::snapshots::common::clock - Rust
pub fn wasi_clock_time_get(
+    ctx: &WasiCtx,
+    clock_id: Type,
+    _precision: __wasi_timestamp_t
+) -> Result<u64, Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/common/clock/index.html b/async_wasi/snapshots/common/clock/index.html new file mode 100644 index 000000000..040a7c421 --- /dev/null +++ b/async_wasi/snapshots/common/clock/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::clock - Rust

Functions

\ No newline at end of file diff --git a/async_wasi/snapshots/common/clock/sidebar-items.js b/async_wasi/snapshots/common/clock/sidebar-items.js new file mode 100644 index 000000000..145e1b8e0 --- /dev/null +++ b/async_wasi/snapshots/common/clock/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["wasi_clock_res_get","wasi_clock_time_get"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/error/index.html b/async_wasi/snapshots/common/error/index.html new file mode 100644 index 000000000..c3ca2d633 --- /dev/null +++ b/async_wasi/snapshots/common/error/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::error - Rust

Re-exports

Structs

\ No newline at end of file diff --git a/async_wasi/snapshots/common/error/sidebar-items.js b/async_wasi/snapshots/common/error/sidebar-items.js new file mode 100644 index 000000000..773c55bf9 --- /dev/null +++ b/async_wasi/snapshots/common/error/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Errno"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/error/struct.Errno.html b/async_wasi/snapshots/common/error/struct.Errno.html new file mode 100644 index 000000000..aa5f0cf00 --- /dev/null +++ b/async_wasi/snapshots/common/error/struct.Errno.html @@ -0,0 +1,14 @@ +Errno in async_wasi::snapshots::common::error - Rust
pub struct Errno(pub Type);

Tuple Fields§

§0: Type

Implementations§

source§

impl Errno

source

pub const __WASI_ERRNO_SUCCESS: Errno = _

source

pub const __WASI_ERRNO_2BIG: Errno = _

source

pub const __WASI_ERRNO_ACCES: Errno = _

source

pub const __WASI_ERRNO_ADDRINUSE: Errno = _

source

pub const __WASI_ERRNO_ADDRNOTAVAIL: Errno = _

source

pub const __WASI_ERRNO_AFNOSUPPORT: Errno = _

source

pub const __WASI_ERRNO_AGAIN: Errno = _

source

pub const __WASI_ERRNO_ALREADY: Errno = _

source

pub const __WASI_ERRNO_BADF: Errno = _

source

pub const __WASI_ERRNO_BADMSG: Errno = _

source

pub const __WASI_ERRNO_BUSY: Errno = _

source

pub const __WASI_ERRNO_CANCELED: Errno = _

source

pub const __WASI_ERRNO_CHILD: Errno = _

source

pub const __WASI_ERRNO_CONNABORTED: Errno = _

source

pub const __WASI_ERRNO_CONNREFUSED: Errno = _

source

pub const __WASI_ERRNO_CONNRESET: Errno = _

source

pub const __WASI_ERRNO_DEADLK: Errno = _

source

pub const __WASI_ERRNO_DESTADDRREQ: Errno = _

source

pub const __WASI_ERRNO_DOM: Errno = _

source

pub const __WASI_ERRNO_DQUOT: Errno = _

source

pub const __WASI_ERRNO_EXIST: Errno = _

source

pub const __WASI_ERRNO_FAULT: Errno = _

source

pub const __WASI_ERRNO_FBIG: Errno = _

source

pub const __WASI_ERRNO_HOSTUNREACH: Errno = _

source

pub const __WASI_ERRNO_IDRM: Errno = _

source

pub const __WASI_ERRNO_ILSEQ: Errno = _

source

pub const __WASI_ERRNO_INPROGRESS: Errno = _

source

pub const __WASI_ERRNO_INTR: Errno = _

source

pub const __WASI_ERRNO_INVAL: Errno = _

source

pub const __WASI_ERRNO_IO: Errno = _

source

pub const __WASI_ERRNO_ISCONN: Errno = _

source

pub const __WASI_ERRNO_ISDIR: Errno = _

source

pub const __WASI_ERRNO_LOOP: Errno = _

source

pub const __WASI_ERRNO_MFILE: Errno = _

source

pub const __WASI_ERRNO_MSGSIZE: Errno = _

source

pub const __WASI_ERRNO_MULTIHOP: Errno = _

source

pub const __WASI_ERRNO_NAMETOOLONG: Errno = _

source

pub const __WASI_ERRNO_NETDOWN: Errno = _

source

pub const __WASI_ERRNO_NETRESET: Errno = _

source

pub const __WASI_ERRNO_NETUNREACH: Errno = _

source

pub const __WASI_ERRNO_NFILE: Errno = _

source

pub const __WASI_ERRNO_NOBUFS: Errno = _

source

pub const __WASI_ERRNO_NODEV: Errno = _

source

pub const __WASI_ERRNO_NOENT: Errno = _

source

pub const __WASI_ERRNO_NOEXEC: Errno = _

source

pub const __WASI_ERRNO_NOLCK: Errno = _

source

pub const __WASI_ERRNO_NOMEM: Errno = _

source

pub const __WASI_ERRNO_NOMSG: Errno = _

source

pub const __WASI_ERRNO_NOPROTOOPT: Errno = _

source

pub const __WASI_ERRNO_NOSPC: Errno = _

source

pub const __WASI_ERRNO_NOSYS: Errno = _

source

pub const __WASI_ERRNO_NOTCONN: Errno = _

source

pub const __WASI_ERRNO_NOTDIR: Errno = _

source

pub const __WASI_ERRNO_NOTEMPTY: Errno = _

source

pub const __WASI_ERRNO_NOTRECOVERABLE: Errno = _

source

pub const __WASI_ERRNO_NOTSOCK: Errno = _

source

pub const __WASI_ERRNO_NOTSUP: Errno = _

source

pub const __WASI_ERRNO_NOTTY: Errno = _

source

pub const __WASI_ERRNO_NXIO: Errno = _

source

pub const __WASI_ERRNO_OVERFLOW: Errno = _

source

pub const __WASI_ERRNO_OWNERDEAD: Errno = _

source

pub const __WASI_ERRNO_PERM: Errno = _

source

pub const __WASI_ERRNO_PIPE: Errno = _

source

pub const __WASI_ERRNO_PROTO: Errno = _

source

pub const __WASI_ERRNO_PROTONOSUPPORT: Errno = _

source

pub const __WASI_ERRNO_PROTOTYPE: Errno = _

source

pub const __WASI_ERRNO_RANGE: Errno = _

source

pub const __WASI_ERRNO_ROFS: Errno = _

source

pub const __WASI_ERRNO_SPIPE: Errno = _

source

pub const __WASI_ERRNO_SRCH: Errno = _

source

pub const __WASI_ERRNO_STALE: Errno = _

source

pub const __WASI_ERRNO_TIMEDOUT: Errno = _

source

pub const __WASI_ERRNO_TXTBSY: Errno = _

source

pub const __WASI_ERRNO_XDEV: Errno = _

source

pub const __WASI_ERRNO_NOTCAPABLE: Errno = _

source

pub const __WASI_ERRNO_AIADDRFAMILY: Errno = _

source

pub const __WASI_ERRNO_AIAGAIN: Errno = _

source

pub const __WASI_ERRNO_AIBADFLAG: Errno = _

source

pub const __WASI_ERRNO_AIFAIL: Errno = _

source

pub const __WASI_ERRNO_AIFAMILY: Errno = _

source

pub const __WASI_ERRNO_AIMEMORY: Errno = _

source

pub const __WASI_ERRNO_AINODATA: Errno = _

source

pub const __WASI_ERRNO_AINONAME: Errno = _

source

pub const __WASI_ERRNO_AISERVICE: Errno = _

source

pub const __WASI_ERRNO_AISOCKTYPE: Errno = _

source

pub const __WASI_ERRNO_AISYSTEM: Errno = _

Trait Implementations§

source§

impl Clone for Errno

source§

fn clone(&self) -> Errno

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Errno

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Errno

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<&Error> for Errno

source§

fn from(e: &Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Errno

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<ErrorKind> for Errno

source§

fn from(e: ErrorKind) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Errno

source§

fn from(e: Type) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Errno

source§

fn eq(&self, other: &Errno) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Errno

source§

impl Eq for Errno

source§

impl StructuralEq for Errno

source§

impl StructuralPartialEq for Errno

Auto Trait Implementations§

§

impl RefUnwindSafe for Errno

§

impl Send for Errno

§

impl Sync for Errno

§

impl Unpin for Errno

§

impl UnwindSafe for Errno

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/index.html b/async_wasi/snapshots/common/index.html new file mode 100644 index 000000000..c3a9ca7b3 --- /dev/null +++ b/async_wasi/snapshots/common/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common - Rust

Modules

\ No newline at end of file diff --git a/async_wasi/snapshots/common/memory/index.html b/async_wasi/snapshots/common/memory/index.html new file mode 100644 index 000000000..d35e09ba7 --- /dev/null +++ b/async_wasi/snapshots/common/memory/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::memory - Rust

Structs

Traits

\ No newline at end of file diff --git a/async_wasi/snapshots/common/memory/sidebar-items.js b/async_wasi/snapshots/common/memory/sidebar-items.js new file mode 100644 index 000000000..3f5aa6ed7 --- /dev/null +++ b/async_wasi/snapshots/common/memory/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["WasmPtr"],"trait":["Memory"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/memory/struct.WasmPtr.html b/async_wasi/snapshots/common/memory/struct.WasmPtr.html new file mode 100644 index 000000000..82d004933 --- /dev/null +++ b/async_wasi/snapshots/common/memory/struct.WasmPtr.html @@ -0,0 +1,17 @@ +WasmPtr in async_wasi::snapshots::common::memory - Rust
pub struct WasmPtr<T: Sized>(pub usize, _);

Tuple Fields§

§0: usize

Implementations§

source§

impl<T: Sized> WasmPtr<T>

source

pub fn is_null(&self) -> bool

Trait Implementations§

source§

impl<T: Sized> Add<usize> for WasmPtr<T>

§

type Output = WasmPtr<T>

The resulting type after applying the + operator.
source§

fn add(self, rhs: usize) -> Self::Output

Performs the + operation. Read more
source§

impl<T: Clone + Sized> Clone for WasmPtr<T>

source§

fn clone(&self) -> WasmPtr<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + Sized> Debug for WasmPtr<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Sized> From<WasmPtr<T>> for usize

source§

fn from(val: WasmPtr<T>) -> Self

Converts to this type from the input type.
source§

impl<T: Sized> From<usize> for WasmPtr<T>

source§

fn from(i: usize) -> Self

Converts to this type from the input type.
source§

impl<T: Sized> Sub<usize> for WasmPtr<T>

§

type Output = WasmPtr<T>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: usize) -> Self::Output

Performs the - operation. Read more
source§

impl<T: Copy + Sized> Copy for WasmPtr<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for WasmPtr<T>where + T: RefUnwindSafe,

§

impl<T> Send for WasmPtr<T>where + T: Send,

§

impl<T> Sync for WasmPtr<T>where + T: Sync,

§

impl<T> Unpin for WasmPtr<T>where + T: Unpin,

§

impl<T> UnwindSafe for WasmPtr<T>where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/memory/trait.Memory.html b/async_wasi/snapshots/common/memory/trait.Memory.html new file mode 100644 index 000000000..bf316e0c5 --- /dev/null +++ b/async_wasi/snapshots/common/memory/trait.Memory.html @@ -0,0 +1,53 @@ +Memory in async_wasi::snapshots::common::memory - Rust
pub trait Memory {
+    // Required methods
+    fn get_data<T: Sized>(&self, offset: WasmPtr<T>) -> Result<&T, Errno>;
+    fn get_slice<T: Sized>(
+        &self,
+        offset: WasmPtr<T>,
+        len: usize
+    ) -> Result<&[T], Errno>;
+    fn get_iovec<'a>(
+        &self,
+        iovec_ptr: WasmPtr<__wasi_ciovec_t>,
+        iovec_len: __wasi_size_t
+    ) -> Result<Vec<IoSlice<'a>>, Errno>;
+    fn mut_data<T: Sized>(
+        &mut self,
+        offset: WasmPtr<T>
+    ) -> Result<&mut T, Errno>;
+    fn mut_slice<T: Sized>(
+        &mut self,
+        offset: WasmPtr<T>,
+        len: usize
+    ) -> Result<&mut [T], Errno>;
+    fn mut_iovec(
+        &mut self,
+        iovec_ptr: WasmPtr<__wasi_iovec_t>,
+        iovec_len: __wasi_size_t
+    ) -> Result<Vec<IoSliceMut<'_>>, Errno>;
+    fn write_data<T: Sized>(
+        &mut self,
+        offset: WasmPtr<T>,
+        data: T
+    ) -> Result<(), Errno>;
+}

Required Methods§

source

fn get_data<T: Sized>(&self, offset: WasmPtr<T>) -> Result<&T, Errno>

source

fn get_slice<T: Sized>( + &self, + offset: WasmPtr<T>, + len: usize +) -> Result<&[T], Errno>

source

fn get_iovec<'a>( + &self, + iovec_ptr: WasmPtr<__wasi_ciovec_t>, + iovec_len: __wasi_size_t +) -> Result<Vec<IoSlice<'a>>, Errno>

source

fn mut_data<T: Sized>(&mut self, offset: WasmPtr<T>) -> Result<&mut T, Errno>

source

fn mut_slice<T: Sized>( + &mut self, + offset: WasmPtr<T>, + len: usize +) -> Result<&mut [T], Errno>

source

fn mut_iovec( + &mut self, + iovec_ptr: WasmPtr<__wasi_iovec_t>, + iovec_len: __wasi_size_t +) -> Result<Vec<IoSliceMut<'_>>, Errno>

source

fn write_data<T: Sized>( + &mut self, + offset: WasmPtr<T>, + data: T +) -> Result<(), Errno>

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/async_tokio/index.html b/async_wasi/snapshots/common/net/async_tokio/index.html new file mode 100644 index 000000000..65bc26058 --- /dev/null +++ b/async_wasi/snapshots/common/net/async_tokio/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::net::async_tokio - Rust

Structs

\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/async_tokio/sidebar-items.js b/async_wasi/snapshots/common/net/async_tokio/sidebar-items.js new file mode 100644 index 000000000..cc24b4fc3 --- /dev/null +++ b/async_wasi/snapshots/common/net/async_tokio/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["AsyncWasiSocket"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/net/async_tokio/struct.AsyncWasiSocket.html b/async_wasi/snapshots/common/net/async_tokio/struct.AsyncWasiSocket.html new file mode 100644 index 000000000..98ce7037d --- /dev/null +++ b/async_wasi/snapshots/common/net/async_tokio/struct.AsyncWasiSocket.html @@ -0,0 +1,34 @@ +AsyncWasiSocket in async_wasi::snapshots::common::net::async_tokio - Rust
pub struct AsyncWasiSocket {
+    pub state: WasiSocketState,
+    /* private fields */
+}

Fields§

§state: WasiSocketState

Implementations§

source§

impl AsyncWasiSocket

source§

impl AsyncWasiSocket

source

pub fn from_tcplistener( + listener: TcpListener, + state: WasiSocketState +) -> Result<Self>

source

pub fn from_udpsocket(socket: UdpSocket, state: WasiSocketState) -> Result<Self>

source§

impl AsyncWasiSocket

source

pub fn open(state: WasiSocketState) -> Result<Self>

source

pub fn bind(&mut self, addr: SocketAddr) -> Result<()>

source

pub fn device(&self) -> Result<Option<Vec<u8>>>

source

pub fn bind_device(&mut self, interface: Option<&[u8]>) -> Result<()>

source

pub fn listen(&mut self, backlog: u32) -> Result<()>

source

pub async fn accept(&mut self) -> Result<Self>

source

pub async fn connect(&mut self, addr: SocketAddr) -> Result<()>

source

pub async fn recv<'a>( + &self, + bufs: &mut [IoSliceMut<'a>], + flags: c_int +) -> Result<(usize, bool)>

source

pub async fn recv_from<'a>( + &self, + bufs: &mut [IoSliceMut<'a>], + flags: c_int +) -> Result<(usize, bool, Option<SocketAddr>)>

source

pub async fn send<'a>( + &self, + bufs: &[IoSlice<'a>], + flags: c_int +) -> Result<usize>

source

pub async fn send_to<'a>( + &self, + bufs: &[IoSlice<'a>], + addr: SocketAddr, + flags: c_int +) -> Result<usize>

source

pub fn shutdown(&mut self, how: Shutdown) -> Result<()>

source

pub fn get_peer(&mut self) -> Result<SocketAddr>

source

pub fn get_local(&mut self) -> Result<SocketAddr>

source

pub fn set_nonblocking(&mut self, nonblocking: bool) -> Result<()>

source

pub fn get_nonblocking(&self) -> bool

source

pub fn get_so_type(&self) -> (AddressFamily, SocketType)

source

pub fn get_so_accept_conn(&self) -> Result<bool>

source

pub fn sync_conn_state(&mut self)

source

pub fn set_so_reuseaddr(&mut self, reuseaddr: bool) -> Result<()>

source

pub fn get_so_reuseaddr(&self) -> bool

source

pub fn set_so_recv_buf_size(&mut self, buf_size: usize) -> Result<()>

source

pub fn get_so_recv_buf_size(&self) -> usize

source

pub fn set_so_send_buf_size(&mut self, buf_size: usize) -> Result<()>

source

pub fn get_so_send_buf_size(&mut self) -> usize

source

pub fn set_so_recv_timeout(&mut self, timeout: Option<Duration>) -> Result<()>

source

pub fn get_so_recv_timeout(&mut self) -> Option<Duration>

source

pub fn set_so_send_timeout(&mut self, timeout: Option<Duration>) -> Result<()>

source

pub fn get_so_send_timeout(&mut self) -> Option<Duration>

source

pub fn get_so_error(&mut self) -> Result<Option<Error>>

Trait Implementations§

source§

impl Debug for AsyncWasiSocket

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/enum.AddressFamily.html b/async_wasi/snapshots/common/net/enum.AddressFamily.html new file mode 100644 index 000000000..7791ff9e2 --- /dev/null +++ b/async_wasi/snapshots/common/net/enum.AddressFamily.html @@ -0,0 +1,15 @@ +AddressFamily in async_wasi::snapshots::common::net - Rust
pub enum AddressFamily {
+    Inet4,
+    Inet6,
+}

Variants§

§

Inet4

§

Inet6

Trait Implementations§

source§

impl Clone for AddressFamily

source§

fn clone(&self) -> AddressFamily

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddressFamily

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for AddressFamily

source§

fn default() -> AddressFamily

Returns the “default value” for a type. Read more
source§

impl Copy for AddressFamily

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/enum.ConnectState.html b/async_wasi/snapshots/common/net/enum.ConnectState.html new file mode 100644 index 000000000..f4970e125 --- /dev/null +++ b/async_wasi/snapshots/common/net/enum.ConnectState.html @@ -0,0 +1,19 @@ +ConnectState in async_wasi::snapshots::common::net - Rust
pub enum ConnectState {
+    Empty,
+    Listening,
+    Connected,
+    Connecting,
+}

Variants§

§

Empty

§

Listening

§

Connected

§

Connecting

Trait Implementations§

source§

impl Clone for ConnectState

source§

fn clone(&self) -> ConnectState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConnectState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ConnectState

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<ConnectState> for SerialConnectState

source§

fn from(s: ConnectState) -> Self

Converts to this type from the input type.
source§

impl From<SerialConnectState> for ConnectState

source§

fn from(val: SerialConnectState) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ConnectState

source§

fn eq(&self, other: &ConnectState) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for ConnectState

source§

impl Eq for ConnectState

source§

impl StructuralEq for ConnectState

source§

impl StructuralPartialEq for ConnectState

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/enum.PrePoll.html b/async_wasi/snapshots/common/net/enum.PrePoll.html new file mode 100644 index 000000000..083b4be90 --- /dev/null +++ b/async_wasi/snapshots/common/net/enum.PrePoll.html @@ -0,0 +1,17 @@ +PrePoll in async_wasi::snapshots::common::net - Rust
pub enum PrePoll {
+    OnlyFd(Vec<SubscriptionFd>),
+    OnlyClock(SubscriptionClock),
+    ClockAndFd(SubscriptionClock, Vec<SubscriptionFd>),
+}

Variants§

Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/enum.SocketType.html b/async_wasi/snapshots/common/net/enum.SocketType.html new file mode 100644 index 000000000..9209ea526 --- /dev/null +++ b/async_wasi/snapshots/common/net/enum.SocketType.html @@ -0,0 +1,15 @@ +SocketType in async_wasi::snapshots::common::net - Rust
pub enum SocketType {
+    Datagram,
+    Stream,
+}

Variants§

§

Datagram

§

Stream

Trait Implementations§

source§

impl Clone for SocketType

source§

fn clone(&self) -> SocketType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SocketType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SocketType

source§

fn default() -> SocketType

Returns the “default value” for a type. Read more
source§

impl Copy for SocketType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/enum.Subscription.html b/async_wasi/snapshots/common/net/enum.Subscription.html new file mode 100644 index 000000000..d3ab8feb3 --- /dev/null +++ b/async_wasi/snapshots/common/net/enum.Subscription.html @@ -0,0 +1,15 @@ +Subscription in async_wasi::snapshots::common::net - Rust
pub enum Subscription {
+    FD(SubscriptionFd),
+    RealClock(SubscriptionClock),
+}

Variants§

Implementations§

Trait Implementations§

source§

impl Clone for Subscription

source§

fn clone(&self) -> Subscription

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Subscription

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Subscription

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/enum.SubscriptionFdType.html b/async_wasi/snapshots/common/net/enum.SubscriptionFdType.html new file mode 100644 index 000000000..529669f5d --- /dev/null +++ b/async_wasi/snapshots/common/net/enum.SubscriptionFdType.html @@ -0,0 +1,19 @@ +SubscriptionFdType in async_wasi::snapshots::common::net - Rust
pub enum SubscriptionFdType {
+    Read(__wasi_userdata_t),
+    Write(__wasi_userdata_t),
+    Both {
+        read: __wasi_userdata_t,
+        write: __wasi_userdata_t,
+    },
+}

Variants§

Trait Implementations§

source§

impl Clone for SubscriptionFdType

source§

fn clone(&self) -> SubscriptionFdType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SubscriptionFdType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for SubscriptionFdType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/index.html b/async_wasi/snapshots/common/net/index.html new file mode 100644 index 000000000..9463b0660 --- /dev/null +++ b/async_wasi/snapshots/common/net/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::net - Rust

Re-exports

  • pub use super::vfs::*;

Modules

Structs

Enums

\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/sidebar-items.js b/async_wasi/snapshots/common/net/sidebar-items.js new file mode 100644 index 000000000..fb7b3f676 --- /dev/null +++ b/async_wasi/snapshots/common/net/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AddressFamily","ConnectState","PrePoll","SocketType","Subscription","SubscriptionFdType"],"mod":["async_tokio"],"struct":["SubscriptionClock","SubscriptionFd","WasiSocketState"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/net/struct.SubscriptionClock.html b/async_wasi/snapshots/common/net/struct.SubscriptionClock.html new file mode 100644 index 000000000..aa912ec2b --- /dev/null +++ b/async_wasi/snapshots/common/net/struct.SubscriptionClock.html @@ -0,0 +1,16 @@ +SubscriptionClock in async_wasi::snapshots::common::net - Rust
pub struct SubscriptionClock {
+    pub timeout: Option<SystemTime>,
+    pub userdata: __wasi_userdata_t,
+    pub err: Option<Errno>,
+}

Fields§

§timeout: Option<SystemTime>§userdata: __wasi_userdata_t§err: Option<Errno>

Trait Implementations§

source§

impl Clone for SubscriptionClock

source§

fn clone(&self) -> SubscriptionClock

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SubscriptionClock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for SubscriptionClock

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/struct.SubscriptionFd.html b/async_wasi/snapshots/common/net/struct.SubscriptionFd.html new file mode 100644 index 000000000..115ac8684 --- /dev/null +++ b/async_wasi/snapshots/common/net/struct.SubscriptionFd.html @@ -0,0 +1,15 @@ +SubscriptionFd in async_wasi::snapshots::common::net - Rust
pub struct SubscriptionFd {
+    pub fd: __wasi_fd_t,
+    pub type_: SubscriptionFdType,
+}

Fields§

§fd: __wasi_fd_t§type_: SubscriptionFdType

Implementations§

source§

impl SubscriptionFd

source

pub fn set_write(&mut self, userdata: __wasi_userdata_t)

source

pub fn set_read(&mut self, userdata: __wasi_userdata_t)

Trait Implementations§

source§

impl Clone for SubscriptionFd

source§

fn clone(&self) -> SubscriptionFd

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SubscriptionFd

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for SubscriptionFd

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/net/struct.WasiSocketState.html b/async_wasi/snapshots/common/net/struct.WasiSocketState.html new file mode 100644 index 000000000..5c9e40175 --- /dev/null +++ b/async_wasi/snapshots/common/net/struct.WasiSocketState.html @@ -0,0 +1,27 @@ +WasiSocketState in async_wasi::snapshots::common::net - Rust
pub struct WasiSocketState {
Show 14 fields + pub sock_type: (AddressFamily, SocketType), + pub local_addr: Option<SocketAddr>, + pub peer_addr: Option<SocketAddr>, + pub bind_device: Vec<u8>, + pub backlog: u32, + pub shutdown: Option<Shutdown>, + pub nonblocking: bool, + pub so_reuseaddr: bool, + pub so_conn_state: ConnectState, + pub so_recv_buf_size: usize, + pub so_send_buf_size: usize, + pub so_recv_timeout: Option<Duration>, + pub so_send_timeout: Option<Duration>, + pub fs_rights: WASIRights, +
}

Fields§

§sock_type: (AddressFamily, SocketType)§local_addr: Option<SocketAddr>§peer_addr: Option<SocketAddr>§bind_device: Vec<u8>§backlog: u32§shutdown: Option<Shutdown>§nonblocking: bool§so_reuseaddr: bool§so_conn_state: ConnectState§so_recv_buf_size: usize§so_send_buf_size: usize§so_recv_timeout: Option<Duration>§so_send_timeout: Option<Duration>§fs_rights: WASIRights

Trait Implementations§

source§

impl Clone for WasiSocketState

source§

fn clone(&self) -> WasiSocketState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiSocketState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for WasiSocketState

source§

fn default() -> WasiSocketState

Returns the “default value” for a type. Read more
source§

impl From<&SerialWasiSocketState> for WasiSocketState

source§

fn from(val: &SerialWasiSocketState) -> Self

Converts to this type from the input type.
source§

impl From<&WasiSocketState> for SerialWasiSocketState

source§

fn from(state: &WasiSocketState) -> Self

Converts to this type from the input type.
source§

impl From<SerialWasiSocketState> for WasiSocketState

source§

fn from(val: SerialWasiSocketState) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/sidebar-items.js b/async_wasi/snapshots/common/sidebar-items.js new file mode 100644 index 000000000..bcf9ed0ca --- /dev/null +++ b/async_wasi/snapshots/common/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["clock","error","memory","net","types","vfs"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_INET4.html b/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_INET4.html new file mode 100644 index 000000000..8715f127e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_INET4.html @@ -0,0 +1 @@ +__WASI_ADDRESS_FAMILY_INET4 in async_wasi::snapshots::common::types::__wasi_address_family_t - Rust
pub const __WASI_ADDRESS_FAMILY_INET4: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_INET6.html b/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_INET6.html new file mode 100644 index 000000000..5d028dd6d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_INET6.html @@ -0,0 +1 @@ +__WASI_ADDRESS_FAMILY_INET6 in async_wasi::snapshots::common::types::__wasi_address_family_t - Rust
pub const __WASI_ADDRESS_FAMILY_INET6: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_UNSPEC.html b/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_UNSPEC.html new file mode 100644 index 000000000..6735f1520 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_address_family_t/constant.__WASI_ADDRESS_FAMILY_UNSPEC.html @@ -0,0 +1 @@ +__WASI_ADDRESS_FAMILY_UNSPEC in async_wasi::snapshots::common::types::__wasi_address_family_t - Rust
pub const __WASI_ADDRESS_FAMILY_UNSPEC: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_address_family_t/index.html b/async_wasi/snapshots/common/types/__wasi_address_family_t/index.html new file mode 100644 index 000000000..1dfce191c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_address_family_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_address_family_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_address_family_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_address_family_t/sidebar-items.js new file mode 100644 index 000000000..7ce1793ed --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_address_family_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_ADDRESS_FAMILY_INET4","__WASI_ADDRESS_FAMILY_INET6","__WASI_ADDRESS_FAMILY_UNSPEC"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_address_family_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_address_family_t/type.Type.html new file mode 100644 index 000000000..cafd98ebb --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_address_family_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_address_family_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_DONTNEED.html b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_DONTNEED.html new file mode 100644 index 000000000..b68226122 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_DONTNEED.html @@ -0,0 +1 @@ +__WASI_ADVICE_DONTNEED in async_wasi::snapshots::common::types::__wasi_advice_t - Rust
pub const __WASI_ADVICE_DONTNEED: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_NOREUSE.html b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_NOREUSE.html new file mode 100644 index 000000000..1ed7dd414 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_NOREUSE.html @@ -0,0 +1 @@ +__WASI_ADVICE_NOREUSE in async_wasi::snapshots::common::types::__wasi_advice_t - Rust
pub const __WASI_ADVICE_NOREUSE: Type = 5;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_NORMAL.html b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_NORMAL.html new file mode 100644 index 000000000..5b1f05600 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_NORMAL.html @@ -0,0 +1 @@ +__WASI_ADVICE_NORMAL in async_wasi::snapshots::common::types::__wasi_advice_t - Rust
pub const __WASI_ADVICE_NORMAL: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_RANDOM.html b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_RANDOM.html new file mode 100644 index 000000000..b91d476f1 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_RANDOM.html @@ -0,0 +1 @@ +__WASI_ADVICE_RANDOM in async_wasi::snapshots::common::types::__wasi_advice_t - Rust
pub const __WASI_ADVICE_RANDOM: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_SEQUENTIAL.html b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_SEQUENTIAL.html new file mode 100644 index 000000000..7b40bfff8 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_SEQUENTIAL.html @@ -0,0 +1 @@ +__WASI_ADVICE_SEQUENTIAL in async_wasi::snapshots::common::types::__wasi_advice_t - Rust
pub const __WASI_ADVICE_SEQUENTIAL: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_WILLNEED.html b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_WILLNEED.html new file mode 100644 index 000000000..29f96e4c6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/constant.__WASI_ADVICE_WILLNEED.html @@ -0,0 +1 @@ +__WASI_ADVICE_WILLNEED in async_wasi::snapshots::common::types::__wasi_advice_t - Rust
pub const __WASI_ADVICE_WILLNEED: Type = 3;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/index.html b/async_wasi/snapshots/common/types/__wasi_advice_t/index.html new file mode 100644 index 000000000..bc1e4dac1 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_advice_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_advice_t/sidebar-items.js new file mode 100644 index 000000000..a495ba173 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_ADVICE_DONTNEED","__WASI_ADVICE_NOREUSE","__WASI_ADVICE_NORMAL","__WASI_ADVICE_RANDOM","__WASI_ADVICE_SEQUENTIAL","__WASI_ADVICE_WILLNEED"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_advice_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_advice_t/type.Type.html new file mode 100644 index 000000000..cda969686 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_advice_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_advice_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_ADDRCONFIG.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_ADDRCONFIG.html new file mode 100644 index 000000000..2963346a6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_ADDRCONFIG.html @@ -0,0 +1 @@ +__WASI_AIFLAGS_AI_ADDRCONFIG in async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust
pub const __WASI_AIFLAGS_AI_ADDRCONFIG: Type = 64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_ALL.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_ALL.html new file mode 100644 index 000000000..c012d5b54 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_ALL.html @@ -0,0 +1 @@ +__WASI_AIFLAGS_AI_ALL in async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust
pub const __WASI_AIFLAGS_AI_ALL: Type = 32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_CANONNAME.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_CANONNAME.html new file mode 100644 index 000000000..84cdc58f3 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_CANONNAME.html @@ -0,0 +1 @@ +__WASI_AIFLAGS_AI_CANONNAME in async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust
pub const __WASI_AIFLAGS_AI_CANONNAME: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_NUMERICHOST.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_NUMERICHOST.html new file mode 100644 index 000000000..feb260e77 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_NUMERICHOST.html @@ -0,0 +1 @@ +__WASI_AIFLAGS_AI_NUMERICHOST in async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust
pub const __WASI_AIFLAGS_AI_NUMERICHOST: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_NUMERICSERV.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_NUMERICSERV.html new file mode 100644 index 000000000..689af4253 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_NUMERICSERV.html @@ -0,0 +1 @@ +__WASI_AIFLAGS_AI_NUMERICSERV in async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust
pub const __WASI_AIFLAGS_AI_NUMERICSERV: Type = 8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_PASSIVE.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_PASSIVE.html new file mode 100644 index 000000000..ff6d290a0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_PASSIVE.html @@ -0,0 +1 @@ +__WASI_AIFLAGS_AI_PASSIVE in async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust
pub const __WASI_AIFLAGS_AI_PASSIVE: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_V4MAPPED.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_V4MAPPED.html new file mode 100644 index 000000000..685af09ae --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/constant.__WASI_AIFLAGS_AI_V4MAPPED.html @@ -0,0 +1 @@ +__WASI_AIFLAGS_AI_V4MAPPED in async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust
pub const __WASI_AIFLAGS_AI_V4MAPPED: Type = 16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/index.html new file mode 100644 index 000000000..f7fd51d87 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_aiflags_t/sidebar-items.js new file mode 100644 index 000000000..a82e2aa43 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_AIFLAGS_AI_ADDRCONFIG","__WASI_AIFLAGS_AI_ALL","__WASI_AIFLAGS_AI_CANONNAME","__WASI_AIFLAGS_AI_NUMERICHOST","__WASI_AIFLAGS_AI_NUMERICSERV","__WASI_AIFLAGS_AI_PASSIVE","__WASI_AIFLAGS_AI_V4MAPPED"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_aiflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_aiflags_t/type.Type.html new file mode 100644 index 000000000..73fb79d83 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_aiflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_aiflags_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_MONOTONIC.html b/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_MONOTONIC.html new file mode 100644 index 000000000..d52984d09 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_MONOTONIC.html @@ -0,0 +1 @@ +__WASI_CLOCKID_MONOTONIC in async_wasi::snapshots::common::types::__wasi_clockid_t - Rust
pub const __WASI_CLOCKID_MONOTONIC: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_PROCESS_CPUTIME_ID.html b/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_PROCESS_CPUTIME_ID.html new file mode 100644 index 000000000..39d759a03 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_PROCESS_CPUTIME_ID.html @@ -0,0 +1 @@ +__WASI_CLOCKID_PROCESS_CPUTIME_ID in async_wasi::snapshots::common::types::__wasi_clockid_t - Rust
pub const __WASI_CLOCKID_PROCESS_CPUTIME_ID: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_REALTIME.html b/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_REALTIME.html new file mode 100644 index 000000000..8f64baf3c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_REALTIME.html @@ -0,0 +1 @@ +__WASI_CLOCKID_REALTIME in async_wasi::snapshots::common::types::__wasi_clockid_t - Rust
pub const __WASI_CLOCKID_REALTIME: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_THREAD_CPUTIME_ID.html b/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_THREAD_CPUTIME_ID.html new file mode 100644 index 000000000..e7654e94c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_clockid_t/constant.__WASI_CLOCKID_THREAD_CPUTIME_ID.html @@ -0,0 +1 @@ +__WASI_CLOCKID_THREAD_CPUTIME_ID in async_wasi::snapshots::common::types::__wasi_clockid_t - Rust
pub const __WASI_CLOCKID_THREAD_CPUTIME_ID: Type = 3;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_clockid_t/index.html b/async_wasi/snapshots/common/types/__wasi_clockid_t/index.html new file mode 100644 index 000000000..b0be5bb39 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_clockid_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_clockid_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_clockid_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_clockid_t/sidebar-items.js new file mode 100644 index 000000000..3ec1c4804 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_clockid_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_CLOCKID_MONOTONIC","__WASI_CLOCKID_PROCESS_CPUTIME_ID","__WASI_CLOCKID_REALTIME","__WASI_CLOCKID_THREAD_CPUTIME_ID"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_clockid_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_clockid_t/type.Type.html new file mode 100644 index 000000000..9248645b6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_clockid_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_clockid_t - Rust
pub type Type = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_2BIG.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_2BIG.html new file mode 100644 index 000000000..9e5b15305 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_2BIG.html @@ -0,0 +1 @@ +__WASI_ERRNO_2BIG in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_2BIG: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ACCES.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ACCES.html new file mode 100644 index 000000000..4ce0017de --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ACCES.html @@ -0,0 +1 @@ +__WASI_ERRNO_ACCES in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_ACCES: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ADDRINUSE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ADDRINUSE.html new file mode 100644 index 000000000..0fd492a29 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ADDRINUSE.html @@ -0,0 +1 @@ +__WASI_ERRNO_ADDRINUSE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_ADDRINUSE: Type = 3;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ADDRNOTAVAIL.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ADDRNOTAVAIL.html new file mode 100644 index 000000000..d2ffad8e2 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ADDRNOTAVAIL.html @@ -0,0 +1 @@ +__WASI_ERRNO_ADDRNOTAVAIL in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_ADDRNOTAVAIL: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AFNOSUPPORT.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AFNOSUPPORT.html new file mode 100644 index 000000000..94781e7c0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AFNOSUPPORT.html @@ -0,0 +1 @@ +__WASI_ERRNO_AFNOSUPPORT in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AFNOSUPPORT: Type = 5;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AGAIN.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AGAIN.html new file mode 100644 index 000000000..0eba2955e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AGAIN.html @@ -0,0 +1 @@ +__WASI_ERRNO_AGAIN in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AGAIN: Type = 6;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIADDRFAMILY.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIADDRFAMILY.html new file mode 100644 index 000000000..fbc67ac07 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIADDRFAMILY.html @@ -0,0 +1 @@ +__WASI_ERRNO_AIADDRFAMILY in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AIADDRFAMILY: Type = 77;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIAGAIN.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIAGAIN.html new file mode 100644 index 000000000..80f178327 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIAGAIN.html @@ -0,0 +1 @@ +__WASI_ERRNO_AIAGAIN in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AIAGAIN: Type = 78;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIBADFLAG.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIBADFLAG.html new file mode 100644 index 000000000..1631972a4 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIBADFLAG.html @@ -0,0 +1 @@ +__WASI_ERRNO_AIBADFLAG in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AIBADFLAG: Type = 79;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIFAIL.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIFAIL.html new file mode 100644 index 000000000..5104ee38f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIFAIL.html @@ -0,0 +1 @@ +__WASI_ERRNO_AIFAIL in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AIFAIL: Type = 80;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIFAMILY.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIFAMILY.html new file mode 100644 index 000000000..f877f876d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIFAMILY.html @@ -0,0 +1 @@ +__WASI_ERRNO_AIFAMILY in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AIFAMILY: Type = 81;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIMEMORY.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIMEMORY.html new file mode 100644 index 000000000..9adbea1b3 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AIMEMORY.html @@ -0,0 +1 @@ +__WASI_ERRNO_AIMEMORY in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AIMEMORY: Type = 82;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AINODATA.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AINODATA.html new file mode 100644 index 000000000..983fd6507 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AINODATA.html @@ -0,0 +1 @@ +__WASI_ERRNO_AINODATA in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AINODATA: Type = 83;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AINONAME.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AINONAME.html new file mode 100644 index 000000000..12c562986 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AINONAME.html @@ -0,0 +1 @@ +__WASI_ERRNO_AINONAME in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AINONAME: Type = 84;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISERVICE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISERVICE.html new file mode 100644 index 000000000..10a1a1603 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISERVICE.html @@ -0,0 +1 @@ +__WASI_ERRNO_AISERVICE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AISERVICE: Type = 85;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISOCKTYPE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISOCKTYPE.html new file mode 100644 index 000000000..24d7d59e3 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISOCKTYPE.html @@ -0,0 +1 @@ +__WASI_ERRNO_AISOCKTYPE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AISOCKTYPE: Type = 86;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISYSTEM.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISYSTEM.html new file mode 100644 index 000000000..48bcddfcc --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_AISYSTEM.html @@ -0,0 +1 @@ +__WASI_ERRNO_AISYSTEM in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_AISYSTEM: Type = 87;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ALREADY.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ALREADY.html new file mode 100644 index 000000000..b73e237ee --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ALREADY.html @@ -0,0 +1 @@ +__WASI_ERRNO_ALREADY in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_ALREADY: Type = 7;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BADF.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BADF.html new file mode 100644 index 000000000..32e863900 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BADF.html @@ -0,0 +1 @@ +__WASI_ERRNO_BADF in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_BADF: Type = 8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BADMSG.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BADMSG.html new file mode 100644 index 000000000..252612449 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BADMSG.html @@ -0,0 +1 @@ +__WASI_ERRNO_BADMSG in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_BADMSG: Type = 9;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BUSY.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BUSY.html new file mode 100644 index 000000000..3ed300a69 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_BUSY.html @@ -0,0 +1 @@ +__WASI_ERRNO_BUSY in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_BUSY: Type = 10;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CANCELED.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CANCELED.html new file mode 100644 index 000000000..5b1a4e2bb --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CANCELED.html @@ -0,0 +1 @@ +__WASI_ERRNO_CANCELED in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_CANCELED: Type = 11;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CHILD.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CHILD.html new file mode 100644 index 000000000..df175879d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CHILD.html @@ -0,0 +1 @@ +__WASI_ERRNO_CHILD in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_CHILD: Type = 12;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNABORTED.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNABORTED.html new file mode 100644 index 000000000..17e0a5897 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNABORTED.html @@ -0,0 +1 @@ +__WASI_ERRNO_CONNABORTED in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_CONNABORTED: Type = 13;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNREFUSED.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNREFUSED.html new file mode 100644 index 000000000..85edf1d36 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNREFUSED.html @@ -0,0 +1 @@ +__WASI_ERRNO_CONNREFUSED in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_CONNREFUSED: Type = 14;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNRESET.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNRESET.html new file mode 100644 index 000000000..de19de9fa --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_CONNRESET.html @@ -0,0 +1 @@ +__WASI_ERRNO_CONNRESET in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_CONNRESET: Type = 15;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DEADLK.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DEADLK.html new file mode 100644 index 000000000..8c6e0d914 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DEADLK.html @@ -0,0 +1 @@ +__WASI_ERRNO_DEADLK in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_DEADLK: Type = 16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DESTADDRREQ.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DESTADDRREQ.html new file mode 100644 index 000000000..03ab4005a --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DESTADDRREQ.html @@ -0,0 +1 @@ +__WASI_ERRNO_DESTADDRREQ in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_DESTADDRREQ: Type = 17;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DOM.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DOM.html new file mode 100644 index 000000000..5e48ab276 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DOM.html @@ -0,0 +1 @@ +__WASI_ERRNO_DOM in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_DOM: Type = 18;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DQUOT.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DQUOT.html new file mode 100644 index 000000000..4c8fc540f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_DQUOT.html @@ -0,0 +1 @@ +__WASI_ERRNO_DQUOT in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_DQUOT: Type = 19;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_EXIST.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_EXIST.html new file mode 100644 index 000000000..adba63df0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_EXIST.html @@ -0,0 +1 @@ +__WASI_ERRNO_EXIST in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_EXIST: Type = 20;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_FAULT.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_FAULT.html new file mode 100644 index 000000000..9a2dba0cd --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_FAULT.html @@ -0,0 +1 @@ +__WASI_ERRNO_FAULT in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_FAULT: Type = 21;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_FBIG.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_FBIG.html new file mode 100644 index 000000000..5f67d692a --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_FBIG.html @@ -0,0 +1 @@ +__WASI_ERRNO_FBIG in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_FBIG: Type = 22;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_HOSTUNREACH.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_HOSTUNREACH.html new file mode 100644 index 000000000..9f1931bb6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_HOSTUNREACH.html @@ -0,0 +1 @@ +__WASI_ERRNO_HOSTUNREACH in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_HOSTUNREACH: Type = 23;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_IDRM.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_IDRM.html new file mode 100644 index 000000000..919ff2a0e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_IDRM.html @@ -0,0 +1 @@ +__WASI_ERRNO_IDRM in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_IDRM: Type = 24;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ILSEQ.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ILSEQ.html new file mode 100644 index 000000000..9f6116a4c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ILSEQ.html @@ -0,0 +1 @@ +__WASI_ERRNO_ILSEQ in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_ILSEQ: Type = 25;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INPROGRESS.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INPROGRESS.html new file mode 100644 index 000000000..32bb6098f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INPROGRESS.html @@ -0,0 +1 @@ +__WASI_ERRNO_INPROGRESS in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_INPROGRESS: Type = 26;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INTR.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INTR.html new file mode 100644 index 000000000..1a51eee3e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INTR.html @@ -0,0 +1 @@ +__WASI_ERRNO_INTR in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_INTR: Type = 27;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INVAL.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INVAL.html new file mode 100644 index 000000000..cb7233a87 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_INVAL.html @@ -0,0 +1 @@ +__WASI_ERRNO_INVAL in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_INVAL: Type = 28;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_IO.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_IO.html new file mode 100644 index 000000000..684c6be1d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_IO.html @@ -0,0 +1 @@ +__WASI_ERRNO_IO in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_IO: Type = 29;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ISCONN.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ISCONN.html new file mode 100644 index 000000000..61b714190 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ISCONN.html @@ -0,0 +1 @@ +__WASI_ERRNO_ISCONN in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_ISCONN: Type = 30;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ISDIR.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ISDIR.html new file mode 100644 index 000000000..1487f669f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ISDIR.html @@ -0,0 +1 @@ +__WASI_ERRNO_ISDIR in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_ISDIR: Type = 31;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_LOOP.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_LOOP.html new file mode 100644 index 000000000..2e1320141 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_LOOP.html @@ -0,0 +1 @@ +__WASI_ERRNO_LOOP in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_LOOP: Type = 32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MFILE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MFILE.html new file mode 100644 index 000000000..3e5151c42 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MFILE.html @@ -0,0 +1 @@ +__WASI_ERRNO_MFILE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_MFILE: Type = 33;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MLINK.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MLINK.html new file mode 100644 index 000000000..eb80f3884 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MLINK.html @@ -0,0 +1 @@ +__WASI_ERRNO_MLINK in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_MLINK: Type = 34;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MSGSIZE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MSGSIZE.html new file mode 100644 index 000000000..a175de588 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MSGSIZE.html @@ -0,0 +1 @@ +__WASI_ERRNO_MSGSIZE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_MSGSIZE: Type = 35;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MULTIHOP.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MULTIHOP.html new file mode 100644 index 000000000..a71106d22 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_MULTIHOP.html @@ -0,0 +1 @@ +__WASI_ERRNO_MULTIHOP in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_MULTIHOP: Type = 36;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NAMETOOLONG.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NAMETOOLONG.html new file mode 100644 index 000000000..af55be0d8 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NAMETOOLONG.html @@ -0,0 +1 @@ +__WASI_ERRNO_NAMETOOLONG in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NAMETOOLONG: Type = 37;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETDOWN.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETDOWN.html new file mode 100644 index 000000000..fd8988205 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETDOWN.html @@ -0,0 +1 @@ +__WASI_ERRNO_NETDOWN in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NETDOWN: Type = 38;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETRESET.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETRESET.html new file mode 100644 index 000000000..4bd796e33 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETRESET.html @@ -0,0 +1 @@ +__WASI_ERRNO_NETRESET in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NETRESET: Type = 39;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETUNREACH.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETUNREACH.html new file mode 100644 index 000000000..603c2cf8e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NETUNREACH.html @@ -0,0 +1 @@ +__WASI_ERRNO_NETUNREACH in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NETUNREACH: Type = 40;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NFILE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NFILE.html new file mode 100644 index 000000000..536dd5605 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NFILE.html @@ -0,0 +1 @@ +__WASI_ERRNO_NFILE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NFILE: Type = 41;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOBUFS.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOBUFS.html new file mode 100644 index 000000000..6316144d1 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOBUFS.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOBUFS in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOBUFS: Type = 42;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NODEV.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NODEV.html new file mode 100644 index 000000000..89bed56a2 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NODEV.html @@ -0,0 +1 @@ +__WASI_ERRNO_NODEV in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NODEV: Type = 43;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOENT.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOENT.html new file mode 100644 index 000000000..39d0ae563 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOENT.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOENT in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOENT: Type = 44;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOEXEC.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOEXEC.html new file mode 100644 index 000000000..a99cc61c4 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOEXEC.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOEXEC in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOEXEC: Type = 45;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOLCK.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOLCK.html new file mode 100644 index 000000000..7fc5abd40 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOLCK.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOLCK in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOLCK: Type = 46;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOLINK.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOLINK.html new file mode 100644 index 000000000..ec71ac955 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOLINK.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOLINK in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOLINK: Type = 47;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOMEM.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOMEM.html new file mode 100644 index 000000000..aa932f7eb --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOMEM.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOMEM in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOMEM: Type = 48;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOMSG.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOMSG.html new file mode 100644 index 000000000..1fac4857e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOMSG.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOMSG in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOMSG: Type = 49;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOPROTOOPT.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOPROTOOPT.html new file mode 100644 index 000000000..908dcafd5 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOPROTOOPT.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOPROTOOPT in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOPROTOOPT: Type = 50;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOSPC.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOSPC.html new file mode 100644 index 000000000..2bdb69189 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOSPC.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOSPC in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOSPC: Type = 51;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOSYS.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOSYS.html new file mode 100644 index 000000000..d61cf0222 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOSYS.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOSYS in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOSYS: Type = 52;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTCAPABLE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTCAPABLE.html new file mode 100644 index 000000000..ce7ac44c5 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTCAPABLE.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOTCAPABLE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOTCAPABLE: Type = 76;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTCONN.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTCONN.html new file mode 100644 index 000000000..188907a21 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTCONN.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOTCONN in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOTCONN: Type = 53;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTDIR.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTDIR.html new file mode 100644 index 000000000..bd3b308aa --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTDIR.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOTDIR in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOTDIR: Type = 54;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTEMPTY.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTEMPTY.html new file mode 100644 index 000000000..b1830ac66 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTEMPTY.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOTEMPTY in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOTEMPTY: Type = 55;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTRECOVERABLE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTRECOVERABLE.html new file mode 100644 index 000000000..1d657e751 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTRECOVERABLE.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOTRECOVERABLE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOTRECOVERABLE: Type = 56;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTSOCK.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTSOCK.html new file mode 100644 index 000000000..10b14a134 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTSOCK.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOTSOCK in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOTSOCK: Type = 57;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTSUP.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTSUP.html new file mode 100644 index 000000000..719ad7ae5 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTSUP.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOTSUP in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOTSUP: Type = 58;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTTY.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTTY.html new file mode 100644 index 000000000..e181ff03c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NOTTY.html @@ -0,0 +1 @@ +__WASI_ERRNO_NOTTY in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NOTTY: Type = 59;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NXIO.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NXIO.html new file mode 100644 index 000000000..28d9d56e1 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_NXIO.html @@ -0,0 +1 @@ +__WASI_ERRNO_NXIO in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_NXIO: Type = 60;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_OVERFLOW.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_OVERFLOW.html new file mode 100644 index 000000000..774ddee43 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_OVERFLOW.html @@ -0,0 +1 @@ +__WASI_ERRNO_OVERFLOW in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_OVERFLOW: Type = 61;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_OWNERDEAD.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_OWNERDEAD.html new file mode 100644 index 000000000..ecf182d4f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_OWNERDEAD.html @@ -0,0 +1 @@ +__WASI_ERRNO_OWNERDEAD in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_OWNERDEAD: Type = 62;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PERM.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PERM.html new file mode 100644 index 000000000..61cc244b2 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PERM.html @@ -0,0 +1 @@ +__WASI_ERRNO_PERM in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_PERM: Type = 63;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PIPE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PIPE.html new file mode 100644 index 000000000..c48f4fa10 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PIPE.html @@ -0,0 +1 @@ +__WASI_ERRNO_PIPE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_PIPE: Type = 64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTO.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTO.html new file mode 100644 index 000000000..ff18a1483 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTO.html @@ -0,0 +1 @@ +__WASI_ERRNO_PROTO in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_PROTO: Type = 65;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTONOSUPPORT.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTONOSUPPORT.html new file mode 100644 index 000000000..c17fc6b33 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTONOSUPPORT.html @@ -0,0 +1 @@ +__WASI_ERRNO_PROTONOSUPPORT in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_PROTONOSUPPORT: Type = 66;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTOTYPE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTOTYPE.html new file mode 100644 index 000000000..c152ab458 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_PROTOTYPE.html @@ -0,0 +1 @@ +__WASI_ERRNO_PROTOTYPE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_PROTOTYPE: Type = 67;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_RANGE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_RANGE.html new file mode 100644 index 000000000..4e13b2544 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_RANGE.html @@ -0,0 +1 @@ +__WASI_ERRNO_RANGE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_RANGE: Type = 68;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ROFS.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ROFS.html new file mode 100644 index 000000000..92ab4912f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_ROFS.html @@ -0,0 +1 @@ +__WASI_ERRNO_ROFS in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_ROFS: Type = 69;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SPIPE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SPIPE.html new file mode 100644 index 000000000..6d5a49e31 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SPIPE.html @@ -0,0 +1 @@ +__WASI_ERRNO_SPIPE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_SPIPE: Type = 70;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SRCH.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SRCH.html new file mode 100644 index 000000000..016818c69 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SRCH.html @@ -0,0 +1 @@ +__WASI_ERRNO_SRCH in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_SRCH: Type = 71;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_STALE.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_STALE.html new file mode 100644 index 000000000..53c97007e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_STALE.html @@ -0,0 +1 @@ +__WASI_ERRNO_STALE in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_STALE: Type = 72;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SUCCESS.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SUCCESS.html new file mode 100644 index 000000000..95aca28f7 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_SUCCESS.html @@ -0,0 +1 @@ +__WASI_ERRNO_SUCCESS in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_SUCCESS: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_TIMEDOUT.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_TIMEDOUT.html new file mode 100644 index 000000000..3339004cb --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_TIMEDOUT.html @@ -0,0 +1 @@ +__WASI_ERRNO_TIMEDOUT in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_TIMEDOUT: Type = 73;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_TXTBSY.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_TXTBSY.html new file mode 100644 index 000000000..2c5c956cd --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_TXTBSY.html @@ -0,0 +1 @@ +__WASI_ERRNO_TXTBSY in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_TXTBSY: Type = 74;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_XDEV.html b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_XDEV.html new file mode 100644 index 000000000..ab81897ff --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/constant.__WASI_ERRNO_XDEV.html @@ -0,0 +1 @@ +__WASI_ERRNO_XDEV in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub const __WASI_ERRNO_XDEV: Type = 75;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/index.html b/async_wasi/snapshots/common/types/__wasi_errno_t/index.html new file mode 100644 index 000000000..aa089923d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_errno_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_errno_t/sidebar-items.js new file mode 100644 index 000000000..6b291af09 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_ERRNO_2BIG","__WASI_ERRNO_ACCES","__WASI_ERRNO_ADDRINUSE","__WASI_ERRNO_ADDRNOTAVAIL","__WASI_ERRNO_AFNOSUPPORT","__WASI_ERRNO_AGAIN","__WASI_ERRNO_AIADDRFAMILY","__WASI_ERRNO_AIAGAIN","__WASI_ERRNO_AIBADFLAG","__WASI_ERRNO_AIFAIL","__WASI_ERRNO_AIFAMILY","__WASI_ERRNO_AIMEMORY","__WASI_ERRNO_AINODATA","__WASI_ERRNO_AINONAME","__WASI_ERRNO_AISERVICE","__WASI_ERRNO_AISOCKTYPE","__WASI_ERRNO_AISYSTEM","__WASI_ERRNO_ALREADY","__WASI_ERRNO_BADF","__WASI_ERRNO_BADMSG","__WASI_ERRNO_BUSY","__WASI_ERRNO_CANCELED","__WASI_ERRNO_CHILD","__WASI_ERRNO_CONNABORTED","__WASI_ERRNO_CONNREFUSED","__WASI_ERRNO_CONNRESET","__WASI_ERRNO_DEADLK","__WASI_ERRNO_DESTADDRREQ","__WASI_ERRNO_DOM","__WASI_ERRNO_DQUOT","__WASI_ERRNO_EXIST","__WASI_ERRNO_FAULT","__WASI_ERRNO_FBIG","__WASI_ERRNO_HOSTUNREACH","__WASI_ERRNO_IDRM","__WASI_ERRNO_ILSEQ","__WASI_ERRNO_INPROGRESS","__WASI_ERRNO_INTR","__WASI_ERRNO_INVAL","__WASI_ERRNO_IO","__WASI_ERRNO_ISCONN","__WASI_ERRNO_ISDIR","__WASI_ERRNO_LOOP","__WASI_ERRNO_MFILE","__WASI_ERRNO_MLINK","__WASI_ERRNO_MSGSIZE","__WASI_ERRNO_MULTIHOP","__WASI_ERRNO_NAMETOOLONG","__WASI_ERRNO_NETDOWN","__WASI_ERRNO_NETRESET","__WASI_ERRNO_NETUNREACH","__WASI_ERRNO_NFILE","__WASI_ERRNO_NOBUFS","__WASI_ERRNO_NODEV","__WASI_ERRNO_NOENT","__WASI_ERRNO_NOEXEC","__WASI_ERRNO_NOLCK","__WASI_ERRNO_NOLINK","__WASI_ERRNO_NOMEM","__WASI_ERRNO_NOMSG","__WASI_ERRNO_NOPROTOOPT","__WASI_ERRNO_NOSPC","__WASI_ERRNO_NOSYS","__WASI_ERRNO_NOTCAPABLE","__WASI_ERRNO_NOTCONN","__WASI_ERRNO_NOTDIR","__WASI_ERRNO_NOTEMPTY","__WASI_ERRNO_NOTRECOVERABLE","__WASI_ERRNO_NOTSOCK","__WASI_ERRNO_NOTSUP","__WASI_ERRNO_NOTTY","__WASI_ERRNO_NXIO","__WASI_ERRNO_OVERFLOW","__WASI_ERRNO_OWNERDEAD","__WASI_ERRNO_PERM","__WASI_ERRNO_PIPE","__WASI_ERRNO_PROTO","__WASI_ERRNO_PROTONOSUPPORT","__WASI_ERRNO_PROTOTYPE","__WASI_ERRNO_RANGE","__WASI_ERRNO_ROFS","__WASI_ERRNO_SPIPE","__WASI_ERRNO_SRCH","__WASI_ERRNO_STALE","__WASI_ERRNO_SUCCESS","__WASI_ERRNO_TIMEDOUT","__WASI_ERRNO_TXTBSY","__WASI_ERRNO_XDEV"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_errno_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_errno_t/type.Type.html new file mode 100644 index 000000000..159323463 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_errno_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_errno_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/constant.__WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP.html b/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/constant.__WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP.html new file mode 100644 index 000000000..88611f83f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/constant.__WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP.html @@ -0,0 +1 @@ +__WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP in async_wasi::snapshots::common::types::__wasi_eventrwflags_t - Rust
pub const __WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/index.html new file mode 100644 index 000000000..a7a8572e4 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_eventrwflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/sidebar-items.js new file mode 100644 index 000000000..e727f3b0b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/type.Type.html new file mode 100644 index 000000000..21fd4ed1a --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventrwflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_eventrwflags_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_CLOCK.html b/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_CLOCK.html new file mode 100644 index 000000000..87a550746 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_CLOCK.html @@ -0,0 +1 @@ +__WASI_EVENTTYPE_CLOCK in async_wasi::snapshots::common::types::__wasi_eventtype_t - Rust
pub const __WASI_EVENTTYPE_CLOCK: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_FD_READ.html b/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_FD_READ.html new file mode 100644 index 000000000..051d30906 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_FD_READ.html @@ -0,0 +1 @@ +__WASI_EVENTTYPE_FD_READ in async_wasi::snapshots::common::types::__wasi_eventtype_t - Rust
pub const __WASI_EVENTTYPE_FD_READ: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_FD_WRITE.html b/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_FD_WRITE.html new file mode 100644 index 000000000..8eeaf8129 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventtype_t/constant.__WASI_EVENTTYPE_FD_WRITE.html @@ -0,0 +1 @@ +__WASI_EVENTTYPE_FD_WRITE in async_wasi::snapshots::common::types::__wasi_eventtype_t - Rust
pub const __WASI_EVENTTYPE_FD_WRITE: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventtype_t/index.html b/async_wasi/snapshots/common/types/__wasi_eventtype_t/index.html new file mode 100644 index 000000000..2b6b877b4 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventtype_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_eventtype_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventtype_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_eventtype_t/sidebar-items.js new file mode 100644 index 000000000..133d0f73c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventtype_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_EVENTTYPE_CLOCK","__WASI_EVENTTYPE_FD_READ","__WASI_EVENTTYPE_FD_WRITE"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_eventtype_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_eventtype_t/type.Type.html new file mode 100644 index 000000000..d2ead31f4 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_eventtype_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_eventtype_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_APPEND.html b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_APPEND.html new file mode 100644 index 000000000..e85c96d20 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_APPEND.html @@ -0,0 +1 @@ +__WASI_FDFLAGS_APPEND in async_wasi::snapshots::common::types::__wasi_fdflags_t - Rust
pub const __WASI_FDFLAGS_APPEND: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_DSYNC.html b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_DSYNC.html new file mode 100644 index 000000000..f6398a305 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_DSYNC.html @@ -0,0 +1 @@ +__WASI_FDFLAGS_DSYNC in async_wasi::snapshots::common::types::__wasi_fdflags_t - Rust
pub const __WASI_FDFLAGS_DSYNC: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_NONBLOCK.html b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_NONBLOCK.html new file mode 100644 index 000000000..c7a7b7781 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_NONBLOCK.html @@ -0,0 +1 @@ +__WASI_FDFLAGS_NONBLOCK in async_wasi::snapshots::common::types::__wasi_fdflags_t - Rust
pub const __WASI_FDFLAGS_NONBLOCK: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_RSYNC.html b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_RSYNC.html new file mode 100644 index 000000000..b768004ae --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_RSYNC.html @@ -0,0 +1 @@ +__WASI_FDFLAGS_RSYNC in async_wasi::snapshots::common::types::__wasi_fdflags_t - Rust
pub const __WASI_FDFLAGS_RSYNC: Type = 8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_SYNC.html b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_SYNC.html new file mode 100644 index 000000000..628889b61 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fdflags_t/constant.__WASI_FDFLAGS_SYNC.html @@ -0,0 +1 @@ +__WASI_FDFLAGS_SYNC in async_wasi::snapshots::common::types::__wasi_fdflags_t - Rust
pub const __WASI_FDFLAGS_SYNC: Type = 16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fdflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_fdflags_t/index.html new file mode 100644 index 000000000..66cfa6788 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fdflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_fdflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fdflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_fdflags_t/sidebar-items.js new file mode 100644 index 000000000..895f4a643 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fdflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_FDFLAGS_APPEND","__WASI_FDFLAGS_DSYNC","__WASI_FDFLAGS_NONBLOCK","__WASI_FDFLAGS_RSYNC","__WASI_FDFLAGS_SYNC"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fdflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_fdflags_t/type.Type.html new file mode 100644 index 000000000..1f9652cf2 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fdflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_fdflags_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_BLOCK_DEVICE.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_BLOCK_DEVICE.html new file mode 100644 index 000000000..97cf30a46 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_BLOCK_DEVICE.html @@ -0,0 +1 @@ +__WASI_FILETYPE_BLOCK_DEVICE in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub const __WASI_FILETYPE_BLOCK_DEVICE: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_CHARACTER_DEVICE.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_CHARACTER_DEVICE.html new file mode 100644 index 000000000..0ec637bbc --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_CHARACTER_DEVICE.html @@ -0,0 +1 @@ +__WASI_FILETYPE_CHARACTER_DEVICE in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub const __WASI_FILETYPE_CHARACTER_DEVICE: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_DIRECTORY.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_DIRECTORY.html new file mode 100644 index 000000000..13aa6a506 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_DIRECTORY.html @@ -0,0 +1 @@ +__WASI_FILETYPE_DIRECTORY in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub const __WASI_FILETYPE_DIRECTORY: Type = 3;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_REGULAR_FILE.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_REGULAR_FILE.html new file mode 100644 index 000000000..9c77a5f98 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_REGULAR_FILE.html @@ -0,0 +1 @@ +__WASI_FILETYPE_REGULAR_FILE in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub const __WASI_FILETYPE_REGULAR_FILE: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SOCKET_DGRAM.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SOCKET_DGRAM.html new file mode 100644 index 000000000..52f35f95c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SOCKET_DGRAM.html @@ -0,0 +1 @@ +__WASI_FILETYPE_SOCKET_DGRAM in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub const __WASI_FILETYPE_SOCKET_DGRAM: Type = 5;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SOCKET_STREAM.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SOCKET_STREAM.html new file mode 100644 index 000000000..c0de197e5 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SOCKET_STREAM.html @@ -0,0 +1 @@ +__WASI_FILETYPE_SOCKET_STREAM in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub const __WASI_FILETYPE_SOCKET_STREAM: Type = 6;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SYMBOLIC_LINK.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SYMBOLIC_LINK.html new file mode 100644 index 000000000..b3ece0e1b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_SYMBOLIC_LINK.html @@ -0,0 +1 @@ +__WASI_FILETYPE_SYMBOLIC_LINK in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub const __WASI_FILETYPE_SYMBOLIC_LINK: Type = 7;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_UNKNOWN.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_UNKNOWN.html new file mode 100644 index 000000000..bd1bf4024 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/constant.__WASI_FILETYPE_UNKNOWN.html @@ -0,0 +1 @@ +__WASI_FILETYPE_UNKNOWN in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub const __WASI_FILETYPE_UNKNOWN: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/index.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/index.html new file mode 100644 index 000000000..9f759af1b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_filetype_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_filetype_t/sidebar-items.js new file mode 100644 index 000000000..4a5f5be88 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_FILETYPE_BLOCK_DEVICE","__WASI_FILETYPE_CHARACTER_DEVICE","__WASI_FILETYPE_DIRECTORY","__WASI_FILETYPE_REGULAR_FILE","__WASI_FILETYPE_SOCKET_DGRAM","__WASI_FILETYPE_SOCKET_STREAM","__WASI_FILETYPE_SYMBOLIC_LINK","__WASI_FILETYPE_UNKNOWN"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_filetype_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_filetype_t/type.Type.html new file mode 100644 index 000000000..efd0cb68a --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_filetype_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_filetype_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_ATIM.html b/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_ATIM.html new file mode 100644 index 000000000..d95ac43c5 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_ATIM.html @@ -0,0 +1 @@ +__WASI_FSTFLAGS_ATIM in async_wasi::snapshots::common::types::__wasi_fstflags_t - Rust
pub const __WASI_FSTFLAGS_ATIM: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_ATIM_NOW.html b/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_ATIM_NOW.html new file mode 100644 index 000000000..9cc999fbd --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_ATIM_NOW.html @@ -0,0 +1 @@ +__WASI_FSTFLAGS_ATIM_NOW in async_wasi::snapshots::common::types::__wasi_fstflags_t - Rust
pub const __WASI_FSTFLAGS_ATIM_NOW: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_MTIM.html b/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_MTIM.html new file mode 100644 index 000000000..412dd3f79 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_MTIM.html @@ -0,0 +1 @@ +__WASI_FSTFLAGS_MTIM in async_wasi::snapshots::common::types::__wasi_fstflags_t - Rust
pub const __WASI_FSTFLAGS_MTIM: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_MTIM_NOW.html b/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_MTIM_NOW.html new file mode 100644 index 000000000..12bde4465 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fstflags_t/constant.__WASI_FSTFLAGS_MTIM_NOW.html @@ -0,0 +1 @@ +__WASI_FSTFLAGS_MTIM_NOW in async_wasi::snapshots::common::types::__wasi_fstflags_t - Rust
pub const __WASI_FSTFLAGS_MTIM_NOW: Type = 8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fstflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_fstflags_t/index.html new file mode 100644 index 000000000..ab4d9ae10 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fstflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_fstflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fstflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_fstflags_t/sidebar-items.js new file mode 100644 index 000000000..8fc2b91f9 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fstflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_FSTFLAGS_ATIM","__WASI_FSTFLAGS_ATIM_NOW","__WASI_FSTFLAGS_MTIM","__WASI_FSTFLAGS_MTIM_NOW"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_fstflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_fstflags_t/type.Type.html new file mode 100644 index 000000000..a351d72ac --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_fstflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_fstflags_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_lookupflags_t/constant.__WASI_LOOKUPFLAGS_SYMLINK_FOLLOW.html b/async_wasi/snapshots/common/types/__wasi_lookupflags_t/constant.__WASI_LOOKUPFLAGS_SYMLINK_FOLLOW.html new file mode 100644 index 000000000..8afe6acb2 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_lookupflags_t/constant.__WASI_LOOKUPFLAGS_SYMLINK_FOLLOW.html @@ -0,0 +1 @@ +__WASI_LOOKUPFLAGS_SYMLINK_FOLLOW in async_wasi::snapshots::common::types::__wasi_lookupflags_t - Rust
pub const __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_lookupflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_lookupflags_t/index.html new file mode 100644 index 000000000..eed137350 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_lookupflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_lookupflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_lookupflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_lookupflags_t/sidebar-items.js new file mode 100644 index 000000000..6283c5dbe --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_lookupflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_LOOKUPFLAGS_SYMLINK_FOLLOW"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_lookupflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_lookupflags_t/type.Type.html new file mode 100644 index 000000000..829266bde --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_lookupflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_lookupflags_t - Rust
pub type Type = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_CREAT.html b/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_CREAT.html new file mode 100644 index 000000000..285eccbab --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_CREAT.html @@ -0,0 +1 @@ +__WASI_OFLAGS_CREAT in async_wasi::snapshots::common::types::__wasi_oflags_t - Rust
pub const __WASI_OFLAGS_CREAT: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_DIRECTORY.html b/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_DIRECTORY.html new file mode 100644 index 000000000..b6ac50585 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_DIRECTORY.html @@ -0,0 +1 @@ +__WASI_OFLAGS_DIRECTORY in async_wasi::snapshots::common::types::__wasi_oflags_t - Rust
pub const __WASI_OFLAGS_DIRECTORY: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_EXCL.html b/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_EXCL.html new file mode 100644 index 000000000..f871e1831 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_EXCL.html @@ -0,0 +1 @@ +__WASI_OFLAGS_EXCL in async_wasi::snapshots::common::types::__wasi_oflags_t - Rust
pub const __WASI_OFLAGS_EXCL: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_TRUNC.html b/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_TRUNC.html new file mode 100644 index 000000000..8ebf1541a --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_oflags_t/constant.__WASI_OFLAGS_TRUNC.html @@ -0,0 +1 @@ +__WASI_OFLAGS_TRUNC in async_wasi::snapshots::common::types::__wasi_oflags_t - Rust
pub const __WASI_OFLAGS_TRUNC: Type = 8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_oflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_oflags_t/index.html new file mode 100644 index 000000000..f287698eb --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_oflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_oflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_oflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_oflags_t/sidebar-items.js new file mode 100644 index 000000000..d8f7d2b50 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_oflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_OFLAGS_CREAT","__WASI_OFLAGS_DIRECTORY","__WASI_OFLAGS_EXCL","__WASI_OFLAGS_TRUNC"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_oflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_oflags_t/type.Type.html new file mode 100644 index 000000000..8694ed5a6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_oflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_oflags_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_preopentype_t/constant.__WASI_PREOPENTYPE_DIR.html b/async_wasi/snapshots/common/types/__wasi_preopentype_t/constant.__WASI_PREOPENTYPE_DIR.html new file mode 100644 index 000000000..add6c1ea0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_preopentype_t/constant.__WASI_PREOPENTYPE_DIR.html @@ -0,0 +1 @@ +__WASI_PREOPENTYPE_DIR in async_wasi::snapshots::common::types::__wasi_preopentype_t - Rust
pub const __WASI_PREOPENTYPE_DIR: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_preopentype_t/index.html b/async_wasi/snapshots/common/types/__wasi_preopentype_t/index.html new file mode 100644 index 000000000..b9e70b618 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_preopentype_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_preopentype_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_preopentype_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_preopentype_t/sidebar-items.js new file mode 100644 index 000000000..3d9512be9 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_preopentype_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_PREOPENTYPE_DIR"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_preopentype_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_preopentype_t/type.Type.html new file mode 100644 index 000000000..56e5ca245 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_preopentype_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_preopentype_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_IP.html b/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_IP.html new file mode 100644 index 000000000..60b4cf180 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_IP.html @@ -0,0 +1 @@ +__WASI_PROTOCOL_IPPROTO_IP in async_wasi::snapshots::common::types::__wasi_protocol_t - Rust
pub const __WASI_PROTOCOL_IPPROTO_IP: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_TCP.html b/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_TCP.html new file mode 100644 index 000000000..89e50e79b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_TCP.html @@ -0,0 +1 @@ +__WASI_PROTOCOL_IPPROTO_TCP in async_wasi::snapshots::common::types::__wasi_protocol_t - Rust
pub const __WASI_PROTOCOL_IPPROTO_TCP: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_UDP.html b/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_UDP.html new file mode 100644 index 000000000..7618acbc8 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_protocol_t/constant.__WASI_PROTOCOL_IPPROTO_UDP.html @@ -0,0 +1 @@ +__WASI_PROTOCOL_IPPROTO_UDP in async_wasi::snapshots::common::types::__wasi_protocol_t - Rust
pub const __WASI_PROTOCOL_IPPROTO_UDP: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_protocol_t/index.html b/async_wasi/snapshots/common/types/__wasi_protocol_t/index.html new file mode 100644 index 000000000..12c634ed6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_protocol_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_protocol_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_protocol_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_protocol_t/sidebar-items.js new file mode 100644 index 000000000..cfdd59f4b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_protocol_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_PROTOCOL_IPPROTO_IP","__WASI_PROTOCOL_IPPROTO_TCP","__WASI_PROTOCOL_IPPROTO_UDP"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_protocol_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_protocol_t/type.Type.html new file mode 100644 index 000000000..732494c17 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_protocol_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_protocol_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_riflags_t/constant.__WASI_RIFLAGS_RECV_PEEK.html b/async_wasi/snapshots/common/types/__wasi_riflags_t/constant.__WASI_RIFLAGS_RECV_PEEK.html new file mode 100644 index 000000000..dcf280650 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_riflags_t/constant.__WASI_RIFLAGS_RECV_PEEK.html @@ -0,0 +1 @@ +__WASI_RIFLAGS_RECV_PEEK in async_wasi::snapshots::common::types::__wasi_riflags_t - Rust
pub const __WASI_RIFLAGS_RECV_PEEK: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_riflags_t/constant.__WASI_RIFLAGS_RECV_WAITALL.html b/async_wasi/snapshots/common/types/__wasi_riflags_t/constant.__WASI_RIFLAGS_RECV_WAITALL.html new file mode 100644 index 000000000..0d7a0ce62 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_riflags_t/constant.__WASI_RIFLAGS_RECV_WAITALL.html @@ -0,0 +1 @@ +__WASI_RIFLAGS_RECV_WAITALL in async_wasi::snapshots::common::types::__wasi_riflags_t - Rust
pub const __WASI_RIFLAGS_RECV_WAITALL: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_riflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_riflags_t/index.html new file mode 100644 index 000000000..0c51a52a9 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_riflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_riflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_riflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_riflags_t/sidebar-items.js new file mode 100644 index 000000000..6c582eba0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_riflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_RIFLAGS_RECV_PEEK","__WASI_RIFLAGS_RECV_WAITALL"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_riflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_riflags_t/type.Type.html new file mode 100644 index 000000000..24d53c093 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_riflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_riflags_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_ADVISE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_ADVISE.html new file mode 100644 index 000000000..559eaee43 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_ADVISE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_ADVISE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_ADVISE: Type = 128;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_ALLOCATE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_ALLOCATE.html new file mode 100644 index 000000000..12f641068 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_ALLOCATE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_ALLOCATE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_ALLOCATE: Type = 256;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_DATASYNC.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_DATASYNC.html new file mode 100644 index 000000000..ba741c6cd --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_DATASYNC.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_DATASYNC in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_DATASYNC: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FDSTAT_SET_FLAGS.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FDSTAT_SET_FLAGS.html new file mode 100644 index 000000000..e7670e3d2 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FDSTAT_SET_FLAGS.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_FDSTAT_SET_FLAGS in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_FDSTAT_SET_FLAGS: Type = 8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_GET.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_GET.html new file mode 100644 index 000000000..bc0316db3 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_GET.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_FILESTAT_GET in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_FILESTAT_GET: Type = 2097152;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_SET_SIZE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_SET_SIZE.html new file mode 100644 index 000000000..62a98fb15 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_SET_SIZE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_FILESTAT_SET_SIZE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_FILESTAT_SET_SIZE: Type = 4194304;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_SET_TIMES.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_SET_TIMES.html new file mode 100644 index 000000000..5ba9793fc --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_FILESTAT_SET_TIMES.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_FILESTAT_SET_TIMES in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_FILESTAT_SET_TIMES: Type = 8388608;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_READ.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_READ.html new file mode 100644 index 000000000..2515fc26f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_READ.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_READ in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_READ: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_READDIR.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_READDIR.html new file mode 100644 index 000000000..53c63e2e9 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_READDIR.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_READDIR in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_READDIR: Type = 16384;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_SEEK.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_SEEK.html new file mode 100644 index 000000000..5f704833d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_SEEK.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_SEEK in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_SEEK: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_SYNC.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_SYNC.html new file mode 100644 index 000000000..609cd68f6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_SYNC.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_SYNC in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_SYNC: Type = 16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_TELL.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_TELL.html new file mode 100644 index 000000000..204786b6a --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_TELL.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_TELL in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_TELL: Type = 32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_WRITE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_WRITE.html new file mode 100644 index 000000000..d1260e164 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_FD_WRITE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_FD_WRITE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_FD_WRITE: Type = 64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_CREATE_DIRECTORY.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_CREATE_DIRECTORY.html new file mode 100644 index 000000000..1d33445c4 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_CREATE_DIRECTORY.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_CREATE_DIRECTORY in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_CREATE_DIRECTORY: Type = 512;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_CREATE_FILE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_CREATE_FILE.html new file mode 100644 index 000000000..859e8ab0c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_CREATE_FILE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_CREATE_FILE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_CREATE_FILE: Type = 1024;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_GET.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_GET.html new file mode 100644 index 000000000..201d01ba6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_GET.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_FILESTAT_GET in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_FILESTAT_GET: Type = 262144;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_SET_SIZE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_SET_SIZE.html new file mode 100644 index 000000000..4ca55a49a --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_SET_SIZE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_FILESTAT_SET_SIZE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_FILESTAT_SET_SIZE: Type = 524288;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_SET_TIMES.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_SET_TIMES.html new file mode 100644 index 000000000..e0a59db37 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_FILESTAT_SET_TIMES.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_FILESTAT_SET_TIMES in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_FILESTAT_SET_TIMES: Type = 1048576;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_LINK_SOURCE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_LINK_SOURCE.html new file mode 100644 index 000000000..3d79c2dec --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_LINK_SOURCE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_LINK_SOURCE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_LINK_SOURCE: Type = 2048;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_LINK_TARGET.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_LINK_TARGET.html new file mode 100644 index 000000000..6f023e4fc --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_LINK_TARGET.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_LINK_TARGET in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_LINK_TARGET: Type = 4096;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_OPEN.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_OPEN.html new file mode 100644 index 000000000..5034f05c5 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_OPEN.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_OPEN in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_OPEN: Type = 8192;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_READLINK.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_READLINK.html new file mode 100644 index 000000000..2dc639f18 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_READLINK.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_READLINK in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_READLINK: Type = 32768;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_REMOVE_DIRECTORY.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_REMOVE_DIRECTORY.html new file mode 100644 index 000000000..3069973db --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_REMOVE_DIRECTORY.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_REMOVE_DIRECTORY in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_REMOVE_DIRECTORY: Type = 33554432;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_RENAME_SOURCE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_RENAME_SOURCE.html new file mode 100644 index 000000000..656cd5794 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_RENAME_SOURCE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_RENAME_SOURCE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_RENAME_SOURCE: Type = 65536;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_RENAME_TARGET.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_RENAME_TARGET.html new file mode 100644 index 000000000..4b6ce9e73 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_RENAME_TARGET.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_RENAME_TARGET in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_RENAME_TARGET: Type = 131072;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_SYMLINK.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_SYMLINK.html new file mode 100644 index 000000000..03887851e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_SYMLINK.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_SYMLINK in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_SYMLINK: Type = 16777216;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_UNLINK_FILE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_UNLINK_FILE.html new file mode 100644 index 000000000..695ead77b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_PATH_UNLINK_FILE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_PATH_UNLINK_FILE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_PATH_UNLINK_FILE: Type = 67108864;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_POLL_FD_READWRITE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_POLL_FD_READWRITE.html new file mode 100644 index 000000000..04092871d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_POLL_FD_READWRITE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_POLL_FD_READWRITE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_POLL_FD_READWRITE: Type = 134217728;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_BIND.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_BIND.html new file mode 100644 index 000000000..160b17157 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_BIND.html @@ -0,0 +1 @@ +__WASI_RIGHTS_SOCK_BIND in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_SOCK_BIND: Type = 2147483648;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_CLOSE.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_CLOSE.html new file mode 100644 index 000000000..77c76f33c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_CLOSE.html @@ -0,0 +1 @@ +__WASI_RIGHTS_SOCK_CLOSE in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_SOCK_CLOSE: Type = 1073741824;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_OPEN.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_OPEN.html new file mode 100644 index 000000000..58f35f6f9 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_OPEN.html @@ -0,0 +1 @@ +__WASI_RIGHTS_SOCK_OPEN in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_SOCK_OPEN: Type = 536870912;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_RECV.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_RECV.html new file mode 100644 index 000000000..08ad05a8e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_RECV.html @@ -0,0 +1 @@ +__WASI_RIGHTS_SOCK_RECV in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_SOCK_RECV: Type = 4294967296;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_RECV_FROM.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_RECV_FROM.html new file mode 100644 index 000000000..2c0f673be --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_RECV_FROM.html @@ -0,0 +1 @@ +__WASI_RIGHTS_SOCK_RECV_FROM in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_SOCK_RECV_FROM: Type = 8589934592;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SEND.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SEND.html new file mode 100644 index 000000000..68c2667c6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SEND.html @@ -0,0 +1 @@ +__WASI_RIGHTS_SOCK_SEND in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_SOCK_SEND: Type = 17179869184;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SEND_TO.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SEND_TO.html new file mode 100644 index 000000000..f72ad967b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SEND_TO.html @@ -0,0 +1 @@ +__WASI_RIGHTS_SOCK_SEND_TO in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_SOCK_SEND_TO: Type = 34359738368;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SHUTDOWN.html b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SHUTDOWN.html new file mode 100644 index 000000000..7b1d4985f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/constant.__WASI_RIGHTS_SOCK_SHUTDOWN.html @@ -0,0 +1 @@ +__WASI_RIGHTS_SOCK_SHUTDOWN in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub const __WASI_RIGHTS_SOCK_SHUTDOWN: Type = 268435456;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/index.html b/async_wasi/snapshots/common/types/__wasi_rights_t/index.html new file mode 100644 index 000000000..b65bad701 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_rights_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_rights_t/sidebar-items.js new file mode 100644 index 000000000..e35cbc9f0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_RIGHTS_FD_ADVISE","__WASI_RIGHTS_FD_ALLOCATE","__WASI_RIGHTS_FD_DATASYNC","__WASI_RIGHTS_FD_FDSTAT_SET_FLAGS","__WASI_RIGHTS_FD_FILESTAT_GET","__WASI_RIGHTS_FD_FILESTAT_SET_SIZE","__WASI_RIGHTS_FD_FILESTAT_SET_TIMES","__WASI_RIGHTS_FD_READ","__WASI_RIGHTS_FD_READDIR","__WASI_RIGHTS_FD_SEEK","__WASI_RIGHTS_FD_SYNC","__WASI_RIGHTS_FD_TELL","__WASI_RIGHTS_FD_WRITE","__WASI_RIGHTS_PATH_CREATE_DIRECTORY","__WASI_RIGHTS_PATH_CREATE_FILE","__WASI_RIGHTS_PATH_FILESTAT_GET","__WASI_RIGHTS_PATH_FILESTAT_SET_SIZE","__WASI_RIGHTS_PATH_FILESTAT_SET_TIMES","__WASI_RIGHTS_PATH_LINK_SOURCE","__WASI_RIGHTS_PATH_LINK_TARGET","__WASI_RIGHTS_PATH_OPEN","__WASI_RIGHTS_PATH_READLINK","__WASI_RIGHTS_PATH_REMOVE_DIRECTORY","__WASI_RIGHTS_PATH_RENAME_SOURCE","__WASI_RIGHTS_PATH_RENAME_TARGET","__WASI_RIGHTS_PATH_SYMLINK","__WASI_RIGHTS_PATH_UNLINK_FILE","__WASI_RIGHTS_POLL_FD_READWRITE","__WASI_RIGHTS_SOCK_BIND","__WASI_RIGHTS_SOCK_CLOSE","__WASI_RIGHTS_SOCK_OPEN","__WASI_RIGHTS_SOCK_RECV","__WASI_RIGHTS_SOCK_RECV_FROM","__WASI_RIGHTS_SOCK_SEND","__WASI_RIGHTS_SOCK_SEND_TO","__WASI_RIGHTS_SOCK_SHUTDOWN"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_rights_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_rights_t/type.Type.html new file mode 100644 index 000000000..6f5e6212d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_rights_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_rights_t - Rust
pub type Type = u64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_roflags_t/constant.__WASI_ROFLAGS_RECV_DATA_TRUNCATED.html b/async_wasi/snapshots/common/types/__wasi_roflags_t/constant.__WASI_ROFLAGS_RECV_DATA_TRUNCATED.html new file mode 100644 index 000000000..8892cc15b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_roflags_t/constant.__WASI_ROFLAGS_RECV_DATA_TRUNCATED.html @@ -0,0 +1 @@ +__WASI_ROFLAGS_RECV_DATA_TRUNCATED in async_wasi::snapshots::common::types::__wasi_roflags_t - Rust
pub const __WASI_ROFLAGS_RECV_DATA_TRUNCATED: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_roflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_roflags_t/index.html new file mode 100644 index 000000000..4591c6b64 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_roflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_roflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_roflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_roflags_t/sidebar-items.js new file mode 100644 index 000000000..29c5c8683 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_roflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_ROFLAGS_RECV_DATA_TRUNCATED"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_roflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_roflags_t/type.Type.html new file mode 100644 index 000000000..b68789cd1 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_roflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_roflags_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sdflags_t/constant.__WASI_SDFLAGS_RD.html b/async_wasi/snapshots/common/types/__wasi_sdflags_t/constant.__WASI_SDFLAGS_RD.html new file mode 100644 index 000000000..54a5968f5 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sdflags_t/constant.__WASI_SDFLAGS_RD.html @@ -0,0 +1 @@ +__WASI_SDFLAGS_RD in async_wasi::snapshots::common::types::__wasi_sdflags_t - Rust
pub const __WASI_SDFLAGS_RD: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sdflags_t/constant.__WASI_SDFLAGS_WR.html b/async_wasi/snapshots/common/types/__wasi_sdflags_t/constant.__WASI_SDFLAGS_WR.html new file mode 100644 index 000000000..06026c52c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sdflags_t/constant.__WASI_SDFLAGS_WR.html @@ -0,0 +1 @@ +__WASI_SDFLAGS_WR in async_wasi::snapshots::common::types::__wasi_sdflags_t - Rust
pub const __WASI_SDFLAGS_WR: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sdflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_sdflags_t/index.html new file mode 100644 index 000000000..f7d50a740 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sdflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_sdflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sdflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_sdflags_t/sidebar-items.js new file mode 100644 index 000000000..e9a418e39 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sdflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_SDFLAGS_RD","__WASI_SDFLAGS_WR"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sdflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_sdflags_t/type.Type.html new file mode 100644 index 000000000..394ade80d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sdflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_sdflags_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ABRT.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ABRT.html new file mode 100644 index 000000000..51b8255d0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ABRT.html @@ -0,0 +1 @@ +__WASI_SIGNAL_ABRT in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_ABRT: Type = 6;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ALRM.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ALRM.html new file mode 100644 index 000000000..8fb242f1e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ALRM.html @@ -0,0 +1 @@ +__WASI_SIGNAL_ALRM in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_ALRM: Type = 14;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_BUS.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_BUS.html new file mode 100644 index 000000000..7898a728b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_BUS.html @@ -0,0 +1 @@ +__WASI_SIGNAL_BUS in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_BUS: Type = 7;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_CHLD.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_CHLD.html new file mode 100644 index 000000000..1efd92cec --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_CHLD.html @@ -0,0 +1 @@ +__WASI_SIGNAL_CHLD in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_CHLD: Type = 16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_CONT.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_CONT.html new file mode 100644 index 000000000..daa6a14dc --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_CONT.html @@ -0,0 +1 @@ +__WASI_SIGNAL_CONT in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_CONT: Type = 17;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_FPE.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_FPE.html new file mode 100644 index 000000000..60ee59d66 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_FPE.html @@ -0,0 +1 @@ +__WASI_SIGNAL_FPE in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_FPE: Type = 8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_HUP.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_HUP.html new file mode 100644 index 000000000..24865a5f0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_HUP.html @@ -0,0 +1 @@ +__WASI_SIGNAL_HUP in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_HUP: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ILL.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ILL.html new file mode 100644 index 000000000..a98144582 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_ILL.html @@ -0,0 +1 @@ +__WASI_SIGNAL_ILL in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_ILL: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_INT.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_INT.html new file mode 100644 index 000000000..9ab1dc73e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_INT.html @@ -0,0 +1 @@ +__WASI_SIGNAL_INT in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_INT: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_KILL.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_KILL.html new file mode 100644 index 000000000..05fd5450c --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_KILL.html @@ -0,0 +1 @@ +__WASI_SIGNAL_KILL in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_KILL: Type = 9;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_NONE.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_NONE.html new file mode 100644 index 000000000..951781e8b --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_NONE.html @@ -0,0 +1 @@ +__WASI_SIGNAL_NONE in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_NONE: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PIPE.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PIPE.html new file mode 100644 index 000000000..a8378a825 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PIPE.html @@ -0,0 +1 @@ +__WASI_SIGNAL_PIPE in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_PIPE: Type = 13;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_POLL.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_POLL.html new file mode 100644 index 000000000..e6643d4b3 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_POLL.html @@ -0,0 +1 @@ +__WASI_SIGNAL_POLL in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_POLL: Type = 28;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PROF.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PROF.html new file mode 100644 index 000000000..0b90ebe1e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PROF.html @@ -0,0 +1 @@ +__WASI_SIGNAL_PROF in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_PROF: Type = 26;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PWR.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PWR.html new file mode 100644 index 000000000..999842257 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_PWR.html @@ -0,0 +1 @@ +__WASI_SIGNAL_PWR in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_PWR: Type = 29;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_QUIT.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_QUIT.html new file mode 100644 index 000000000..07053b7b3 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_QUIT.html @@ -0,0 +1 @@ +__WASI_SIGNAL_QUIT in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_QUIT: Type = 3;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_SEGV.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_SEGV.html new file mode 100644 index 000000000..cc4ed2faf --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_SEGV.html @@ -0,0 +1 @@ +__WASI_SIGNAL_SEGV in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_SEGV: Type = 11;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_STOP.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_STOP.html new file mode 100644 index 000000000..3f0956491 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_STOP.html @@ -0,0 +1 @@ +__WASI_SIGNAL_STOP in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_STOP: Type = 18;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_SYS.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_SYS.html new file mode 100644 index 000000000..744cc2b56 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_SYS.html @@ -0,0 +1 @@ +__WASI_SIGNAL_SYS in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_SYS: Type = 30;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TERM.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TERM.html new file mode 100644 index 000000000..3b08f4d45 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TERM.html @@ -0,0 +1 @@ +__WASI_SIGNAL_TERM in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_TERM: Type = 15;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TRAP.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TRAP.html new file mode 100644 index 000000000..dbad43117 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TRAP.html @@ -0,0 +1 @@ +__WASI_SIGNAL_TRAP in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_TRAP: Type = 5;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TSTP.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TSTP.html new file mode 100644 index 000000000..c755eeb56 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TSTP.html @@ -0,0 +1 @@ +__WASI_SIGNAL_TSTP in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_TSTP: Type = 19;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TTIN.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TTIN.html new file mode 100644 index 000000000..48c3de8bd --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TTIN.html @@ -0,0 +1 @@ +__WASI_SIGNAL_TTIN in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_TTIN: Type = 20;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TTOU.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TTOU.html new file mode 100644 index 000000000..9d7cf1881 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_TTOU.html @@ -0,0 +1 @@ +__WASI_SIGNAL_TTOU in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_TTOU: Type = 21;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_URG.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_URG.html new file mode 100644 index 000000000..c360daef5 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_URG.html @@ -0,0 +1 @@ +__WASI_SIGNAL_URG in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_URG: Type = 22;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_USR1.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_USR1.html new file mode 100644 index 000000000..d952db210 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_USR1.html @@ -0,0 +1 @@ +__WASI_SIGNAL_USR1 in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_USR1: Type = 10;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_USR2.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_USR2.html new file mode 100644 index 000000000..8dc0c70da --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_USR2.html @@ -0,0 +1 @@ +__WASI_SIGNAL_USR2 in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_USR2: Type = 12;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_VTALRM.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_VTALRM.html new file mode 100644 index 000000000..b5d18d0f2 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_VTALRM.html @@ -0,0 +1 @@ +__WASI_SIGNAL_VTALRM in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_VTALRM: Type = 25;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_WINCH.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_WINCH.html new file mode 100644 index 000000000..d6d9d3bdc --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_WINCH.html @@ -0,0 +1 @@ +__WASI_SIGNAL_WINCH in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_WINCH: Type = 27;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_XCPU.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_XCPU.html new file mode 100644 index 000000000..7cbac6b41 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_XCPU.html @@ -0,0 +1 @@ +__WASI_SIGNAL_XCPU in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_XCPU: Type = 23;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_XFSZ.html b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_XFSZ.html new file mode 100644 index 000000000..e086bfe10 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/constant.__WASI_SIGNAL_XFSZ.html @@ -0,0 +1 @@ +__WASI_SIGNAL_XFSZ in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub const __WASI_SIGNAL_XFSZ: Type = 24;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/index.html b/async_wasi/snapshots/common/types/__wasi_signal_t/index.html new file mode 100644 index 000000000..9d99b316d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_signal_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_signal_t/sidebar-items.js new file mode 100644 index 000000000..6cc3a0d51 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_SIGNAL_ABRT","__WASI_SIGNAL_ALRM","__WASI_SIGNAL_BUS","__WASI_SIGNAL_CHLD","__WASI_SIGNAL_CONT","__WASI_SIGNAL_FPE","__WASI_SIGNAL_HUP","__WASI_SIGNAL_ILL","__WASI_SIGNAL_INT","__WASI_SIGNAL_KILL","__WASI_SIGNAL_NONE","__WASI_SIGNAL_PIPE","__WASI_SIGNAL_POLL","__WASI_SIGNAL_PROF","__WASI_SIGNAL_PWR","__WASI_SIGNAL_QUIT","__WASI_SIGNAL_SEGV","__WASI_SIGNAL_STOP","__WASI_SIGNAL_SYS","__WASI_SIGNAL_TERM","__WASI_SIGNAL_TRAP","__WASI_SIGNAL_TSTP","__WASI_SIGNAL_TTIN","__WASI_SIGNAL_TTOU","__WASI_SIGNAL_URG","__WASI_SIGNAL_USR1","__WASI_SIGNAL_USR2","__WASI_SIGNAL_VTALRM","__WASI_SIGNAL_WINCH","__WASI_SIGNAL_XCPU","__WASI_SIGNAL_XFSZ"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_signal_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_signal_t/type.Type.html new file mode 100644 index 000000000..7f855b078 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_signal_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_signal_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/constant.__WASI_SOCK_OPT_LEVEL_SOL_SOCKET.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/constant.__WASI_SOCK_OPT_LEVEL_SOL_SOCKET.html new file mode 100644 index 000000000..891328274 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/constant.__WASI_SOCK_OPT_LEVEL_SOL_SOCKET.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_LEVEL_SOL_SOCKET in async_wasi::snapshots::common::types::__wasi_sock_opt_level_t - Rust
pub const __WASI_SOCK_OPT_LEVEL_SOL_SOCKET: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/index.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/index.html new file mode 100644 index 000000000..eda497d47 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_sock_opt_level_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/sidebar-items.js new file mode 100644 index 000000000..a864e4fc0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_SOCK_OPT_LEVEL_SOL_SOCKET"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/type.Type.html new file mode 100644 index 000000000..b4d9663e1 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_level_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_sock_opt_level_t - Rust
pub type Type = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_ACCEPTCONN.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_ACCEPTCONN.html new file mode 100644 index 000000000..74a795871 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_ACCEPTCONN.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_ACCEPTCONN in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_ACCEPTCONN: Type = 13;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_BINDTODEVICE.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_BINDTODEVICE.html new file mode 100644 index 000000000..4a0e052fa --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_BINDTODEVICE.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_BINDTODEVICE in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_BINDTODEVICE: Type = 14;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_BROADCAST.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_BROADCAST.html new file mode 100644 index 000000000..a96085c77 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_BROADCAST.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_BROADCAST in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_BROADCAST: Type = 4;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_DONTROUTE.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_DONTROUTE.html new file mode 100644 index 000000000..abf40ddac --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_DONTROUTE.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_DONTROUTE in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_DONTROUTE: Type = 3;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_ERROR.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_ERROR.html new file mode 100644 index 000000000..236b5c814 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_ERROR.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_ERROR in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_ERROR: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_KEEPALIVE.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_KEEPALIVE.html new file mode 100644 index 000000000..ea49bcb4d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_KEEPALIVE.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_KEEPALIVE in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_KEEPALIVE: Type = 7;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_LINGER.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_LINGER.html new file mode 100644 index 000000000..1c03037b6 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_LINGER.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_LINGER in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_LINGER: Type = 9;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_OOBINLINE.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_OOBINLINE.html new file mode 100644 index 000000000..9b5f66bbe --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_OOBINLINE.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_OOBINLINE in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_OOBINLINE: Type = 8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVBUF.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVBUF.html new file mode 100644 index 000000000..8f41dc493 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVBUF.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_RCVBUF in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_RCVBUF: Type = 6;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVLOWAT.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVLOWAT.html new file mode 100644 index 000000000..81fa0df34 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVLOWAT.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_RCVLOWAT in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_RCVLOWAT: Type = 10;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVTIMEO.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVTIMEO.html new file mode 100644 index 000000000..35ef37bdb --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_RCVTIMEO.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_RCVTIMEO in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_RCVTIMEO: Type = 11;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_REUSEADDR.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_REUSEADDR.html new file mode 100644 index 000000000..8efcb6ffd --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_REUSEADDR.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_REUSEADDR in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_REUSEADDR: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_SNDBUF.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_SNDBUF.html new file mode 100644 index 000000000..2ef672f3f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_SNDBUF.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_SNDBUF in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_SNDBUF: Type = 5;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_SNDTIMEO.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_SNDTIMEO.html new file mode 100644 index 000000000..8dcadc239 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_SNDTIMEO.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_SNDTIMEO in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_SNDTIMEO: Type = 12;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_TYPE.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_TYPE.html new file mode 100644 index 000000000..08af62104 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/constant.__WASI_SOCK_OPT_SO_TYPE.html @@ -0,0 +1 @@ +__WASI_SOCK_OPT_SO_TYPE in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub const __WASI_SOCK_OPT_SO_TYPE: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/index.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/index.html new file mode 100644 index 000000000..48726a581 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/sidebar-items.js new file mode 100644 index 000000000..65a863f8d --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_SOCK_OPT_SO_ACCEPTCONN","__WASI_SOCK_OPT_SO_BINDTODEVICE","__WASI_SOCK_OPT_SO_BROADCAST","__WASI_SOCK_OPT_SO_DONTROUTE","__WASI_SOCK_OPT_SO_ERROR","__WASI_SOCK_OPT_SO_KEEPALIVE","__WASI_SOCK_OPT_SO_LINGER","__WASI_SOCK_OPT_SO_OOBINLINE","__WASI_SOCK_OPT_SO_RCVBUF","__WASI_SOCK_OPT_SO_RCVLOWAT","__WASI_SOCK_OPT_SO_RCVTIMEO","__WASI_SOCK_OPT_SO_REUSEADDR","__WASI_SOCK_OPT_SO_SNDBUF","__WASI_SOCK_OPT_SO_SNDTIMEO","__WASI_SOCK_OPT_SO_TYPE"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/type.Type.html new file mode 100644 index 000000000..116ca9109 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_opt_so_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_sock_opt_so_t - Rust
pub type Type = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_ANY.html b/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_ANY.html new file mode 100644 index 000000000..559aaa158 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_ANY.html @@ -0,0 +1 @@ +__WASI_SOCK_TYPE_SOCK_ANY in async_wasi::snapshots::common::types::__wasi_sock_type_t - Rust
pub const __WASI_SOCK_TYPE_SOCK_ANY: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_DGRAM.html b/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_DGRAM.html new file mode 100644 index 000000000..938ac73b8 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_DGRAM.html @@ -0,0 +1 @@ +__WASI_SOCK_TYPE_SOCK_DGRAM in async_wasi::snapshots::common::types::__wasi_sock_type_t - Rust
pub const __WASI_SOCK_TYPE_SOCK_DGRAM: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_STREAM.html b/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_STREAM.html new file mode 100644 index 000000000..c51987dd2 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_type_t/constant.__WASI_SOCK_TYPE_SOCK_STREAM.html @@ -0,0 +1 @@ +__WASI_SOCK_TYPE_SOCK_STREAM in async_wasi::snapshots::common::types::__wasi_sock_type_t - Rust
pub const __WASI_SOCK_TYPE_SOCK_STREAM: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_type_t/index.html b/async_wasi/snapshots/common/types/__wasi_sock_type_t/index.html new file mode 100644 index 000000000..7220608b4 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_type_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_sock_type_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_type_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_sock_type_t/sidebar-items.js new file mode 100644 index 000000000..8a2e6cbaa --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_type_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_SOCK_TYPE_SOCK_ANY","__WASI_SOCK_TYPE_SOCK_DGRAM","__WASI_SOCK_TYPE_SOCK_STREAM"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_sock_type_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_sock_type_t/type.Type.html new file mode 100644 index 000000000..d66483a55 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_sock_type_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_sock_type_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_subclockflags_t/constant.__WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME.html b/async_wasi/snapshots/common/types/__wasi_subclockflags_t/constant.__WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME.html new file mode 100644 index 000000000..657836563 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_subclockflags_t/constant.__WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME.html @@ -0,0 +1 @@ +__WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME in async_wasi::snapshots::common::types::__wasi_subclockflags_t - Rust
pub const __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_subclockflags_t/index.html b/async_wasi/snapshots/common/types/__wasi_subclockflags_t/index.html new file mode 100644 index 000000000..0bdbd7e67 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_subclockflags_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_subclockflags_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_subclockflags_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_subclockflags_t/sidebar-items.js new file mode 100644 index 000000000..e13ee2ff7 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_subclockflags_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_subclockflags_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_subclockflags_t/type.Type.html new file mode 100644 index 000000000..c154cd793 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_subclockflags_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_subclockflags_t - Rust
pub type Type = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_CUR.html b/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_CUR.html new file mode 100644 index 000000000..c1f554a7e --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_CUR.html @@ -0,0 +1 @@ +__WASI_WHENCE_CUR in async_wasi::snapshots::common::types::__wasi_whence_t - Rust
pub const __WASI_WHENCE_CUR: Type = 1;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_END.html b/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_END.html new file mode 100644 index 000000000..eb51809f0 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_END.html @@ -0,0 +1 @@ +__WASI_WHENCE_END in async_wasi::snapshots::common::types::__wasi_whence_t - Rust
pub const __WASI_WHENCE_END: Type = 2;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_SET.html b/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_SET.html new file mode 100644 index 000000000..f04b4a8e7 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_whence_t/constant.__WASI_WHENCE_SET.html @@ -0,0 +1 @@ +__WASI_WHENCE_SET in async_wasi::snapshots::common::types::__wasi_whence_t - Rust
pub const __WASI_WHENCE_SET: Type = 0;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_whence_t/index.html b/async_wasi/snapshots/common/types/__wasi_whence_t/index.html new file mode 100644 index 000000000..d0de1406a --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_whence_t/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types::__wasi_whence_t - Rust

Constants

Type Aliases

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_whence_t/sidebar-items.js b/async_wasi/snapshots/common/types/__wasi_whence_t/sidebar-items.js new file mode 100644 index 000000000..c845ef40f --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_whence_t/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["__WASI_WHENCE_CUR","__WASI_WHENCE_END","__WASI_WHENCE_SET"],"type":["Type"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/__wasi_whence_t/type.Type.html b/async_wasi/snapshots/common/types/__wasi_whence_t/type.Type.html new file mode 100644 index 000000000..ce7772d96 --- /dev/null +++ b/async_wasi/snapshots/common/types/__wasi_whence_t/type.Type.html @@ -0,0 +1 @@ +Type in async_wasi::snapshots::common::types::__wasi_whence_t - Rust
pub type Type = u8;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/index.html b/async_wasi/snapshots/common/types/index.html new file mode 100644 index 000000000..522b1c151 --- /dev/null +++ b/async_wasi/snapshots/common/types/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::types - Rust

Modules

Structs

Type Aliases

Unions

\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/sidebar-items.js b/async_wasi/snapshots/common/types/sidebar-items.js new file mode 100644 index 000000000..6bfa25ac0 --- /dev/null +++ b/async_wasi/snapshots/common/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["__wasi_address_family_t","__wasi_advice_t","__wasi_aiflags_t","__wasi_clockid_t","__wasi_errno_t","__wasi_eventrwflags_t","__wasi_eventtype_t","__wasi_fdflags_t","__wasi_filetype_t","__wasi_fstflags_t","__wasi_lookupflags_t","__wasi_oflags_t","__wasi_preopentype_t","__wasi_protocol_t","__wasi_riflags_t","__wasi_rights_t","__wasi_roflags_t","__wasi_sdflags_t","__wasi_signal_t","__wasi_sock_opt_level_t","__wasi_sock_opt_so_t","__wasi_sock_type_t","__wasi_subclockflags_t","__wasi_whence_t"],"struct":["__wasi_address_t","__wasi_addrinfo_t","__wasi_ciovec_t","__wasi_dirent_t","__wasi_event_fd_readwrite_t","__wasi_event_t","__wasi_fdstat_t","__wasi_filestat_t","__wasi_iovec_t","__wasi_prestat_dir_t","__wasi_prestat_t","__wasi_sockaddr_in_t","__wasi_sockaddr_t","__wasi_subscription_clock_t","__wasi_subscription_fd_readwrite_t","__wasi_subscription_t","__wasi_subscription_u_t","__wasi_timeval"],"type":["__int32_t","__int64_t","__uint16_t","__uint32_t","__uint64_t","__uint8_t","__wasi_device_t","__wasi_dircookie_t","__wasi_dirnamlen_t","__wasi_exitcode_t","__wasi_fd_t","__wasi_filedelta_t","__wasi_filesize_t","__wasi_inode_t","__wasi_linkcount_t","__wasi_siflags_t","__wasi_size_t","__wasi_sock_d_t","__wasi_timestamp_t","__wasi_userdata_t","const_uint8_t_ptr","uint8_t_ptr"],"union":["__wasi_prestat_u_t","__wasi_subscription_u_u_t"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_address_t.html b/async_wasi/snapshots/common/types/struct.__wasi_address_t.html new file mode 100644 index 000000000..702040041 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_address_t.html @@ -0,0 +1,15 @@ +__wasi_address_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_address_t { + pub buf: uint8_t_ptr, + pub buf_len: __wasi_size_t, +}

Fields§

§buf: uint8_t_ptr§buf_len: __wasi_size_t

Trait Implementations§

source§

impl Clone for __wasi_address_t

source§

fn clone(&self) -> __wasi_address_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_address_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_address_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_addrinfo_t.html b/async_wasi/snapshots/common/types/struct.__wasi_addrinfo_t.html new file mode 100644 index 000000000..a3bfc561b --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_addrinfo_t.html @@ -0,0 +1,22 @@ +__wasi_addrinfo_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_addrinfo_t { + pub ai_flags: Type, + pub ai_family: Type, + pub ai_socktype: Type, + pub ai_protocol: Type, + pub ai_addrlen: __wasi_size_t, + pub ai_addr: uint8_t_ptr, + pub ai_canonname: uint8_t_ptr, + pub ai_canonname_len: __wasi_size_t, + pub ai_next: uint8_t_ptr, +}

Fields§

§ai_flags: Type§ai_family: Type§ai_socktype: Type§ai_protocol: Type§ai_addrlen: __wasi_size_t§ai_addr: uint8_t_ptr§ai_canonname: uint8_t_ptr§ai_canonname_len: __wasi_size_t§ai_next: uint8_t_ptr

Trait Implementations§

source§

impl Clone for __wasi_addrinfo_t

source§

fn clone(&self) -> __wasi_addrinfo_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_addrinfo_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_addrinfo_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_ciovec_t.html b/async_wasi/snapshots/common/types/struct.__wasi_ciovec_t.html new file mode 100644 index 000000000..9c9430043 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_ciovec_t.html @@ -0,0 +1,15 @@ +__wasi_ciovec_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_ciovec_t { + pub buf: const_uint8_t_ptr, + pub buf_len: __wasi_size_t, +}

Fields§

§buf: const_uint8_t_ptr§buf_len: __wasi_size_t

Trait Implementations§

source§

impl Clone for __wasi_ciovec_t

source§

fn clone(&self) -> __wasi_ciovec_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_ciovec_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_ciovec_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_dirent_t.html b/async_wasi/snapshots/common/types/struct.__wasi_dirent_t.html new file mode 100644 index 000000000..5a3c8ced3 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_dirent_t.html @@ -0,0 +1,17 @@ +__wasi_dirent_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_dirent_t { + pub d_next: __wasi_dircookie_t, + pub d_ino: __wasi_inode_t, + pub d_namlen: __wasi_dirnamlen_t, + pub d_type: Type, +}

Fields§

§d_next: __wasi_dircookie_t§d_ino: __wasi_inode_t§d_namlen: __wasi_dirnamlen_t§d_type: Type

Trait Implementations§

source§

impl Clone for __wasi_dirent_t

source§

fn clone(&self) -> __wasi_dirent_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_dirent_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&ReaddirEntity> for __wasi_dirent_t

source§

fn from(ent: &ReaddirEntity) -> Self

Converts to this type from the input type.
source§

impl Copy for __wasi_dirent_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_event_fd_readwrite_t.html b/async_wasi/snapshots/common/types/struct.__wasi_event_fd_readwrite_t.html new file mode 100644 index 000000000..0dfc0ad1e --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_event_fd_readwrite_t.html @@ -0,0 +1,15 @@ +__wasi_event_fd_readwrite_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_event_fd_readwrite_t { + pub nbytes: __wasi_filesize_t, + pub flags: Type, +}

Fields§

§nbytes: __wasi_filesize_t§flags: Type

Trait Implementations§

source§

impl Clone for __wasi_event_fd_readwrite_t

source§

fn clone(&self) -> __wasi_event_fd_readwrite_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_event_fd_readwrite_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_event_fd_readwrite_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_event_t.html b/async_wasi/snapshots/common/types/struct.__wasi_event_t.html new file mode 100644 index 000000000..b2b23b97f --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_event_t.html @@ -0,0 +1,17 @@ +__wasi_event_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_event_t { + pub userdata: __wasi_userdata_t, + pub error: Type, + pub type_: Type, + pub fd_readwrite: __wasi_event_fd_readwrite_t, +}

Fields§

§userdata: __wasi_userdata_t§error: Type§type_: Type§fd_readwrite: __wasi_event_fd_readwrite_t

Trait Implementations§

source§

impl Clone for __wasi_event_t

source§

fn clone(&self) -> __wasi_event_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_event_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_event_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_fdstat_t.html b/async_wasi/snapshots/common/types/struct.__wasi_fdstat_t.html new file mode 100644 index 000000000..db95034f3 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_fdstat_t.html @@ -0,0 +1,17 @@ +__wasi_fdstat_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_fdstat_t { + pub fs_filetype: Type, + pub fs_flags: Type, + pub fs_rights_base: Type, + pub fs_rights_inheriting: Type, +}

Fields§

§fs_filetype: Type§fs_flags: Type§fs_rights_base: Type§fs_rights_inheriting: Type

Trait Implementations§

source§

impl Clone for __wasi_fdstat_t

source§

fn clone(&self) -> __wasi_fdstat_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_fdstat_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&FdStat> for __wasi_fdstat_t

source§

fn from(fdstat: &FdStat) -> __wasi_fdstat_t

Converts to this type from the input type.
source§

impl From<FdStat> for __wasi_fdstat_t

source§

fn from(fdstat: FdStat) -> __wasi_fdstat_t

Converts to this type from the input type.
source§

impl Copy for __wasi_fdstat_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_filestat_t.html b/async_wasi/snapshots/common/types/struct.__wasi_filestat_t.html new file mode 100644 index 000000000..6d99b20c0 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_filestat_t.html @@ -0,0 +1,21 @@ +__wasi_filestat_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_filestat_t { + pub dev: __wasi_device_t, + pub ino: __wasi_inode_t, + pub filetype: Type, + pub nlink: __wasi_linkcount_t, + pub size: __wasi_filesize_t, + pub atim: __wasi_timestamp_t, + pub mtim: __wasi_timestamp_t, + pub ctim: __wasi_timestamp_t, +}

Fields§

§dev: __wasi_device_t§ino: __wasi_inode_t§filetype: Type§nlink: __wasi_linkcount_t§size: __wasi_filesize_t§atim: __wasi_timestamp_t§mtim: __wasi_timestamp_t§ctim: __wasi_timestamp_t

Trait Implementations§

source§

impl Clone for __wasi_filestat_t

source§

fn clone(&self) -> __wasi_filestat_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_filestat_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Filestat> for __wasi_filestat_t

source§

fn from(stat: Filestat) -> __wasi_filestat_t

Converts to this type from the input type.
source§

impl Copy for __wasi_filestat_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_iovec_t.html b/async_wasi/snapshots/common/types/struct.__wasi_iovec_t.html new file mode 100644 index 000000000..a35fd5a07 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_iovec_t.html @@ -0,0 +1,15 @@ +__wasi_iovec_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_iovec_t { + pub buf: uint8_t_ptr, + pub buf_len: __wasi_size_t, +}

Fields§

§buf: uint8_t_ptr§buf_len: __wasi_size_t

Trait Implementations§

source§

impl Clone for __wasi_iovec_t

source§

fn clone(&self) -> __wasi_iovec_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_iovec_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_iovec_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_prestat_dir_t.html b/async_wasi/snapshots/common/types/struct.__wasi_prestat_dir_t.html new file mode 100644 index 000000000..492d1dc90 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_prestat_dir_t.html @@ -0,0 +1,14 @@ +__wasi_prestat_dir_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_prestat_dir_t { + pub pr_name_len: __wasi_size_t, +}

Fields§

§pr_name_len: __wasi_size_t

Trait Implementations§

source§

impl Clone for __wasi_prestat_dir_t

source§

fn clone(&self) -> __wasi_prestat_dir_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_prestat_dir_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_prestat_dir_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_prestat_t.html b/async_wasi/snapshots/common/types/struct.__wasi_prestat_t.html new file mode 100644 index 000000000..cfec83c07 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_prestat_t.html @@ -0,0 +1,15 @@ +__wasi_prestat_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_prestat_t { + pub tag: Type, + pub u: __wasi_prestat_u_t, +}

Fields§

§tag: Type§u: __wasi_prestat_u_t

Trait Implementations§

source§

impl Clone for __wasi_prestat_t

source§

fn clone(&self) -> __wasi_prestat_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_prestat_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_prestat_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_sockaddr_in_t.html b/async_wasi/snapshots/common/types/struct.__wasi_sockaddr_in_t.html new file mode 100644 index 000000000..0d2afdb5c --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_sockaddr_in_t.html @@ -0,0 +1,18 @@ +__wasi_sockaddr_in_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_sockaddr_in_t { + pub sin_family: Type, + pub sin_port: u16, + pub sin_addr: __wasi_address_t, + pub sin_zero_len: __wasi_size_t, + pub sin_zero: uint8_t_ptr, +}

Fields§

§sin_family: Type§sin_port: u16§sin_addr: __wasi_address_t§sin_zero_len: __wasi_size_t§sin_zero: uint8_t_ptr

Trait Implementations§

source§

impl Clone for __wasi_sockaddr_in_t

source§

fn clone(&self) -> __wasi_sockaddr_in_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_sockaddr_in_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_sockaddr_in_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_sockaddr_t.html b/async_wasi/snapshots/common/types/struct.__wasi_sockaddr_t.html new file mode 100644 index 000000000..5d4862949 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_sockaddr_t.html @@ -0,0 +1,16 @@ +__wasi_sockaddr_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_sockaddr_t { + pub sa_family: Type, + pub sa_data_len: __wasi_size_t, + pub sa_data: uint8_t_ptr, +}

Fields§

§sa_family: Type§sa_data_len: __wasi_size_t§sa_data: uint8_t_ptr

Trait Implementations§

source§

impl Clone for __wasi_sockaddr_t

source§

fn clone(&self) -> __wasi_sockaddr_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_sockaddr_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_sockaddr_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_subscription_clock_t.html b/async_wasi/snapshots/common/types/struct.__wasi_subscription_clock_t.html new file mode 100644 index 000000000..aeae13e16 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_subscription_clock_t.html @@ -0,0 +1,17 @@ +__wasi_subscription_clock_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_subscription_clock_t { + pub id: Type, + pub timeout: __wasi_timestamp_t, + pub precision: __wasi_timestamp_t, + pub flags: Type, +}

Fields§

§id: Type§timeout: __wasi_timestamp_t§precision: __wasi_timestamp_t§flags: Type

Trait Implementations§

source§

impl Clone for __wasi_subscription_clock_t

source§

fn clone(&self) -> __wasi_subscription_clock_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_subscription_clock_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_subscription_clock_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_subscription_fd_readwrite_t.html b/async_wasi/snapshots/common/types/struct.__wasi_subscription_fd_readwrite_t.html new file mode 100644 index 000000000..3d92089b5 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_subscription_fd_readwrite_t.html @@ -0,0 +1,14 @@ +__wasi_subscription_fd_readwrite_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_subscription_fd_readwrite_t { + pub file_descriptor: __wasi_fd_t, +}

Fields§

§file_descriptor: __wasi_fd_t

Trait Implementations§

source§

impl Clone for __wasi_subscription_fd_readwrite_t

source§

fn clone(&self) -> __wasi_subscription_fd_readwrite_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_subscription_fd_readwrite_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_subscription_fd_readwrite_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_subscription_t.html b/async_wasi/snapshots/common/types/struct.__wasi_subscription_t.html new file mode 100644 index 000000000..a42d87cc2 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_subscription_t.html @@ -0,0 +1,15 @@ +__wasi_subscription_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_subscription_t { + pub userdata: __wasi_userdata_t, + pub u: __wasi_subscription_u_t, +}

Fields§

§userdata: __wasi_userdata_t§u: __wasi_subscription_u_t

Trait Implementations§

source§

impl Clone for __wasi_subscription_t

source§

fn clone(&self) -> __wasi_subscription_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_subscription_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_subscription_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_subscription_u_t.html b/async_wasi/snapshots/common/types/struct.__wasi_subscription_u_t.html new file mode 100644 index 000000000..edd39a7a5 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_subscription_u_t.html @@ -0,0 +1,15 @@ +__wasi_subscription_u_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_subscription_u_t { + pub tag: Type, + pub u: __wasi_subscription_u_u_t, +}

Fields§

§tag: Type§u: __wasi_subscription_u_u_t

Trait Implementations§

source§

impl Clone for __wasi_subscription_u_t

source§

fn clone(&self) -> __wasi_subscription_u_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_subscription_u_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_subscription_u_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/struct.__wasi_timeval.html b/async_wasi/snapshots/common/types/struct.__wasi_timeval.html new file mode 100644 index 000000000..63acda9e9 --- /dev/null +++ b/async_wasi/snapshots/common/types/struct.__wasi_timeval.html @@ -0,0 +1,15 @@ +__wasi_timeval in async_wasi::snapshots::common::types - Rust
#[repr(C)]
pub struct __wasi_timeval { + pub tv_sec: i64, + pub tv_usec: i64, +}

Fields§

§tv_sec: i64§tv_usec: i64

Trait Implementations§

source§

impl Clone for __wasi_timeval

source§

fn clone(&self) -> __wasi_timeval

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for __wasi_timeval

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__int32_t.html b/async_wasi/snapshots/common/types/type.__int32_t.html new file mode 100644 index 000000000..0739b763f --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__int32_t.html @@ -0,0 +1 @@ +__int32_t in async_wasi::snapshots::common::types - Rust
pub type __int32_t = c_int;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__int64_t.html b/async_wasi/snapshots/common/types/type.__int64_t.html new file mode 100644 index 000000000..1cfcc0c84 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__int64_t.html @@ -0,0 +1 @@ +__int64_t in async_wasi::snapshots::common::types - Rust
pub type __int64_t = c_long;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__uint16_t.html b/async_wasi/snapshots/common/types/type.__uint16_t.html new file mode 100644 index 000000000..c81502c01 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__uint16_t.html @@ -0,0 +1 @@ +__uint16_t in async_wasi::snapshots::common::types - Rust
pub type __uint16_t = c_ushort;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__uint32_t.html b/async_wasi/snapshots/common/types/type.__uint32_t.html new file mode 100644 index 000000000..fba1d832f --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__uint32_t.html @@ -0,0 +1 @@ +__uint32_t in async_wasi::snapshots::common::types - Rust
pub type __uint32_t = c_uint;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__uint64_t.html b/async_wasi/snapshots/common/types/type.__uint64_t.html new file mode 100644 index 000000000..60d79105d --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__uint64_t.html @@ -0,0 +1 @@ +__uint64_t in async_wasi::snapshots::common::types - Rust
pub type __uint64_t = c_ulong;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__uint8_t.html b/async_wasi/snapshots/common/types/type.__uint8_t.html new file mode 100644 index 000000000..105534ad1 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__uint8_t.html @@ -0,0 +1 @@ +__uint8_t in async_wasi::snapshots::common::types - Rust
pub type __uint8_t = c_uchar;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_device_t.html b/async_wasi/snapshots/common/types/type.__wasi_device_t.html new file mode 100644 index 000000000..d8b7d49b8 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_device_t.html @@ -0,0 +1 @@ +__wasi_device_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_device_t = u64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_dircookie_t.html b/async_wasi/snapshots/common/types/type.__wasi_dircookie_t.html new file mode 100644 index 000000000..3f5a06250 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_dircookie_t.html @@ -0,0 +1 @@ +__wasi_dircookie_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_dircookie_t = u64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_dirnamlen_t.html b/async_wasi/snapshots/common/types/type.__wasi_dirnamlen_t.html new file mode 100644 index 000000000..efc99e6b1 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_dirnamlen_t.html @@ -0,0 +1 @@ +__wasi_dirnamlen_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_dirnamlen_t = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_exitcode_t.html b/async_wasi/snapshots/common/types/type.__wasi_exitcode_t.html new file mode 100644 index 000000000..f8633bfa5 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_exitcode_t.html @@ -0,0 +1 @@ +__wasi_exitcode_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_exitcode_t = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_fd_t.html b/async_wasi/snapshots/common/types/type.__wasi_fd_t.html new file mode 100644 index 000000000..7188074ce --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_fd_t.html @@ -0,0 +1 @@ +__wasi_fd_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_fd_t = i32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_filedelta_t.html b/async_wasi/snapshots/common/types/type.__wasi_filedelta_t.html new file mode 100644 index 000000000..1a85131cf --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_filedelta_t.html @@ -0,0 +1 @@ +__wasi_filedelta_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_filedelta_t = i64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_filesize_t.html b/async_wasi/snapshots/common/types/type.__wasi_filesize_t.html new file mode 100644 index 000000000..44eb03d70 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_filesize_t.html @@ -0,0 +1 @@ +__wasi_filesize_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_filesize_t = u64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_inode_t.html b/async_wasi/snapshots/common/types/type.__wasi_inode_t.html new file mode 100644 index 000000000..a320a2945 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_inode_t.html @@ -0,0 +1 @@ +__wasi_inode_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_inode_t = u64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_linkcount_t.html b/async_wasi/snapshots/common/types/type.__wasi_linkcount_t.html new file mode 100644 index 000000000..e23299f22 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_linkcount_t.html @@ -0,0 +1 @@ +__wasi_linkcount_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_linkcount_t = u64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_siflags_t.html b/async_wasi/snapshots/common/types/type.__wasi_siflags_t.html new file mode 100644 index 000000000..3a80b4980 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_siflags_t.html @@ -0,0 +1 @@ +__wasi_siflags_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_siflags_t = u16;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_size_t.html b/async_wasi/snapshots/common/types/type.__wasi_size_t.html new file mode 100644 index 000000000..e0a9dd12e --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_size_t.html @@ -0,0 +1 @@ +__wasi_size_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_size_t = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_sock_d_t.html b/async_wasi/snapshots/common/types/type.__wasi_sock_d_t.html new file mode 100644 index 000000000..85c1e94a6 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_sock_d_t.html @@ -0,0 +1 @@ +__wasi_sock_d_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_sock_d_t = __wasi_fd_t;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_timestamp_t.html b/async_wasi/snapshots/common/types/type.__wasi_timestamp_t.html new file mode 100644 index 000000000..5b13766a4 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_timestamp_t.html @@ -0,0 +1 @@ +__wasi_timestamp_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_timestamp_t = u64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.__wasi_userdata_t.html b/async_wasi/snapshots/common/types/type.__wasi_userdata_t.html new file mode 100644 index 000000000..0a5df0684 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.__wasi_userdata_t.html @@ -0,0 +1 @@ +__wasi_userdata_t in async_wasi::snapshots::common::types - Rust
pub type __wasi_userdata_t = u64;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.const_uint8_t_ptr.html b/async_wasi/snapshots/common/types/type.const_uint8_t_ptr.html new file mode 100644 index 000000000..655ea50e8 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.const_uint8_t_ptr.html @@ -0,0 +1 @@ +const_uint8_t_ptr in async_wasi::snapshots::common::types - Rust
pub type const_uint8_t_ptr = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/type.uint8_t_ptr.html b/async_wasi/snapshots/common/types/type.uint8_t_ptr.html new file mode 100644 index 000000000..183d52169 --- /dev/null +++ b/async_wasi/snapshots/common/types/type.uint8_t_ptr.html @@ -0,0 +1 @@ +uint8_t_ptr in async_wasi::snapshots::common::types - Rust
pub type uint8_t_ptr = u32;
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/union.__wasi_prestat_u_t.html b/async_wasi/snapshots/common/types/union.__wasi_prestat_u_t.html new file mode 100644 index 000000000..49ceea3de --- /dev/null +++ b/async_wasi/snapshots/common/types/union.__wasi_prestat_u_t.html @@ -0,0 +1,15 @@ +__wasi_prestat_u_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
+pub union __wasi_prestat_u_t {
+    pub dir: __wasi_prestat_dir_t,
+}

Fields§

§dir: __wasi_prestat_dir_t

Trait Implementations§

source§

impl Clone for __wasi_prestat_u_t

source§

fn clone(&self) -> __wasi_prestat_u_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_prestat_u_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_prestat_u_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/types/union.__wasi_subscription_u_u_t.html b/async_wasi/snapshots/common/types/union.__wasi_subscription_u_u_t.html new file mode 100644 index 000000000..6e8acad13 --- /dev/null +++ b/async_wasi/snapshots/common/types/union.__wasi_subscription_u_u_t.html @@ -0,0 +1,17 @@ +__wasi_subscription_u_u_t in async_wasi::snapshots::common::types - Rust
#[repr(C)]
+pub union __wasi_subscription_u_u_t {
+    pub clock: __wasi_subscription_clock_t,
+    pub fd_read: __wasi_subscription_fd_readwrite_t,
+    pub fd_write: __wasi_subscription_fd_readwrite_t,
+}

Fields§

§clock: __wasi_subscription_clock_t§fd_read: __wasi_subscription_fd_readwrite_t§fd_write: __wasi_subscription_fd_readwrite_t

Trait Implementations§

source§

impl Clone for __wasi_subscription_u_u_t

source§

fn clone(&self) -> __wasi_subscription_u_u_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __wasi_subscription_u_u_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __wasi_subscription_u_u_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/enum.Advice.html b/async_wasi/snapshots/common/vfs/enum.Advice.html new file mode 100644 index 000000000..761b664a8 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/enum.Advice.html @@ -0,0 +1,19 @@ +Advice in async_wasi::snapshots::common::vfs - Rust
pub enum Advice {
+    Normal,
+    Sequential,
+    Random,
+    WillNeed,
+    DontNeed,
+    NoReuse,
+}

Variants§

§

Normal

§

Sequential

§

Random

§

WillNeed

§

DontNeed

§

NoReuse

Trait Implementations§

source§

impl Clone for Advice

source§

fn clone(&self) -> Advice

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Advice

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/enum.SystemTimeSpec.html b/async_wasi/snapshots/common/vfs/enum.SystemTimeSpec.html new file mode 100644 index 000000000..7d1304eed --- /dev/null +++ b/async_wasi/snapshots/common/vfs/enum.SystemTimeSpec.html @@ -0,0 +1,14 @@ +SystemTimeSpec in async_wasi::snapshots::common::vfs - Rust
pub enum SystemTimeSpec {
+    SymbolicNow,
+    Absolute(Duration),
+}

Variants§

§

SymbolicNow

§

Absolute(Duration)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/index.html b/async_wasi/snapshots/common/vfs/index.html new file mode 100644 index 000000000..e66b2c62e --- /dev/null +++ b/async_wasi/snapshots/common/vfs/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::vfs - Rust

Re-exports

Modules

Structs

Enums

\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sidebar-items.js b/async_wasi/snapshots/common/vfs/sidebar-items.js new file mode 100644 index 000000000..b33e87c59 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Advice","SystemTimeSpec"],"mod":["sync"],"struct":["FdFlags","FdStat","FileType","Filestat","Lookupflags","OFlags","ReaddirEntity","RiFlags","RoFlags","SdFlags","SiFlags","WASIRights"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.FdFlags.html b/async_wasi/snapshots/common/vfs/struct.FdFlags.html new file mode 100644 index 000000000..d4e187e3a --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.FdFlags.html @@ -0,0 +1,67 @@ +FdFlags in async_wasi::snapshots::common::vfs - Rust
pub struct FdFlags(/* private fields */);

Implementations§

source§

impl FdFlags

source

pub const APPEND: Self = _

source

pub const DSYNC: Self = _

source

pub const NONBLOCK: Self = _

source

pub const RSYNC: Self = _

source

pub const SYNC: Self = _

source§

impl FdFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> Type

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: Type) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: Type) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: Type) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl FdFlags

source

pub const fn iter(&self) -> Iter<FdFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<FdFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for FdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for FdFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = FdFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for FdFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for FdFlags

source§

fn bitor(self, other: FdFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = FdFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for FdFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for FdFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = FdFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for FdFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Clone for FdFlags

source§

fn clone(&self) -> FdFlags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<FdFlags> for FdFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for FdFlags

source§

const FLAGS: &'static [Flag<FdFlags>] = _

The set of defined flags.
§

type Bits = u16

The underlying bits type.
source§

fn bits(&self) -> Type

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: Type) -> FdFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl FromIterator<FdFlags> for FdFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for FdFlags

§

type Item = FdFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<FdFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for FdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for FdFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = FdFlags

The resulting type after applying the ! operator.
source§

impl Octal for FdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PublicFlags for FdFlags

§

type Primitive = u16

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for FdFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = FdFlags

The resulting type after applying the - operator.
source§

impl SubAssign for FdFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for FdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.FdStat.html b/async_wasi/snapshots/common/vfs/struct.FdStat.html new file mode 100644 index 000000000..0c5b2b153 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.FdStat.html @@ -0,0 +1,17 @@ +FdStat in async_wasi::snapshots::common::vfs - Rust
pub struct FdStat {
+    pub filetype: FileType,
+    pub fs_rights_base: WASIRights,
+    pub fs_rights_inheriting: WASIRights,
+    pub flags: FdFlags,
+}

Fields§

§filetype: FileType§fs_rights_base: WASIRights§fs_rights_inheriting: WASIRights§flags: FdFlags

Trait Implementations§

source§

impl Clone for FdStat

source§

fn clone(&self) -> FdStat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FdStat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&FdStat> for __wasi_fdstat_t

source§

fn from(fdstat: &FdStat) -> __wasi_fdstat_t

Converts to this type from the input type.
source§

impl From<FdStat> for __wasi_fdstat_t

source§

fn from(fdstat: FdStat) -> __wasi_fdstat_t

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.FileType.html b/async_wasi/snapshots/common/vfs/struct.FileType.html new file mode 100644 index 000000000..0953b8b00 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.FileType.html @@ -0,0 +1,14 @@ +FileType in async_wasi::snapshots::common::vfs - Rust
pub struct FileType(pub Type);

Tuple Fields§

§0: Type

Implementations§

Trait Implementations§

source§

impl Clone for FileType

source§

fn clone(&self) -> FileType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FileType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for FileType

source§

fn eq(&self, other: &FileType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for FileType

source§

impl Eq for FileType

source§

impl StructuralEq for FileType

source§

impl StructuralPartialEq for FileType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.Filestat.html b/async_wasi/snapshots/common/vfs/struct.Filestat.html new file mode 100644 index 000000000..9f41543df --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.Filestat.html @@ -0,0 +1,22 @@ +Filestat in async_wasi::snapshots::common::vfs - Rust
pub struct Filestat {
+    pub filetype: FileType,
+    pub inode: u64,
+    pub nlink: u64,
+    pub size: u64,
+    pub atim: Option<SystemTime>,
+    pub mtim: Option<SystemTime>,
+    pub ctim: Option<SystemTime>,
+}

Fields§

§filetype: FileType§inode: u64§nlink: u64§size: u64§atim: Option<SystemTime>§mtim: Option<SystemTime>§ctim: Option<SystemTime>

Trait Implementations§

source§

impl Clone for Filestat

source§

fn clone(&self) -> Filestat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Filestat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Filestat> for __wasi_filestat_t

source§

fn from(stat: Filestat) -> __wasi_filestat_t

Converts to this type from the input type.
source§

impl PartialEq for Filestat

source§

fn eq(&self, other: &Filestat) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Filestat

source§

impl StructuralEq for Filestat

source§

impl StructuralPartialEq for Filestat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.Lookupflags.html b/async_wasi/snapshots/common/vfs/struct.Lookupflags.html new file mode 100644 index 000000000..fed257861 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.Lookupflags.html @@ -0,0 +1,66 @@ +Lookupflags in async_wasi::snapshots::common::vfs - Rust
pub struct Lookupflags(/* private fields */);

Implementations§

source§

impl Lookupflags

source§

impl Lookupflags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> Type

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: Type) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: Type) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: Type) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl Lookupflags

source

pub const fn iter(&self) -> Iter<Lookupflags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<Lookupflags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for Lookupflags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for Lookupflags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = Lookupflags

The resulting type after applying the & operator.
source§

impl BitAndAssign for Lookupflags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for Lookupflags

source§

fn bitor(self, other: Lookupflags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = Lookupflags

The resulting type after applying the | operator.
source§

impl BitOrAssign for Lookupflags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for Lookupflags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = Lookupflags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for Lookupflags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Extend<Lookupflags> for Lookupflags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for Lookupflags

source§

const FLAGS: &'static [Flag<Lookupflags>] = _

The set of defined flags.
§

type Bits = u32

The underlying bits type.
source§

fn bits(&self) -> Type

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: Type) -> Lookupflags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl FromIterator<Lookupflags> for Lookupflags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for Lookupflags

§

type Item = Lookupflags

The type of the elements being iterated over.
§

type IntoIter = Iter<Lookupflags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for Lookupflags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for Lookupflags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = Lookupflags

The resulting type after applying the ! operator.
source§

impl Octal for Lookupflags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PublicFlags for Lookupflags

§

type Primitive = u32

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for Lookupflags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = Lookupflags

The resulting type after applying the - operator.
source§

impl SubAssign for Lookupflags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for Lookupflags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.OFlags.html b/async_wasi/snapshots/common/vfs/struct.OFlags.html new file mode 100644 index 000000000..cbf01a96f --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.OFlags.html @@ -0,0 +1,66 @@ +OFlags in async_wasi::snapshots::common::vfs - Rust
pub struct OFlags(/* private fields */);

Implementations§

source§

impl OFlags

source

pub const CREATE: Self = _

source

pub const DIRECTORY: Self = _

source

pub const EXCLUSIVE: Self = _

source

pub const TRUNCATE: Self = _

source§

impl OFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> Type

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: Type) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: Type) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: Type) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl OFlags

source

pub const fn iter(&self) -> Iter<OFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<OFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for OFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for OFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = OFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for OFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for OFlags

source§

fn bitor(self, other: OFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = OFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for OFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for OFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = OFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for OFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Extend<OFlags> for OFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for OFlags

source§

const FLAGS: &'static [Flag<OFlags>] = _

The set of defined flags.
§

type Bits = u16

The underlying bits type.
source§

fn bits(&self) -> Type

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: Type) -> OFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl FromIterator<OFlags> for OFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for OFlags

§

type Item = OFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<OFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for OFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for OFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = OFlags

The resulting type after applying the ! operator.
source§

impl Octal for OFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PublicFlags for OFlags

§

type Primitive = u16

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for OFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = OFlags

The resulting type after applying the - operator.
source§

impl SubAssign for OFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for OFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.ReaddirEntity.html b/async_wasi/snapshots/common/vfs/struct.ReaddirEntity.html new file mode 100644 index 000000000..5f88fb3a3 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.ReaddirEntity.html @@ -0,0 +1,16 @@ +ReaddirEntity in async_wasi::snapshots::common::vfs - Rust
pub struct ReaddirEntity {
+    pub next: u64,
+    pub inode: u64,
+    pub name: String,
+    pub filetype: FileType,
+}

Fields§

§next: u64§inode: u64§name: String§filetype: FileType

Trait Implementations§

source§

impl From<&ReaddirEntity> for __wasi_dirent_t

source§

fn from(ent: &ReaddirEntity) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.RiFlags.html b/async_wasi/snapshots/common/vfs/struct.RiFlags.html new file mode 100644 index 000000000..ae74aafce --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.RiFlags.html @@ -0,0 +1,66 @@ +RiFlags in async_wasi::snapshots::common::vfs - Rust
pub struct RiFlags(/* private fields */);

Implementations§

source§

impl RiFlags

source

pub const RECV_PEEK: Self = _

source

pub const RECV_WAITALL: Self = _

source§

impl RiFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> Type

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: Type) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: Type) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: Type) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl RiFlags

source

pub const fn iter(&self) -> Iter<RiFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<RiFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for RiFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for RiFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = RiFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for RiFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for RiFlags

source§

fn bitor(self, other: RiFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = RiFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for RiFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for RiFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = RiFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for RiFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Extend<RiFlags> for RiFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for RiFlags

source§

const FLAGS: &'static [Flag<RiFlags>] = _

The set of defined flags.
§

type Bits = u16

The underlying bits type.
source§

fn bits(&self) -> Type

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: Type) -> RiFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl FromIterator<RiFlags> for RiFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for RiFlags

§

type Item = RiFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<RiFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for RiFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for RiFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = RiFlags

The resulting type after applying the ! operator.
source§

impl Octal for RiFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PublicFlags for RiFlags

§

type Primitive = u16

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for RiFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = RiFlags

The resulting type after applying the - operator.
source§

impl SubAssign for RiFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for RiFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.RoFlags.html b/async_wasi/snapshots/common/vfs/struct.RoFlags.html new file mode 100644 index 000000000..fe2270670 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.RoFlags.html @@ -0,0 +1,66 @@ +RoFlags in async_wasi::snapshots::common::vfs - Rust
pub struct RoFlags(/* private fields */);

Implementations§

source§

impl RoFlags

source

pub const RECV_DATA_TRUNCATED: Self = _

source§

impl RoFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> Type

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: Type) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: Type) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: Type) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl RoFlags

source

pub const fn iter(&self) -> Iter<RoFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<RoFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for RoFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for RoFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = RoFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for RoFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for RoFlags

source§

fn bitor(self, other: RoFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = RoFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for RoFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for RoFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = RoFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for RoFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Extend<RoFlags> for RoFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for RoFlags

source§

const FLAGS: &'static [Flag<RoFlags>] = _

The set of defined flags.
§

type Bits = u16

The underlying bits type.
source§

fn bits(&self) -> Type

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: Type) -> RoFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl FromIterator<RoFlags> for RoFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for RoFlags

§

type Item = RoFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<RoFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for RoFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for RoFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = RoFlags

The resulting type after applying the ! operator.
source§

impl Octal for RoFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PublicFlags for RoFlags

§

type Primitive = u16

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for RoFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = RoFlags

The resulting type after applying the - operator.
source§

impl SubAssign for RoFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for RoFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.SdFlags.html b/async_wasi/snapshots/common/vfs/struct.SdFlags.html new file mode 100644 index 000000000..da1d7d42e --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.SdFlags.html @@ -0,0 +1,68 @@ +SdFlags in async_wasi::snapshots::common::vfs - Rust
pub struct SdFlags(/* private fields */);

Implementations§

source§

impl SdFlags

source

pub const RD: Self = _

source

pub const WR: Self = _

source§

impl SdFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> Type

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: Type) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: Type) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: Type) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl SdFlags

source

pub const fn iter(&self) -> Iter<SdFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<SdFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for SdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for SdFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = SdFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for SdFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for SdFlags

source§

fn bitor(self, other: SdFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = SdFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for SdFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for SdFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = SdFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for SdFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Extend<SdFlags> for SdFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for SdFlags

source§

const FLAGS: &'static [Flag<SdFlags>] = _

The set of defined flags.
§

type Bits = u8

The underlying bits type.
source§

fn bits(&self) -> Type

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: Type) -> SdFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl From<SdFlags> for Shutdown

source§

fn from(val: SdFlags) -> Self

Converts to this type from the input type.
source§

impl FromIterator<SdFlags> for SdFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for SdFlags

§

type Item = SdFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<SdFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for SdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for SdFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = SdFlags

The resulting type after applying the ! operator.
source§

impl Octal for SdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PartialEq for SdFlags

source§

fn eq(&self, other: &SdFlags) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PublicFlags for SdFlags

§

type Primitive = u8

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for SdFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = SdFlags

The resulting type after applying the - operator.
source§

impl SubAssign for SdFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for SdFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl StructuralPartialEq for SdFlags

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.SiFlags.html b/async_wasi/snapshots/common/vfs/struct.SiFlags.html new file mode 100644 index 000000000..04a52df64 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.SiFlags.html @@ -0,0 +1,66 @@ +SiFlags in async_wasi::snapshots::common::vfs - Rust
pub struct SiFlags(/* private fields */);

Implementations§

source§

impl SiFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> __wasi_siflags_t

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: __wasi_siflags_t) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: __wasi_siflags_t) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: __wasi_siflags_t) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl SiFlags

source

pub const fn iter(&self) -> Iter<SiFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<SiFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for SiFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for SiFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = SiFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for SiFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for SiFlags

source§

fn bitor(self, other: SiFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = SiFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for SiFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for SiFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = SiFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for SiFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Extend<SiFlags> for SiFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for SiFlags

source§

const FLAGS: &'static [Flag<SiFlags>] = _

The set of defined flags.
§

type Bits = u16

The underlying bits type.
source§

fn bits(&self) -> __wasi_siflags_t

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: __wasi_siflags_t) -> SiFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl FromIterator<SiFlags> for SiFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for SiFlags

§

type Item = SiFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<SiFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for SiFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for SiFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = SiFlags

The resulting type after applying the ! operator.
source§

impl Octal for SiFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PublicFlags for SiFlags

§

type Primitive = u16

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for SiFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = SiFlags

The resulting type after applying the - operator.
source§

impl SubAssign for SiFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for SiFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/struct.WASIRights.html b/async_wasi/snapshots/common/vfs/struct.WASIRights.html new file mode 100644 index 000000000..39e383e34 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/struct.WASIRights.html @@ -0,0 +1,67 @@ +WASIRights in async_wasi::snapshots::common::vfs - Rust
pub struct WASIRights(/* private fields */);

Implementations§

source§

impl WASIRights

source

pub const FD_DATASYNC: Self = _

source

pub const FD_READ: Self = _

source

pub const FD_SEEK: Self = _

source

pub const FD_FDSTAT_SET_FLAGS: Self = _

source

pub const FD_SYNC: Self = _

source

pub const FD_TELL: Self = _

source

pub const FD_WRITE: Self = _

source

pub const FD_ADVISE: Self = _

source

pub const FD_ALLOCATE: Self = _

source

pub const PATH_CREATE_DIRECTORY: Self = _

source

pub const PATH_CREATE_FILE: Self = _

source

pub const PATH_OPEN: Self = _

source

pub const FD_READDIR: Self = _

source

pub const PATH_RENAME_SOURCE: Self = _

source

pub const PATH_RENAME_TARGET: Self = _

source

pub const PATH_FILESTAT_GET: Self = _

source

pub const PATH_FILESTAT_SET_SIZE: Self = _

source

pub const PATH_FILESTAT_SET_TIMES: Self = _

source

pub const FD_FILESTAT_GET: Self = _

source

pub const FD_FILESTAT_SET_SIZE: Self = _

source

pub const FD_FILESTAT_SET_TIMES: Self = _

source

pub const PATH_REMOVE_DIRECTORY: Self = _

source

pub const POLL_FD_READWRITE: Self = _

source

pub const SOCK_SHUTDOWN: Self = _

source

pub const SOCK_OPEN: Self = _

source

pub const SOCK_CLOSE: Self = _

source

pub const SOCK_BIND: Self = _

source

pub const SOCK_RECV: Self = _

source

pub const SOCK_RECV_FROM: Self = _

source

pub const SOCK_SEND: Self = _

source

pub const SOCK_SEND_TO: Self = _

source§

impl WASIRights

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> Type

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: Type) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: Type) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: Type) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl WASIRights

source

pub const fn iter(&self) -> Iter<WASIRights>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<WASIRights>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+
source§

impl WASIRights

source

pub fn fd_all() -> Self

source

pub fn dir_all() -> Self

source

pub fn can(&self, other: Self) -> Result<(), Errno>

Trait Implementations§

source§

impl Binary for WASIRights

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for WASIRights

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = WASIRights

The resulting type after applying the & operator.
source§

impl BitAndAssign for WASIRights

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for WASIRights

source§

fn bitor(self, other: WASIRights) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = WASIRights

The resulting type after applying the | operator.
source§

impl BitOrAssign for WASIRights

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for WASIRights

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = WASIRights

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for WASIRights

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Clone for WASIRights

source§

fn clone(&self) -> WASIRights

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WASIRights

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for WASIRights

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Extend<WASIRights> for WASIRights

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for WASIRights

source§

const FLAGS: &'static [Flag<WASIRights>] = _

The set of defined flags.
§

type Bits = u64

The underlying bits type.
source§

fn bits(&self) -> Type

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: Type) -> WASIRights

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl FromIterator<WASIRights> for WASIRights

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for WASIRights

§

type Item = WASIRights

The type of the elements being iterated over.
§

type IntoIter = Iter<WASIRights>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for WASIRights

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for WASIRights

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = WASIRights

The resulting type after applying the ! operator.
source§

impl Octal for WASIRights

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PublicFlags for WASIRights

§

type Primitive = u64

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for WASIRights

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = WASIRights

The resulting type after applying the - operator.
source§

impl SubAssign for WASIRights

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for WASIRights

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/enum.INode.html b/async_wasi/snapshots/common/vfs/sync/enum.INode.html new file mode 100644 index 000000000..54b9ee6bd --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/enum.INode.html @@ -0,0 +1,18 @@ +INode in async_wasi::snapshots::common::vfs::sync - Rust
pub enum INode {
+    PreOpenDir(WasiPreOpenDir),
+    Dir(WasiDir),
+    File(WasiFile),
+    Stdin(WasiStdin),
+    Stdout(WasiStdout),
+    Stderr(WasiStderr),
+}

Variants§

Trait Implementations§

source§

impl Debug for INode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for INode

§

impl Send for INode

§

impl Sync for INode

§

impl Unpin for INode

§

impl UnwindSafe for INode

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/index.html b/async_wasi/snapshots/common/vfs/sync/index.html new file mode 100644 index 000000000..60c23abf9 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::common::vfs::sync - Rust

Structs

Enums

\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/sidebar-items.js b/async_wasi/snapshots/common/vfs/sync/sidebar-items.js new file mode 100644 index 000000000..2333f24d1 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["INode"],"struct":["WasiDir","WasiFile","WasiPreOpenDir","WasiStderr","WasiStdin","WasiStdout"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/struct.WasiDir.html b/async_wasi/snapshots/common/vfs/sync/struct.WasiDir.html new file mode 100644 index 000000000..fc686d8e4 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/struct.WasiDir.html @@ -0,0 +1,28 @@ +WasiDir in async_wasi::snapshots::common::vfs::sync - Rust
pub struct WasiDir {
+    pub real_path: PathBuf,
+    pub dir_rights: WASIRights,
+    pub file_rights: WASIRights,
+}

Fields§

§real_path: PathBuf§dir_rights: WASIRights§file_rights: WASIRights

Implementations§

source§

impl WasiDir

source

pub fn fd_readdir( + &self, + cursor: usize, + write_buf: &mut [u8] +) -> Result<usize, Errno>

source

pub fn fd_fdstat_get(&self) -> Result<FdStat, Errno>

source

pub fn fd_fdstat_set_rights( + &mut self, + fs_rights_base: WASIRights, + fs_rights_inheriting: WASIRights +) -> Result<(), Errno>

source

pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno>

source

pub fn fd_filestat_set_times( + &mut self, + atim: __wasi_timestamp_t, + mtim: __wasi_timestamp_t, + fst_flags: Type +) -> Result<(), Errno>

Trait Implementations§

source§

impl Debug for WasiDir

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/struct.WasiFile.html b/async_wasi/snapshots/common/vfs/sync/struct.WasiFile.html new file mode 100644 index 000000000..d53669a95 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/struct.WasiFile.html @@ -0,0 +1,48 @@ +WasiFile in async_wasi::snapshots::common::vfs::sync - Rust
pub struct WasiFile {
+    pub fd: File,
+    pub flags: FdFlags,
+    pub right: WASIRights,
+}

Fields§

§fd: File§flags: FdFlags§right: WASIRights

Implementations§

source§

impl WasiFile

source

pub fn fd_advise( + &mut self, + offset: __wasi_filesize_t, + len: __wasi_filesize_t, + advice: Advice +) -> Result<(), Errno>

source

pub fn fd_allocate( + &mut self, + offset: __wasi_filesize_t, + len: __wasi_filesize_t +) -> Result<(), Errno>

source

pub fn fd_datasync(&mut self) -> Result<(), Errno>

source

pub fn fd_sync(&mut self) -> Result<(), Errno>

source

pub fn fd_fdstat_get(&mut self) -> Result<FdStat, Errno>

source

pub fn fd_fdstat_set_flags(&mut self, flags: FdFlags) -> Result<(), Errno>

source

pub fn fd_fdstat_set_rights( + &mut self, + fs_rights_base: WASIRights, + _fs_rights_inheriting: WASIRights +) -> Result<(), Errno>

source

pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno>

source

pub fn fd_filestat_set_size( + &mut self, + size: __wasi_filesize_t +) -> Result<(), Errno>

source

pub fn fd_filestat_set_times( + &mut self, + atim: __wasi_timestamp_t, + mtim: __wasi_timestamp_t, + fst_flags: Type +) -> Result<(), Errno>

source

pub fn fd_read(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Errno>

source

pub fn fd_pread( + &mut self, + bufs: &mut [IoSliceMut<'_>], + offset: __wasi_filesize_t +) -> Result<usize, Errno>

source

pub fn fd_write(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Errno>

source

pub fn fd_pwrite( + &mut self, + bufs: &[IoSlice<'_>], + offset: __wasi_filesize_t +) -> Result<usize, Errno>

source

pub fn fd_seek( + &mut self, + offset: __wasi_filedelta_t, + whence: Type +) -> Result<__wasi_filesize_t, Errno>

source

pub fn fd_tell(&mut self) -> Result<__wasi_filesize_t, Errno>

Trait Implementations§

source§

impl Debug for WasiFile

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/struct.WasiPreOpenDir.html b/async_wasi/snapshots/common/vfs/sync/struct.WasiPreOpenDir.html new file mode 100644 index 000000000..37f0cf5e3 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/struct.WasiPreOpenDir.html @@ -0,0 +1,47 @@ +WasiPreOpenDir in async_wasi::snapshots::common::vfs::sync - Rust
pub struct WasiPreOpenDir {
+    pub guest_path: PathBuf,
+    /* private fields */
+}

Fields§

§guest_path: PathBuf

Implementations§

source§

impl WasiPreOpenDir

source

pub fn new(host_path: PathBuf, guest_path: PathBuf) -> Self

source

pub fn get_absolutize_path<P: AsRef<Path>>( + &self, + sub_path: &P +) -> Result<PathBuf, Errno>

source

pub fn path_open_file<P: AsRef<Path>>( + &mut self, + path: &P, + oflags: OFlags, + fs_rights_base: WASIRights, + fdflags: FdFlags +) -> Result<WasiFile, Errno>

source

pub fn path_open_dir<P: AsRef<Path>>( + &mut self, + path: &P, + oflags: OFlags, + fs_rights_base: WASIRights, + fs_rights_inheriting: WASIRights, + fdflags: FdFlags +) -> Result<WasiDir, Errno>

source

pub fn path_create_directory(&self, path: &str) -> Result<(), Errno>

source

pub fn path_remove_directory(&self, path: &str) -> Result<(), Errno>

source

pub fn path_filestat_get( + &self, + path: &str, + follow_symlinks: bool +) -> Result<Filestat, Errno>

Methods from Deref<Target = WasiDir>§

source

pub fn fd_readdir( + &self, + cursor: usize, + write_buf: &mut [u8] +) -> Result<usize, Errno>

source

pub fn fd_fdstat_get(&self) -> Result<FdStat, Errno>

source

pub fn fd_fdstat_set_rights( + &mut self, + fs_rights_base: WASIRights, + fs_rights_inheriting: WASIRights +) -> Result<(), Errno>

source

pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno>

source

pub fn fd_filestat_set_times( + &mut self, + atim: __wasi_timestamp_t, + mtim: __wasi_timestamp_t, + fst_flags: Type +) -> Result<(), Errno>

Trait Implementations§

source§

impl Debug for WasiPreOpenDir

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for WasiPreOpenDir

§

type Target = WasiDir

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for WasiPreOpenDir

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/struct.WasiStderr.html b/async_wasi/snapshots/common/vfs/sync/struct.WasiStderr.html new file mode 100644 index 000000000..9dee629af --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/struct.WasiStderr.html @@ -0,0 +1,44 @@ +WasiStderr in async_wasi::snapshots::common::vfs::sync - Rust
pub struct WasiStderr;

Implementations§

source§

impl WasiStderr

source

pub fn fd_advise( + &mut self, + offset: __wasi_filesize_t, + len: __wasi_filesize_t, + advice: Advice +) -> Result<(), Errno>

source

pub fn fd_allocate( + &mut self, + offset: __wasi_filesize_t, + len: __wasi_filesize_t +) -> Result<(), Errno>

source

pub fn fd_datasync(&mut self) -> Result<(), Errno>

source

pub fn fd_sync(&mut self) -> Result<(), Errno>

source

pub fn fd_fdstat_get(&mut self) -> Result<FdStat, Errno>

source

pub fn fd_fdstat_set_flags(&mut self, flags: FdFlags) -> Result<(), Errno>

source

pub fn fd_fdstat_set_rights( + &mut self, + fs_rights_base: WASIRights, + _fs_rights_inheriting: WASIRights +) -> Result<(), Errno>

source

pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno>

source

pub fn fd_filestat_set_size( + &mut self, + size: __wasi_filesize_t +) -> Result<(), Errno>

source

pub fn fd_filestat_set_times( + &mut self, + atim: __wasi_timestamp_t, + mtim: __wasi_timestamp_t, + fst_flags: Type +) -> Result<(), Errno>

source

pub fn fd_read(&mut self, bufs: &[IoSliceMut<'_>]) -> Result<usize, Errno>

source

pub fn fd_pread( + &mut self, + bufs: &[IoSliceMut<'_>], + offset: __wasi_filesize_t +) -> Result<usize, Errno>

source

pub fn fd_write(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Errno>

source

pub fn fd_pwrite( + &mut self, + bufs: &[IoSlice<'_>], + offset: __wasi_filesize_t +) -> Result<usize, Errno>

source

pub fn fd_seek( + &mut self, + offset: __wasi_filedelta_t, + whence: Type +) -> Result<__wasi_filesize_t, Errno>

source

pub fn fd_tell(&mut self) -> Result<__wasi_filesize_t, Errno>

Trait Implementations§

source§

impl Debug for WasiStderr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/struct.WasiStdin.html b/async_wasi/snapshots/common/vfs/sync/struct.WasiStdin.html new file mode 100644 index 000000000..6b96b680f --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/struct.WasiStdin.html @@ -0,0 +1,44 @@ +WasiStdin in async_wasi::snapshots::common::vfs::sync - Rust
pub struct WasiStdin;

Implementations§

source§

impl WasiStdin

source

pub fn fd_advise( + &mut self, + offset: __wasi_filesize_t, + len: __wasi_filesize_t, + advice: Advice +) -> Result<(), Errno>

source

pub fn fd_allocate( + &mut self, + offset: __wasi_filesize_t, + len: __wasi_filesize_t +) -> Result<(), Errno>

source

pub fn fd_datasync(&mut self) -> Result<(), Errno>

source

pub fn fd_sync(&mut self) -> Result<(), Errno>

source

pub fn fd_fdstat_get(&mut self) -> Result<FdStat, Errno>

source

pub fn fd_fdstat_set_flags(&mut self, flags: FdFlags) -> Result<(), Errno>

source

pub fn fd_fdstat_set_rights( + &mut self, + fs_rights_base: WASIRights, + _fs_rights_inheriting: WASIRights +) -> Result<(), Errno>

source

pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno>

source

pub fn fd_filestat_set_size( + &mut self, + size: __wasi_filesize_t +) -> Result<(), Errno>

source

pub fn fd_filestat_set_times( + &mut self, + atim: __wasi_timestamp_t, + mtim: __wasi_timestamp_t, + fst_flags: Type +) -> Result<(), Errno>

source

pub fn fd_read(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Errno>

source

pub fn fd_pread( + &mut self, + bufs: &[IoSliceMut<'_>], + offset: __wasi_filesize_t +) -> Result<usize, Errno>

source

pub fn fd_write(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Errno>

source

pub fn fd_pwrite( + &mut self, + bufs: &[IoSlice<'_>], + offset: __wasi_filesize_t +) -> Result<usize, Errno>

source

pub fn fd_seek( + &mut self, + offset: __wasi_filedelta_t, + whence: Type +) -> Result<__wasi_filesize_t, Errno>

source

pub fn fd_tell(&mut self) -> Result<__wasi_filesize_t, Errno>

Trait Implementations§

source§

impl Debug for WasiStdin

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/common/vfs/sync/struct.WasiStdout.html b/async_wasi/snapshots/common/vfs/sync/struct.WasiStdout.html new file mode 100644 index 000000000..357d5bba9 --- /dev/null +++ b/async_wasi/snapshots/common/vfs/sync/struct.WasiStdout.html @@ -0,0 +1,44 @@ +WasiStdout in async_wasi::snapshots::common::vfs::sync - Rust
pub struct WasiStdout;

Implementations§

source§

impl WasiStdout

source

pub fn fd_advise( + &mut self, + offset: __wasi_filesize_t, + len: __wasi_filesize_t, + advice: Advice +) -> Result<(), Errno>

source

pub fn fd_allocate( + &mut self, + offset: __wasi_filesize_t, + len: __wasi_filesize_t +) -> Result<(), Errno>

source

pub fn fd_datasync(&mut self) -> Result<(), Errno>

source

pub fn fd_sync(&mut self) -> Result<(), Errno>

source

pub fn fd_fdstat_get(&mut self) -> Result<FdStat, Errno>

source

pub fn fd_fdstat_set_flags(&mut self, flags: FdFlags) -> Result<(), Errno>

source

pub fn fd_fdstat_set_rights( + &mut self, + fs_rights_base: WASIRights, + _fs_rights_inheriting: WASIRights +) -> Result<(), Errno>

source

pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno>

source

pub fn fd_filestat_set_size( + &mut self, + size: __wasi_filesize_t +) -> Result<(), Errno>

source

pub fn fd_filestat_set_times( + &mut self, + atim: __wasi_timestamp_t, + mtim: __wasi_timestamp_t, + fst_flags: Type +) -> Result<(), Errno>

source

pub fn fd_read(&mut self, bufs: &[IoSliceMut<'_>]) -> Result<usize, Errno>

source

pub fn fd_pread( + &mut self, + bufs: &[IoSliceMut<'_>], + offset: __wasi_filesize_t +) -> Result<usize, Errno>

source

pub fn fd_write(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Errno>

source

pub fn fd_pwrite( + &mut self, + bufs: &[IoSlice<'_>], + offset: __wasi_filesize_t +) -> Result<usize, Errno>

source

pub fn fd_seek( + &mut self, + offset: __wasi_filedelta_t, + whence: Type +) -> Result<__wasi_filesize_t, Errno>

source

pub fn fd_tell(&mut self) -> Result<__wasi_filesize_t, Errno>

Trait Implementations§

source§

impl Debug for WasiStdout

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/env/enum.VFD.html b/async_wasi/snapshots/env/enum.VFD.html new file mode 100644 index 000000000..89fda3781 --- /dev/null +++ b/async_wasi/snapshots/env/enum.VFD.html @@ -0,0 +1,15 @@ +VFD in async_wasi::snapshots::env - Rust
pub enum VFD {
+    Closed,
+    Inode(INode),
+    AsyncSocket(AsyncWasiSocket),
+}

Variants§

§

Closed

§

Inode(INode)

§

AsyncSocket(AsyncWasiSocket)

Implementations§

source§

impl VFD

source

pub fn is_socket(&self) -> bool

source

pub fn is_inode(&self) -> bool

Trait Implementations§

source§

impl Debug for VFD

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&VFD> for SerialVFD

source§

fn from(vfd: &VFD) -> Self

Converts to this type from the input type.
source§

impl From<SerialStderr> for VFD

source§

fn from(_: SerialStderr) -> Self

Converts to this type from the input type.
source§

impl From<SerialStdin> for VFD

source§

fn from(_: SerialStdin) -> Self

Converts to this type from the input type.
source§

impl From<SerialStdout> for VFD

source§

fn from(_: SerialStdout) -> Self

Converts to this type from the input type.
source§

impl From<SerialWasiDir> for VFD

source§

fn from(_: SerialWasiDir) -> Self

Converts to this type from the input type.
source§

impl From<SerialWasiFile> for VFD

source§

fn from(_: SerialWasiFile) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for VFD

§

impl Send for VFD

§

impl Sync for VFD

§

impl Unpin for VFD

§

impl !UnwindSafe for VFD

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/env/index.html b/async_wasi/snapshots/env/index.html new file mode 100644 index 000000000..86f9a20c5 --- /dev/null +++ b/async_wasi/snapshots/env/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::env - Rust

Module async_wasi::snapshots::env

source ·

Re-exports

  • pub use super::common::error::Errno;
  • pub use super::common::types as wasi_types;
  • pub use super::common::vfs;
  • pub use super::common::net::async_tokio::AsyncWasiSocket;

Enums

Traits

\ No newline at end of file diff --git a/async_wasi/snapshots/env/sidebar-items.js b/async_wasi/snapshots/env/sidebar-items.js new file mode 100644 index 000000000..d2c0d9673 --- /dev/null +++ b/async_wasi/snapshots/env/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["VFD"],"trait":["AsyncVM"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/env/trait.AsyncVM.html b/async_wasi/snapshots/env/trait.AsyncVM.html new file mode 100644 index 000000000..91c4e6bc2 --- /dev/null +++ b/async_wasi/snapshots/env/trait.AsyncVM.html @@ -0,0 +1,4 @@ +AsyncVM in async_wasi::snapshots::env - Rust
pub trait AsyncVM: Send + Sync {
+    // Required method
+    fn yield_now(&mut self) -> Result<(), Errno>;
+}

Required Methods§

source

fn yield_now(&mut self) -> Result<(), Errno>

Implementors§

\ No newline at end of file diff --git a/async_wasi/snapshots/index.html b/async_wasi/snapshots/index.html new file mode 100644 index 000000000..281b69b61 --- /dev/null +++ b/async_wasi/snapshots/index.html @@ -0,0 +1 @@ +async_wasi::snapshots - Rust

Module async_wasi::snapshots

source ·

Modules

Structs

\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_poll/fn.poll_oneoff.html b/async_wasi/snapshots/preview_1/async_poll/fn.poll_oneoff.html new file mode 100644 index 000000000..1a04cc045 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_poll/fn.poll_oneoff.html @@ -0,0 +1,8 @@ +poll_oneoff in async_wasi::snapshots::preview_1::async_poll - Rust
pub async fn poll_oneoff<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    in_ptr: WasmPtr<__wasi_subscription_t>,
+    out_ptr: WasmPtr<__wasi_event_t>,
+    nsubscriptions: __wasi_size_t,
+    revents_num_ptr: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_poll/index.html b/async_wasi/snapshots/preview_1/async_poll/index.html new file mode 100644 index 000000000..6a1268b2d --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_poll/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::preview_1::async_poll - Rust

Functions

\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_poll/sidebar-items.js b/async_wasi/snapshots/preview_1/async_poll/sidebar-items.js new file mode 100644 index 000000000..b649bdd80 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_poll/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["poll_oneoff"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/addrinfo/enum.AddressFamily.html b/async_wasi/snapshots/preview_1/async_socket/addrinfo/enum.AddressFamily.html new file mode 100644 index 000000000..2cf7f9377 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/addrinfo/enum.AddressFamily.html @@ -0,0 +1,16 @@ +AddressFamily in async_wasi::snapshots::preview_1::async_socket::addrinfo - Rust
#[repr(align(1), u8)]
pub enum AddressFamily { + Unspec = 0, + Inet4 = 1, + Inet6 = 2, +}

Variants§

§

Unspec = 0

§

Inet4 = 1

§

Inet6 = 2

Trait Implementations§

source§

impl Clone for AddressFamily

source§

fn clone(&self) -> AddressFamily

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddressFamily

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for AddressFamily

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/addrinfo/fn.sock_getaddrinfo.html b/async_wasi/snapshots/preview_1/async_socket/addrinfo/fn.sock_getaddrinfo.html new file mode 100644 index 000000000..291a5d672 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/addrinfo/fn.sock_getaddrinfo.html @@ -0,0 +1,12 @@ +sock_getaddrinfo in async_wasi::snapshots::preview_1::async_socket::addrinfo - Rust
pub fn sock_getaddrinfo<M: Memory>(
+    _ctx: &mut WasiCtx,
+    mem: &mut M,
+    node: WasmPtr<u8>,
+    node_len: u32,
+    _server: WasmPtr<u8>,
+    _server_len: u32,
+    _hint: WasmPtr<()>,
+    res: WasmPtr<u32>,
+    max_len: u32,
+    res_len: WasmPtr<u32>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/addrinfo/index.html b/async_wasi/snapshots/preview_1/async_socket/addrinfo/index.html new file mode 100644 index 000000000..aeddb1dac --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/addrinfo/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::preview_1::async_socket::addrinfo - Rust

Structs

Enums

Functions

\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/addrinfo/sidebar-items.js b/async_wasi/snapshots/preview_1/async_socket/addrinfo/sidebar-items.js new file mode 100644 index 000000000..43158e545 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/addrinfo/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AddressFamily"],"fn":["sock_getaddrinfo"],"struct":["WasiAddrinfo","WasiSockaddr"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/addrinfo/struct.WasiAddrinfo.html b/async_wasi/snapshots/preview_1/async_socket/addrinfo/struct.WasiAddrinfo.html new file mode 100644 index 000000000..9e32685bc --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/addrinfo/struct.WasiAddrinfo.html @@ -0,0 +1,22 @@ +WasiAddrinfo in async_wasi::snapshots::preview_1::async_socket::addrinfo - Rust
#[repr(C, packed(4))]
pub struct WasiAddrinfo { + pub ai_flags: u16, + pub ai_family: AddressFamily, + pub ai_socktype: u8, + pub ai_protocol: u8, + pub ai_addrlen: u32, + pub ai_addr: u32, + pub ai_canonname: u32, + pub ai_canonnamelen: u32, + pub ai_next: u32, +}

Fields§

§ai_flags: u16§ai_family: AddressFamily§ai_socktype: u8§ai_protocol: u8§ai_addrlen: u32§ai_addr: u32§ai_canonname: u32§ai_canonnamelen: u32§ai_next: u32

Trait Implementations§

source§

impl Clone for WasiAddrinfo

source§

fn clone(&self) -> WasiAddrinfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiAddrinfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/addrinfo/struct.WasiSockaddr.html b/async_wasi/snapshots/preview_1/async_socket/addrinfo/struct.WasiSockaddr.html new file mode 100644 index 000000000..9a278d225 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/addrinfo/struct.WasiSockaddr.html @@ -0,0 +1,16 @@ +WasiSockaddr in async_wasi::snapshots::preview_1::async_socket::addrinfo - Rust
#[repr(C)]
pub struct WasiSockaddr { + pub family: AddressFamily, + pub sa_data_len: u32, + pub sa_data: u32, +}

Fields§

§family: AddressFamily§sa_data_len: u32§sa_data: u32

Trait Implementations§

source§

impl Clone for WasiSockaddr

source§

fn clone(&self) -> WasiSockaddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiSockaddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_accept.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_accept.html new file mode 100644 index 000000000..c84ad5920 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_accept.html @@ -0,0 +1,6 @@ +sock_accept in async_wasi::snapshots::preview_1::async_socket - Rust
pub async fn sock_accept<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    ro_fd_ptr: WasmPtr<__wasi_fd_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_bind.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_bind.html new file mode 100644 index 000000000..3b3a4a9b6 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_bind.html @@ -0,0 +1,7 @@ +sock_bind in async_wasi::snapshots::preview_1::async_socket - Rust
pub fn sock_bind<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    fd: __wasi_fd_t,
+    addr_ptr: WasmPtr<__wasi_address_t>,
+    port: u32
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_connect.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_connect.html new file mode 100644 index 000000000..59995cf23 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_connect.html @@ -0,0 +1,7 @@ +sock_connect in async_wasi::snapshots::preview_1::async_socket - Rust
pub async fn sock_connect<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    fd: __wasi_fd_t,
+    addr_ptr: WasmPtr<__wasi_address_t>,
+    port: u32
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_getlocaladdr.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_getlocaladdr.html new file mode 100644 index 000000000..8931dfe49 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_getlocaladdr.html @@ -0,0 +1,8 @@ +sock_getlocaladdr in async_wasi::snapshots::preview_1::async_socket - Rust
pub fn sock_getlocaladdr<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    wasi_addr_ptr: WasmPtr<__wasi_address_t>,
+    addr_type: WasmPtr<u32>,
+    port_ptr: WasmPtr<u32>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_getpeeraddr.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_getpeeraddr.html new file mode 100644 index 000000000..e19c96554 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_getpeeraddr.html @@ -0,0 +1,8 @@ +sock_getpeeraddr in async_wasi::snapshots::preview_1::async_socket - Rust
pub fn sock_getpeeraddr<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    wasi_addr_ptr: WasmPtr<__wasi_address_t>,
+    addr_type: WasmPtr<u32>,
+    port_ptr: WasmPtr<u32>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_getsockopt.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_getsockopt.html new file mode 100644 index 000000000..22e9a0cb3 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_getsockopt.html @@ -0,0 +1,9 @@ +sock_getsockopt in async_wasi::snapshots::preview_1::async_socket - Rust
pub fn sock_getsockopt<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    level: Type,
+    name: Type,
+    flag: WasmPtr<i32>,
+    flag_size_ptr: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_listen.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_listen.html new file mode 100644 index 000000000..ac5dbba02 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_listen.html @@ -0,0 +1,6 @@ +sock_listen in async_wasi::snapshots::preview_1::async_socket - Rust
pub fn sock_listen<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    backlog: u32
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_lookup_ip.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_lookup_ip.html new file mode 100644 index 000000000..cf54c84cf --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_lookup_ip.html @@ -0,0 +1,10 @@ +sock_lookup_ip in async_wasi::snapshots::preview_1::async_socket - Rust
pub async fn sock_lookup_ip<M: Memory>(
+    _ctx: &mut WasiCtx,
+    mem: &mut M,
+    host_name_ptr: WasmPtr<u8>,
+    host_name_len: __wasi_size_t,
+    lookup_type: Type,
+    addr_buf: WasmPtr<u8>,
+    addr_buf_max_len: __wasi_size_t,
+    raddr_num_ptr: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_open.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_open.html new file mode 100644 index 000000000..6ed50a49b --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_open.html @@ -0,0 +1,7 @@ +sock_open in async_wasi::snapshots::preview_1::async_socket - Rust
pub fn sock_open<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    af: Type,
+    ty: Type,
+    ro_fd_ptr: WasmPtr<__wasi_fd_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_recv.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_recv.html new file mode 100644 index 000000000..5c0e5abc8 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_recv.html @@ -0,0 +1,10 @@ +sock_recv in async_wasi::snapshots::preview_1::async_socket - Rust
pub async fn sock_recv<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_iovec_t>,
+    buf_len: __wasi_size_t,
+    flags: Type,
+    ro_data_len_ptr: WasmPtr<__wasi_size_t>,
+    ro_flags_ptr: WasmPtr<Type>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_recv_from.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_recv_from.html new file mode 100644 index 000000000..b3afdc630 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_recv_from.html @@ -0,0 +1,12 @@ +sock_recv_from in async_wasi::snapshots::preview_1::async_socket - Rust
pub async fn sock_recv_from<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_iovec_t>,
+    buf_len: __wasi_size_t,
+    wasi_addr_ptr: WasmPtr<__wasi_address_t>,
+    flags: Type,
+    port_ptr: WasmPtr<u32>,
+    ro_data_len_ptr: WasmPtr<__wasi_size_t>,
+    ro_flags_ptr: WasmPtr<Type>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_send.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_send.html new file mode 100644 index 000000000..c5ce5bd43 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_send.html @@ -0,0 +1,9 @@ +sock_send in async_wasi::snapshots::preview_1::async_socket - Rust
pub async fn sock_send<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_ciovec_t>,
+    buf_len: __wasi_size_t,
+    _flags: __wasi_siflags_t,
+    send_len_ptr: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_send_to.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_send_to.html new file mode 100644 index 000000000..db52242e8 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_send_to.html @@ -0,0 +1,11 @@ +sock_send_to in async_wasi::snapshots::preview_1::async_socket - Rust
pub async fn sock_send_to<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_ciovec_t>,
+    buf_len: __wasi_size_t,
+    wasi_addr_ptr: WasmPtr<__wasi_address_t>,
+    port: u32,
+    _flags: __wasi_siflags_t,
+    send_len_ptr: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_setsockopt.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_setsockopt.html new file mode 100644 index 000000000..9e4f46101 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_setsockopt.html @@ -0,0 +1,9 @@ +sock_setsockopt in async_wasi::snapshots::preview_1::async_socket - Rust
pub fn sock_setsockopt<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    fd: __wasi_fd_t,
+    level: Type,
+    name: Type,
+    flag: WasmPtr<i32>,
+    flag_size: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/fn.sock_shutdown.html b/async_wasi/snapshots/preview_1/async_socket/fn.sock_shutdown.html new file mode 100644 index 000000000..632a83f21 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/fn.sock_shutdown.html @@ -0,0 +1,6 @@ +sock_shutdown in async_wasi::snapshots::preview_1::async_socket - Rust
pub fn sock_shutdown<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    how: Type
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/index.html b/async_wasi/snapshots/preview_1/async_socket/index.html new file mode 100644 index 000000000..61aec6a71 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::preview_1::async_socket - Rust

Modules

Functions

\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/async_socket/sidebar-items.js b/async_wasi/snapshots/preview_1/async_socket/sidebar-items.js new file mode 100644 index 000000000..e5d1cce92 --- /dev/null +++ b/async_wasi/snapshots/preview_1/async_socket/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["sock_accept","sock_bind","sock_connect","sock_getlocaladdr","sock_getpeeraddr","sock_getsockopt","sock_listen","sock_lookup_ip","sock_open","sock_recv","sock_recv_from","sock_send","sock_send_to","sock_setsockopt","sock_shutdown"],"mod":["addrinfo"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.args_get.html b/async_wasi/snapshots/preview_1/fn.args_get.html new file mode 100644 index 000000000..2270d46ea --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.args_get.html @@ -0,0 +1,6 @@ +args_get in async_wasi::snapshots::preview_1 - Rust
pub fn args_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    argv: WasmPtr<__wasi_size_t>,
+    argv_buf: WasmPtr<u8>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.args_sizes_get.html b/async_wasi/snapshots/preview_1/fn.args_sizes_get.html new file mode 100644 index 000000000..3de60f85e --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.args_sizes_get.html @@ -0,0 +1,6 @@ +args_sizes_get in async_wasi::snapshots::preview_1 - Rust
pub fn args_sizes_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    argc: WasmPtr<__wasi_size_t>,
+    argv_buf_size: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.clock_res_get.html b/async_wasi/snapshots/preview_1/fn.clock_res_get.html new file mode 100644 index 000000000..fb706783b --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.clock_res_get.html @@ -0,0 +1,6 @@ +clock_res_get in async_wasi::snapshots::preview_1 - Rust
pub fn clock_res_get<M: Memory>(
+    _ctx: &mut WasiCtx,
+    mem: &mut M,
+    clock_id: Type,
+    resolution_ptr: WasmPtr<__wasi_timestamp_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.clock_time_get.html b/async_wasi/snapshots/preview_1/fn.clock_time_get.html new file mode 100644 index 000000000..252e1e24e --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.clock_time_get.html @@ -0,0 +1,7 @@ +clock_time_get in async_wasi::snapshots::preview_1 - Rust
pub fn clock_time_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    clock_id: Type,
+    precision: __wasi_timestamp_t,
+    time_ptr: WasmPtr<__wasi_timestamp_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.environ_get.html b/async_wasi/snapshots/preview_1/fn.environ_get.html new file mode 100644 index 000000000..ab838bc96 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.environ_get.html @@ -0,0 +1,6 @@ +environ_get in async_wasi::snapshots::preview_1 - Rust
pub fn environ_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    environ: WasmPtr<__wasi_size_t>,
+    environ_buf: WasmPtr<u8>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.environ_sizes_get.html b/async_wasi/snapshots/preview_1/fn.environ_sizes_get.html new file mode 100644 index 000000000..46d47ee7c --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.environ_sizes_get.html @@ -0,0 +1,6 @@ +environ_sizes_get in async_wasi::snapshots::preview_1 - Rust
pub fn environ_sizes_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    environ_count: WasmPtr<__wasi_size_t>,
+    environ_buf_size: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_advise.html b/async_wasi/snapshots/preview_1/fn.fd_advise.html new file mode 100644 index 000000000..b1ca0d119 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_advise.html @@ -0,0 +1,8 @@ +fd_advise in async_wasi::snapshots::preview_1 - Rust
pub fn fd_advise<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    _offset: __wasi_filesize_t,
+    _len: __wasi_filesize_t,
+    _advice: Type
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_allocate.html b/async_wasi/snapshots/preview_1/fn.fd_allocate.html new file mode 100644 index 000000000..108d4b7b8 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_allocate.html @@ -0,0 +1,7 @@ +fd_allocate in async_wasi::snapshots::preview_1 - Rust
pub fn fd_allocate<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    offset: __wasi_filesize_t,
+    len: __wasi_filesize_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_close.html b/async_wasi/snapshots/preview_1/fn.fd_close.html new file mode 100644 index 000000000..0ccbc4a77 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_close.html @@ -0,0 +1,5 @@ +fd_close in async_wasi::snapshots::preview_1 - Rust
pub fn fd_close<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_datasync.html b/async_wasi/snapshots/preview_1/fn.fd_datasync.html new file mode 100644 index 000000000..dec7d33ff --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_datasync.html @@ -0,0 +1,5 @@ +fd_datasync in async_wasi::snapshots::preview_1 - Rust
pub fn fd_datasync<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_fdstat_get.html b/async_wasi/snapshots/preview_1/fn.fd_fdstat_get.html new file mode 100644 index 000000000..fffec4d72 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_fdstat_get.html @@ -0,0 +1,6 @@ +fd_fdstat_get in async_wasi::snapshots::preview_1 - Rust
pub fn fd_fdstat_get<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_fdstat_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_fdstat_set_flags.html b/async_wasi/snapshots/preview_1/fn.fd_fdstat_set_flags.html new file mode 100644 index 000000000..a12cd9592 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_fdstat_set_flags.html @@ -0,0 +1,6 @@ +fd_fdstat_set_flags in async_wasi::snapshots::preview_1 - Rust
pub fn fd_fdstat_set_flags<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    flags: Type
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_fdstat_set_rights.html b/async_wasi/snapshots/preview_1/fn.fd_fdstat_set_rights.html new file mode 100644 index 000000000..9f174fc37 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_fdstat_set_rights.html @@ -0,0 +1,7 @@ +fd_fdstat_set_rights in async_wasi::snapshots::preview_1 - Rust
pub fn fd_fdstat_set_rights<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    fs_rights_base: Type,
+    fs_rights_inheriting: Type
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_filestat_get.html b/async_wasi/snapshots/preview_1/fn.fd_filestat_get.html new file mode 100644 index 000000000..4daa4eeb5 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_filestat_get.html @@ -0,0 +1,6 @@ +fd_filestat_get in async_wasi::snapshots::preview_1 - Rust
pub fn fd_filestat_get<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf: WasmPtr<__wasi_filestat_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_filestat_set_size.html b/async_wasi/snapshots/preview_1/fn.fd_filestat_set_size.html new file mode 100644 index 000000000..b63f2700b --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_filestat_set_size.html @@ -0,0 +1,6 @@ +fd_filestat_set_size in async_wasi::snapshots::preview_1 - Rust
pub fn fd_filestat_set_size<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    st_size: __wasi_filesize_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_filestat_set_times.html b/async_wasi/snapshots/preview_1/fn.fd_filestat_set_times.html new file mode 100644 index 000000000..8b77b910c --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_filestat_set_times.html @@ -0,0 +1,8 @@ +fd_filestat_set_times in async_wasi::snapshots::preview_1 - Rust
pub fn fd_filestat_set_times<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    st_atim: __wasi_timestamp_t,
+    st_mtim: __wasi_timestamp_t,
+    fst_flags: Type
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_pread.html b/async_wasi/snapshots/preview_1/fn.fd_pread.html new file mode 100644 index 000000000..b51f7c45b --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_pread.html @@ -0,0 +1,9 @@ +fd_pread in async_wasi::snapshots::preview_1 - Rust
pub fn fd_pread<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    iovs: WasmPtr<__wasi_iovec_t>,
+    iovs_len: __wasi_size_t,
+    offset: __wasi_filesize_t,
+    nread: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_prestat_dir_name.html b/async_wasi/snapshots/preview_1/fn.fd_prestat_dir_name.html new file mode 100644 index 000000000..3ec7658d3 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_prestat_dir_name.html @@ -0,0 +1,7 @@ +fd_prestat_dir_name in async_wasi::snapshots::preview_1 - Rust
pub fn fd_prestat_dir_name<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    path_buf_ptr: WasmPtr<u8>,
+    path_max_len: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_prestat_get.html b/async_wasi/snapshots/preview_1/fn.fd_prestat_get.html new file mode 100644 index 000000000..2a11cce50 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_prestat_get.html @@ -0,0 +1,6 @@ +fd_prestat_get in async_wasi::snapshots::preview_1 - Rust
pub fn fd_prestat_get<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    prestat_ptr: WasmPtr<__wasi_prestat_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_pwrite.html b/async_wasi/snapshots/preview_1/fn.fd_pwrite.html new file mode 100644 index 000000000..dbb63fba3 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_pwrite.html @@ -0,0 +1,9 @@ +fd_pwrite in async_wasi::snapshots::preview_1 - Rust
pub fn fd_pwrite<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    iovs: WasmPtr<__wasi_ciovec_t>,
+    iovs_len: __wasi_size_t,
+    offset: __wasi_filesize_t,
+    nwritten: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_read.html b/async_wasi/snapshots/preview_1/fn.fd_read.html new file mode 100644 index 000000000..1dbf77ec4 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_read.html @@ -0,0 +1,8 @@ +fd_read in async_wasi::snapshots::preview_1 - Rust
pub fn fd_read<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    iovs: WasmPtr<__wasi_iovec_t>,
+    iovs_len: __wasi_size_t,
+    nread: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_readdir.html b/async_wasi/snapshots/preview_1/fn.fd_readdir.html new file mode 100644 index 000000000..ac65245bf --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_readdir.html @@ -0,0 +1,9 @@ +fd_readdir in async_wasi::snapshots::preview_1 - Rust
pub fn fd_readdir<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf: WasmPtr<u8>,
+    buf_len: __wasi_size_t,
+    cookie: __wasi_dircookie_t,
+    bufused_ptr: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_renumber.html b/async_wasi/snapshots/preview_1/fn.fd_renumber.html new file mode 100644 index 000000000..362f77ed0 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_renumber.html @@ -0,0 +1,6 @@ +fd_renumber in async_wasi::snapshots::preview_1 - Rust
pub fn fd_renumber<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    from: __wasi_fd_t,
+    to: __wasi_fd_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_seek.html b/async_wasi/snapshots/preview_1/fn.fd_seek.html new file mode 100644 index 000000000..ce731373c --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_seek.html @@ -0,0 +1,8 @@ +fd_seek in async_wasi::snapshots::preview_1 - Rust
pub fn fd_seek<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    offset: __wasi_filedelta_t,
+    whence: Type,
+    newoffset_ptr: WasmPtr<__wasi_filesize_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_sync.html b/async_wasi/snapshots/preview_1/fn.fd_sync.html new file mode 100644 index 000000000..67aa76f65 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_sync.html @@ -0,0 +1,5 @@ +fd_sync in async_wasi::snapshots::preview_1 - Rust
pub fn fd_sync<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_tell.html b/async_wasi/snapshots/preview_1/fn.fd_tell.html new file mode 100644 index 000000000..4a7936907 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_tell.html @@ -0,0 +1,6 @@ +fd_tell in async_wasi::snapshots::preview_1 - Rust
pub fn fd_tell<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    offset: WasmPtr<__wasi_filesize_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.fd_write.html b/async_wasi/snapshots/preview_1/fn.fd_write.html new file mode 100644 index 000000000..df4c4e6a8 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.fd_write.html @@ -0,0 +1,8 @@ +fd_write in async_wasi::snapshots::preview_1 - Rust
pub fn fd_write<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    iovs: WasmPtr<__wasi_ciovec_t>,
+    iovs_len: __wasi_size_t,
+    nwritten: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_create_directory.html b/async_wasi/snapshots/preview_1/fn.path_create_directory.html new file mode 100644 index 000000000..f0b34e042 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_create_directory.html @@ -0,0 +1,7 @@ +path_create_directory in async_wasi::snapshots::preview_1 - Rust
pub fn path_create_directory<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    dirfd: __wasi_fd_t,
+    path_ptr: WasmPtr<u8>,
+    path_len: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_filestat_get.html b/async_wasi/snapshots/preview_1/fn.path_filestat_get.html new file mode 100644 index 000000000..76ac12399 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_filestat_get.html @@ -0,0 +1,9 @@ +path_filestat_get in async_wasi::snapshots::preview_1 - Rust
pub fn path_filestat_get<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    dirfd: __wasi_fd_t,
+    flags: Type,
+    path_ptr: WasmPtr<u8>,
+    path_len: __wasi_size_t,
+    file_stat_ptr: WasmPtr<__wasi_filestat_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_filestat_set_times.html b/async_wasi/snapshots/preview_1/fn.path_filestat_set_times.html new file mode 100644 index 000000000..b87342a13 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_filestat_set_times.html @@ -0,0 +1,11 @@ +path_filestat_set_times in async_wasi::snapshots::preview_1 - Rust
pub fn path_filestat_set_times<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _dirfd: __wasi_fd_t,
+    _flags: Type,
+    _path: WasmPtr<u8>,
+    _path_len: __wasi_size_t,
+    _st_atim: __wasi_timestamp_t,
+    _st_mtim: __wasi_timestamp_t,
+    _fst_flags: Type
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_link.html b/async_wasi/snapshots/preview_1/fn.path_link.html new file mode 100644 index 000000000..d8439b013 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_link.html @@ -0,0 +1,11 @@ +path_link in async_wasi::snapshots::preview_1 - Rust
pub fn path_link<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _old_fd: __wasi_fd_t,
+    _old_flags: Type,
+    _old_path: WasmPtr<u8>,
+    _old_path_len: __wasi_size_t,
+    _new_fd: __wasi_fd_t,
+    _new_path: WasmPtr<u8>,
+    _new_path_len: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_open.html b/async_wasi/snapshots/preview_1/fn.path_open.html new file mode 100644 index 000000000..497f8b028 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_open.html @@ -0,0 +1,13 @@ +path_open in async_wasi::snapshots::preview_1 - Rust
pub fn path_open<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    dirfd: __wasi_fd_t,
+    _dirflags: Type,
+    path: WasmPtr<u8>,
+    path_len: __wasi_size_t,
+    o_flags: Type,
+    fs_rights_base: Type,
+    fs_rights_inheriting: Type,
+    fs_flags: Type,
+    fd_ptr: WasmPtr<__wasi_fd_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_readlink.html b/async_wasi/snapshots/preview_1/fn.path_readlink.html new file mode 100644 index 000000000..0758bcdc7 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_readlink.html @@ -0,0 +1,10 @@ +path_readlink in async_wasi::snapshots::preview_1 - Rust
pub fn path_readlink<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _dir_fd: __wasi_fd_t,
+    _path: WasmPtr<u8>,
+    _path_len: __wasi_size_t,
+    _buf: WasmPtr<u8>,
+    _buf_len: __wasi_size_t,
+    _buf_used: WasmPtr<__wasi_size_t>
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_remove_directory.html b/async_wasi/snapshots/preview_1/fn.path_remove_directory.html new file mode 100644 index 000000000..6757fe4d4 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_remove_directory.html @@ -0,0 +1,7 @@ +path_remove_directory in async_wasi::snapshots::preview_1 - Rust
pub fn path_remove_directory<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    dirfd: __wasi_fd_t,
+    path_ptr: WasmPtr<u8>,
+    path_len: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_rename.html b/async_wasi/snapshots/preview_1/fn.path_rename.html new file mode 100644 index 000000000..90110f3a7 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_rename.html @@ -0,0 +1,10 @@ +path_rename in async_wasi::snapshots::preview_1 - Rust
pub fn path_rename<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &M,
+    old_fd: __wasi_fd_t,
+    old_path: WasmPtr<u8>,
+    old_path_len: __wasi_size_t,
+    new_fd: __wasi_fd_t,
+    new_path: WasmPtr<u8>,
+    new_path_len: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_symlink.html b/async_wasi/snapshots/preview_1/fn.path_symlink.html new file mode 100644 index 000000000..faaddfc29 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_symlink.html @@ -0,0 +1,9 @@ +path_symlink in async_wasi::snapshots::preview_1 - Rust
pub fn path_symlink<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _old_path: WasmPtr<u8>,
+    _old_path_len: __wasi_size_t,
+    _fd: __wasi_fd_t,
+    _new_path: WasmPtr<u8>,
+    _new_path_len: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.path_unlink_file.html b/async_wasi/snapshots/preview_1/fn.path_unlink_file.html new file mode 100644 index 000000000..7d98a2869 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.path_unlink_file.html @@ -0,0 +1,7 @@ +path_unlink_file in async_wasi::snapshots::preview_1 - Rust
pub fn path_unlink_file<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    dirfd: __wasi_fd_t,
+    path_ptr: WasmPtr<u8>,
+    path_len: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.proc_exit.html b/async_wasi/snapshots/preview_1/fn.proc_exit.html new file mode 100644 index 000000000..323b9b17f --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.proc_exit.html @@ -0,0 +1,5 @@ +proc_exit in async_wasi::snapshots::preview_1 - Rust
pub fn proc_exit<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    code: __wasi_exitcode_t
+)
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.proc_raise.html b/async_wasi/snapshots/preview_1/fn.proc_raise.html new file mode 100644 index 000000000..2caa9f810 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.proc_raise.html @@ -0,0 +1,5 @@ +proc_raise in async_wasi::snapshots::preview_1 - Rust
pub fn proc_raise<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _sig: Type
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.random_get.html b/async_wasi/snapshots/preview_1/fn.random_get.html new file mode 100644 index 000000000..dacb590d7 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.random_get.html @@ -0,0 +1,6 @@ +random_get in async_wasi::snapshots::preview_1 - Rust
pub fn random_get<M: Memory>(
+    _ctx: &mut WasiCtx,
+    mem: &mut M,
+    buf: WasmPtr<u8>,
+    buf_len: __wasi_size_t
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/fn.sched_yield.html b/async_wasi/snapshots/preview_1/fn.sched_yield.html new file mode 100644 index 000000000..0dcaec403 --- /dev/null +++ b/async_wasi/snapshots/preview_1/fn.sched_yield.html @@ -0,0 +1,4 @@ +sched_yield in async_wasi::snapshots::preview_1 - Rust
pub fn sched_yield<VM: AsyncVM>(
+    _ctx: &mut WasiCtx,
+    vm: &mut VM
+) -> Result<(), Errno>
\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/index.html b/async_wasi/snapshots/preview_1/index.html new file mode 100644 index 000000000..2beaf4a40 --- /dev/null +++ b/async_wasi/snapshots/preview_1/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::preview_1 - Rust

Modules

Functions

\ No newline at end of file diff --git a/async_wasi/snapshots/preview_1/sidebar-items.js b/async_wasi/snapshots/preview_1/sidebar-items.js new file mode 100644 index 000000000..7e79f7f5f --- /dev/null +++ b/async_wasi/snapshots/preview_1/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["args_get","args_sizes_get","clock_res_get","clock_time_get","environ_get","environ_sizes_get","fd_advise","fd_allocate","fd_close","fd_datasync","fd_fdstat_get","fd_fdstat_set_flags","fd_fdstat_set_rights","fd_filestat_get","fd_filestat_set_size","fd_filestat_set_times","fd_pread","fd_prestat_dir_name","fd_prestat_get","fd_pwrite","fd_read","fd_readdir","fd_renumber","fd_seek","fd_sync","fd_tell","fd_write","path_create_directory","path_filestat_get","path_filestat_set_times","path_link","path_open","path_readlink","path_remove_directory","path_rename","path_symlink","path_unlink_file","proc_exit","proc_raise","random_get","sched_yield"],"mod":["async_poll","async_socket"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/serialize/enum.IoState.html b/async_wasi/snapshots/serialize/enum.IoState.html new file mode 100644 index 000000000..f96ffc9cd --- /dev/null +++ b/async_wasi/snapshots/serialize/enum.IoState.html @@ -0,0 +1,27 @@ +IoState in async_wasi::snapshots::serialize - Rust
pub enum IoState {
+    Empty,
+    Accept {
+        bind: SocketAddr,
+    },
+    Sleep {
+        ddl: SystemTime,
+    },
+    Poll {
+        fds: Vec<PollFdState>,
+        ddl: Option<SystemTime>,
+    },
+}

Variants§

§

Empty

§

Accept

Fields

§

Sleep

Fields

§

Poll

Trait Implementations§

source§

impl Clone for IoState

source§

fn clone(&self) -> IoState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for IoState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for IoState

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for IoState

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/enum.PollFdState.html b/async_wasi/snapshots/serialize/enum.PollFdState.html new file mode 100644 index 000000000..69ba79107 --- /dev/null +++ b/async_wasi/snapshots/serialize/enum.PollFdState.html @@ -0,0 +1,40 @@ +PollFdState in async_wasi::snapshots::serialize - Rust
pub enum PollFdState {
+    UdpSocket {
+        fd: i32,
+        socket_type: SerialSocketType,
+        local_addr: Option<SocketAddr>,
+        peer_addr: Option<SocketAddr>,
+        poll_read: bool,
+        poll_write: bool,
+    },
+    TcpListener {
+        fd: i32,
+        socket_type: SerialSocketType,
+        local_addr: Option<SocketAddr>,
+        peer_addr: Option<SocketAddr>,
+        poll_read: bool,
+        poll_write: bool,
+    },
+    TcpStream {
+        fd: i32,
+        socket_type: SerialSocketType,
+        local_addr: Option<SocketAddr>,
+        peer_addr: Option<SocketAddr>,
+        poll_read: bool,
+        poll_write: bool,
+    },
+}

Variants§

§

UdpSocket

Fields

§fd: i32
§socket_type: SerialSocketType
§local_addr: Option<SocketAddr>
§peer_addr: Option<SocketAddr>
§poll_read: bool
§poll_write: bool
§

TcpListener

Fields

§fd: i32
§socket_type: SerialSocketType
§local_addr: Option<SocketAddr>
§peer_addr: Option<SocketAddr>
§poll_read: bool
§poll_write: bool
§

TcpStream

Fields

§fd: i32
§socket_type: SerialSocketType
§local_addr: Option<SocketAddr>
§peer_addr: Option<SocketAddr>
§poll_read: bool
§poll_write: bool

Trait Implementations§

source§

impl Clone for PollFdState

source§

fn clone(&self) -> PollFdState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PollFdState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for PollFdState

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for PollFdState

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/enum.SerialConnectState.html b/async_wasi/snapshots/serialize/enum.SerialConnectState.html new file mode 100644 index 000000000..35079ad48 --- /dev/null +++ b/async_wasi/snapshots/serialize/enum.SerialConnectState.html @@ -0,0 +1,20 @@ +SerialConnectState in async_wasi::snapshots::serialize - Rust
pub enum SerialConnectState {
+    Empty,
+    Listening,
+    Connected,
+    Connecting,
+}

Variants§

§

Empty

§

Listening

§

Connected

§

Connecting

Trait Implementations§

source§

impl Clone for SerialConnectState

source§

fn clone(&self) -> SerialConnectState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialConnectState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialConnectState

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ConnectState> for SerialConnectState

source§

fn from(s: ConnectState) -> Self

Converts to this type from the input type.
source§

impl From<SerialConnectState> for ConnectState

source§

fn from(val: SerialConnectState) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialConnectState

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for SerialConnectState

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/enum.SerialSocketType.html b/async_wasi/snapshots/serialize/enum.SerialSocketType.html new file mode 100644 index 000000000..f67c7aaf0 --- /dev/null +++ b/async_wasi/snapshots/serialize/enum.SerialSocketType.html @@ -0,0 +1,20 @@ +SerialSocketType in async_wasi::snapshots::serialize - Rust
pub enum SerialSocketType {
+    TCP4,
+    TCP6,
+    UDP4,
+    UDP6,
+}

Variants§

§

TCP4

§

TCP6

§

UDP4

§

UDP6

Trait Implementations§

source§

impl Clone for SerialSocketType

source§

fn clone(&self) -> SerialSocketType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialSocketType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialSocketType

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<(AddressFamily, SocketType)> for SerialSocketType

source§

fn from(sock_type: (AddressFamily, SocketType)) -> Self

Converts to this type from the input type.
source§

impl From<SerialSocketType> for (AddressFamily, SocketType)

source§

fn from(val: SerialSocketType) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialSocketType

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for SerialSocketType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/enum.SerialVFD.html b/async_wasi/snapshots/serialize/enum.SerialVFD.html new file mode 100644 index 000000000..c77321d04 --- /dev/null +++ b/async_wasi/snapshots/serialize/enum.SerialVFD.html @@ -0,0 +1,25 @@ +SerialVFD in async_wasi::snapshots::serialize - Rust
pub enum SerialVFD {
+    Stdin(SerialStdin),
+    Stdout(SerialStdout),
+    Stderr(SerialStderr),
+    PreOpenDir(SerialPreOpen),
+    WasiDir(SerialWasiDir),
+    WasiFile(SerialWasiFile),
+    Closed,
+    TcpServer(SerialTcpServer),
+    UdpSocket(SerialUdpSocket),
+}

Variants§

§

Stdin(SerialStdin)

§

Stdout(SerialStdout)

§

Stderr(SerialStderr)

§

PreOpenDir(SerialPreOpen)

§

WasiDir(SerialWasiDir)

§

WasiFile(SerialWasiFile)

§

Closed

§

TcpServer(SerialTcpServer)

§

UdpSocket(SerialUdpSocket)

Trait Implementations§

source§

impl Clone for SerialVFD

source§

fn clone(&self) -> SerialVFD

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialVFD

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialVFD

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&VFD> for SerialVFD

source§

fn from(vfd: &VFD) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialVFD

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/index.html b/async_wasi/snapshots/serialize/index.html new file mode 100644 index 000000000..42033e3fb --- /dev/null +++ b/async_wasi/snapshots/serialize/index.html @@ -0,0 +1 @@ +async_wasi::snapshots::serialize - Rust

Structs

Enums

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/sidebar-items.js b/async_wasi/snapshots/serialize/sidebar-items.js new file mode 100644 index 000000000..2f3538531 --- /dev/null +++ b/async_wasi/snapshots/serialize/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["IoState","PollFdState","SerialConnectState","SerialSocketType","SerialVFD"],"struct":["SerialPreOpen","SerialStderr","SerialStdin","SerialStdout","SerialTcpServer","SerialUdpSocket","SerialWasiCtx","SerialWasiDir","SerialWasiFile","SerialWasiSocketState"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialPreOpen.html b/async_wasi/snapshots/serialize/struct.SerialPreOpen.html new file mode 100644 index 000000000..2179c7408 --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialPreOpen.html @@ -0,0 +1,19 @@ +SerialPreOpen in async_wasi::snapshots::serialize - Rust
pub struct SerialPreOpen {
+    pub guest_path: String,
+    pub dir_rights: u64,
+    pub file_rights: u64,
+}

Fields§

§guest_path: String§dir_rights: u64§file_rights: u64

Implementations§

source§

impl SerialPreOpen

source

pub fn to_vfd(self, host_path: PathBuf) -> VFD

Trait Implementations§

source§

impl Clone for SerialPreOpen

source§

fn clone(&self) -> SerialPreOpen

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialPreOpen

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialPreOpen

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for SerialPreOpen

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialStderr.html b/async_wasi/snapshots/serialize/struct.SerialStderr.html new file mode 100644 index 000000000..e927c3c7a --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialStderr.html @@ -0,0 +1,15 @@ +SerialStderr in async_wasi::snapshots::serialize - Rust
pub struct SerialStderr;

Trait Implementations§

source§

impl Clone for SerialStderr

source§

fn clone(&self) -> SerialStderr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialStderr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialStderr

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<SerialStderr> for VFD

source§

fn from(_: SerialStderr) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialStderr

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialStdin.html b/async_wasi/snapshots/serialize/struct.SerialStdin.html new file mode 100644 index 000000000..ae66d3ddc --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialStdin.html @@ -0,0 +1,15 @@ +SerialStdin in async_wasi::snapshots::serialize - Rust
pub struct SerialStdin;

Trait Implementations§

source§

impl Clone for SerialStdin

source§

fn clone(&self) -> SerialStdin

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialStdin

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialStdin

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<SerialStdin> for VFD

source§

fn from(_: SerialStdin) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialStdin

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialStdout.html b/async_wasi/snapshots/serialize/struct.SerialStdout.html new file mode 100644 index 000000000..db846a20e --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialStdout.html @@ -0,0 +1,15 @@ +SerialStdout in async_wasi::snapshots::serialize - Rust
pub struct SerialStdout;

Trait Implementations§

source§

impl Clone for SerialStdout

source§

fn clone(&self) -> SerialStdout

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialStdout

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialStdout

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<SerialStdout> for VFD

source§

fn from(_: SerialStdout) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialStdout

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialTcpServer.html b/async_wasi/snapshots/serialize/struct.SerialTcpServer.html new file mode 100644 index 000000000..f1c65af5c --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialTcpServer.html @@ -0,0 +1,17 @@ +SerialTcpServer in async_wasi::snapshots::serialize - Rust
pub struct SerialTcpServer {
+    pub state: SerialWasiSocketState,
+}

Fields§

§state: SerialWasiSocketState

Implementations§

Trait Implementations§

source§

impl Clone for SerialTcpServer

source§

fn clone(&self) -> SerialTcpServer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialTcpServer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialTcpServer

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for SerialTcpServer

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialUdpSocket.html b/async_wasi/snapshots/serialize/struct.SerialUdpSocket.html new file mode 100644 index 000000000..c08f1f40f --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialUdpSocket.html @@ -0,0 +1,17 @@ +SerialUdpSocket in async_wasi::snapshots::serialize - Rust
pub struct SerialUdpSocket {
+    pub state: SerialWasiSocketState,
+}

Fields§

§state: SerialWasiSocketState

Implementations§

Trait Implementations§

source§

impl Clone for SerialUdpSocket

source§

fn clone(&self) -> SerialUdpSocket

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialUdpSocket

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialUdpSocket

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for SerialUdpSocket

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialWasiCtx.html b/async_wasi/snapshots/serialize/struct.SerialWasiCtx.html new file mode 100644 index 000000000..d2b8d7a50 --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialWasiCtx.html @@ -0,0 +1,22 @@ +SerialWasiCtx in async_wasi::snapshots::serialize - Rust
pub struct SerialWasiCtx {
+    pub args: Vec<String>,
+    pub envs: Vec<String>,
+    pub vfs: SerialObjectPool<SerialVFD>,
+    pub vfs_preopen_limit: usize,
+    pub io_state: IoState,
+    pub exit_code: u32,
+}

Fields§

§args: Vec<String>§envs: Vec<String>§vfs: SerialObjectPool<SerialVFD>§vfs_preopen_limit: usize§io_state: IoState§exit_code: u32

Implementations§

source§

impl SerialWasiCtx

source

pub fn resume(self, f: impl FnMut(SerialVFD) -> VFD) -> WasiCtx

Trait Implementations§

source§

impl Clone for SerialWasiCtx

source§

fn clone(&self) -> SerialWasiCtx

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialWasiCtx

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialWasiCtx

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&WasiCtx> for SerialWasiCtx

source§

fn from(ctx: &WasiCtx) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialWasiCtx

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialWasiDir.html b/async_wasi/snapshots/serialize/struct.SerialWasiDir.html new file mode 100644 index 000000000..4a9a71f86 --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialWasiDir.html @@ -0,0 +1,15 @@ +SerialWasiDir in async_wasi::snapshots::serialize - Rust
pub struct SerialWasiDir;

Trait Implementations§

source§

impl Clone for SerialWasiDir

source§

fn clone(&self) -> SerialWasiDir

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialWasiDir

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialWasiDir

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<SerialWasiDir> for VFD

source§

fn from(_: SerialWasiDir) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialWasiDir

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialWasiFile.html b/async_wasi/snapshots/serialize/struct.SerialWasiFile.html new file mode 100644 index 000000000..951dbe766 --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialWasiFile.html @@ -0,0 +1,15 @@ +SerialWasiFile in async_wasi::snapshots::serialize - Rust
pub struct SerialWasiFile;

Trait Implementations§

source§

impl Clone for SerialWasiFile

source§

fn clone(&self) -> SerialWasiFile

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialWasiFile

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialWasiFile

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<SerialWasiFile> for VFD

source§

fn from(_: SerialWasiFile) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialWasiFile

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/serialize/struct.SerialWasiSocketState.html b/async_wasi/snapshots/serialize/struct.SerialWasiSocketState.html new file mode 100644 index 000000000..dd011641e --- /dev/null +++ b/async_wasi/snapshots/serialize/struct.SerialWasiSocketState.html @@ -0,0 +1,29 @@ +SerialWasiSocketState in async_wasi::snapshots::serialize - Rust
pub struct SerialWasiSocketState {
Show 13 fields + pub sock_type: SerialSocketType, + pub local_addr: Option<SocketAddr>, + pub peer_addr: Option<SocketAddr>, + pub bind_device: Vec<u8>, + pub backlog: u32, + pub nonblocking: bool, + pub so_reuseaddr: bool, + pub so_conn_state: SerialConnectState, + pub so_recv_buf_size: usize, + pub so_send_buf_size: usize, + pub so_recv_timeout: Option<u64>, + pub so_send_timeout: Option<u64>, + pub fs_rights: u64, +
}

Fields§

§sock_type: SerialSocketType§local_addr: Option<SocketAddr>§peer_addr: Option<SocketAddr>§bind_device: Vec<u8>§backlog: u32§nonblocking: bool§so_reuseaddr: bool§so_conn_state: SerialConnectState§so_recv_buf_size: usize§so_send_buf_size: usize§so_recv_timeout: Option<u64>§so_send_timeout: Option<u64>§fs_rights: u64

Trait Implementations§

source§

impl Clone for SerialWasiSocketState

source§

fn clone(&self) -> SerialWasiSocketState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerialWasiSocketState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SerialWasiSocketState

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&SerialWasiSocketState> for WasiSocketState

source§

fn from(val: &SerialWasiSocketState) -> Self

Converts to this type from the input type.
source§

impl From<&WasiSocketState> for SerialWasiSocketState

source§

fn from(state: &WasiSocketState) -> Self

Converts to this type from the input type.
source§

impl From<SerialWasiSocketState> for WasiSocketState

source§

fn from(val: SerialWasiSocketState) -> Self

Converts to this type from the input type.
source§

impl Serialize for SerialWasiSocketState

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

\ No newline at end of file diff --git a/async_wasi/snapshots/sidebar-items.js b/async_wasi/snapshots/sidebar-items.js new file mode 100644 index 000000000..f84a665a4 --- /dev/null +++ b/async_wasi/snapshots/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["common","env","preview_1","serialize"],"struct":["WasiCtx"]}; \ No newline at end of file diff --git a/async_wasi/snapshots/struct.WasiCtx.html b/async_wasi/snapshots/struct.WasiCtx.html new file mode 100644 index 000000000..f2493fbe5 --- /dev/null +++ b/async_wasi/snapshots/struct.WasiCtx.html @@ -0,0 +1,22 @@ +WasiCtx in async_wasi::snapshots - Rust
pub struct WasiCtx {
+    pub args: Vec<String>,
+    pub io_state: IoState,
+    pub exit_code: u32,
+    /* private fields */
+}

Fields§

§args: Vec<String>§io_state: IoState§exit_code: u32

Implementations§

source§

impl WasiCtx

source

pub fn new() -> Self

source

pub fn push_preopen(&mut self, host_path: PathBuf, guest_path: PathBuf)

source

pub fn push_arg(&mut self, arg: String)

source

pub fn push_args(&mut self, args: Vec<String>)

source

pub fn push_env(&mut self, env: String)

The format of the env argument should be “KEY=VALUE”

+
source

pub fn push_envs(&mut self, envs: Vec<String>)

source

pub fn get_mut_vfd(&mut self, fd: __wasi_fd_t) -> Result<&mut VFD, Errno>

source

pub fn get_vfd(&self, fd: __wasi_fd_t) -> Result<&VFD, Errno>

source

pub fn insert_vfd(&mut self, vfd: VFD) -> Result<__wasi_fd_t, Errno>

source

pub fn remove_vfd(&mut self, fd: __wasi_fd_t) -> Result<(), Errno>

source

pub fn renumber_vfd( + &mut self, + from: __wasi_fd_t, + to: __wasi_fd_t +) -> Result<(), Errno>

Trait Implementations§

source§

impl Clone for WasiCtx

source§

fn clone(&self) -> WasiCtx

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiCtx

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for WasiCtx

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<&WasiCtx> for SerialWasiCtx

source§

fn from(ctx: &WasiCtx) -> Self

Converts to this type from the input type.
source§

impl Send for WasiCtx

source§

impl Sync for WasiCtx

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/crates.js b/crates.js new file mode 100644 index 000000000..d98c7e3e9 --- /dev/null +++ b/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["async_wasi","wasmedge_macro","wasmedge_sdk","wasmedge_sys","wasmedge_types"]; \ No newline at end of file diff --git a/help.html b/help.html new file mode 100644 index 000000000..af0288781 --- /dev/null +++ b/help.html @@ -0,0 +1 @@ +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/search-index.js b/search-index.js new file mode 100644 index 000000000..c8664b4ae --- /dev/null +++ b/search-index.js @@ -0,0 +1,9 @@ +var searchIndex = JSON.parse('{\ +"async_wasi":{"doc":"The async-wasi crate implements WASI spec for the …","t":"CAADDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDMLLLLALAMLLLLLLMLALLLLLLLALLLLAAAAAAFFDSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSLLLLLLLLLLLLLLLLLCIDLLLLLLLLKKKLLKKKLLLLLKENNENNNNNNNNNNENNENEDDEDNAMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLMMMLLMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLMMMDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLGGGGGGADDAADAGGDGADDAAGGADGGDAAGDGAAADDTAAAAAGAGGAAADDADDDDTGDGAMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGMMMMMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLLLLLLLLMMMGMMGRRRGRRRRRRGRRRRRRRGRRRRGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRGRGRRRGRRRRRGRRRRRRRRGRRRRGRGRRRRGRGRRRGRRGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRGRGRRGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRGRGRRRRRRRRRRRRRRRGRRRGRGRRRSNESSSSSSNSSSSSSSSSSSSSSDDDDDSNNDSSSSSSSSSSSSSSSSSSSSSNDDDSSSSSSSSSSSSSDNDNESSDSNLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNENNNNDDDDDDLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLNICNCNELLLLLLLLLLLLLLLCCKFFAAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAFFFFFFFFFFFFFFFENNNDDMMMMMMMMMLLLLLLLLLLLLMLLLLLLLLLMMFLLLLLLLLLLLLNNNNNNENNENEDEDDDDDEDDDDNNNNNNNNNNNNNNNMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLLLLLLMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMM","n":["WasiCtx","object_pool","snapshots","ObjectNode","ObjectPool","SerialObjectPool","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cleanup_stores","clone","clone","clone","clone_into","clone_into","clone_into","default","default","deserialize","fmt","fmt","fmt","from","from","from","from","from_ref","get","get_mut","into","into","into","into","iter","iter_mut","new","push","remove","serialize","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","WasiCtx","args","borrow","borrow_mut","clone","clone_into","common","default","env","exit_code","fmt","from","get_mut_vfd","get_vfd","insert_vfd","into","io_state","new","preview_1","push_arg","push_args","push_env","push_envs","push_preopen","remove_vfd","renumber_vfd","serialize","to_owned","try_from","try_into","type_id","clock","error","memory","net","types","vfs","wasi_clock_res_get","wasi_clock_time_get","Errno","__WASI_ERRNO_2BIG","__WASI_ERRNO_ACCES","__WASI_ERRNO_ADDRINUSE","__WASI_ERRNO_ADDRNOTAVAIL","__WASI_ERRNO_AFNOSUPPORT","__WASI_ERRNO_AGAIN","__WASI_ERRNO_AIADDRFAMILY","__WASI_ERRNO_AIAGAIN","__WASI_ERRNO_AIBADFLAG","__WASI_ERRNO_AIFAIL","__WASI_ERRNO_AIFAMILY","__WASI_ERRNO_AIMEMORY","__WASI_ERRNO_AINODATA","__WASI_ERRNO_AINONAME","__WASI_ERRNO_AISERVICE","__WASI_ERRNO_AISOCKTYPE","__WASI_ERRNO_AISYSTEM","__WASI_ERRNO_ALREADY","__WASI_ERRNO_BADF","__WASI_ERRNO_BADMSG","__WASI_ERRNO_BUSY","__WASI_ERRNO_CANCELED","__WASI_ERRNO_CHILD","__WASI_ERRNO_CONNABORTED","__WASI_ERRNO_CONNREFUSED","__WASI_ERRNO_CONNRESET","__WASI_ERRNO_DEADLK","__WASI_ERRNO_DESTADDRREQ","__WASI_ERRNO_DOM","__WASI_ERRNO_DQUOT","__WASI_ERRNO_EXIST","__WASI_ERRNO_FAULT","__WASI_ERRNO_FBIG","__WASI_ERRNO_HOSTUNREACH","__WASI_ERRNO_IDRM","__WASI_ERRNO_ILSEQ","__WASI_ERRNO_INPROGRESS","__WASI_ERRNO_INTR","__WASI_ERRNO_INVAL","__WASI_ERRNO_IO","__WASI_ERRNO_ISCONN","__WASI_ERRNO_ISDIR","__WASI_ERRNO_LOOP","__WASI_ERRNO_MFILE","__WASI_ERRNO_MLINK","__WASI_ERRNO_MSGSIZE","__WASI_ERRNO_MULTIHOP","__WASI_ERRNO_NAMETOOLONG","__WASI_ERRNO_NETDOWN","__WASI_ERRNO_NETRESET","__WASI_ERRNO_NETUNREACH","__WASI_ERRNO_NFILE","__WASI_ERRNO_NOBUFS","__WASI_ERRNO_NODEV","__WASI_ERRNO_NOENT","__WASI_ERRNO_NOEXEC","__WASI_ERRNO_NOLCK","__WASI_ERRNO_NOLINK","__WASI_ERRNO_NOMEM","__WASI_ERRNO_NOMSG","__WASI_ERRNO_NOPROTOOPT","__WASI_ERRNO_NOSPC","__WASI_ERRNO_NOSYS","__WASI_ERRNO_NOTCAPABLE","__WASI_ERRNO_NOTCONN","__WASI_ERRNO_NOTDIR","__WASI_ERRNO_NOTEMPTY","__WASI_ERRNO_NOTRECOVERABLE","__WASI_ERRNO_NOTSOCK","__WASI_ERRNO_NOTSUP","__WASI_ERRNO_NOTTY","__WASI_ERRNO_NXIO","__WASI_ERRNO_OVERFLOW","__WASI_ERRNO_OWNERDEAD","__WASI_ERRNO_PERM","__WASI_ERRNO_PIPE","__WASI_ERRNO_PROTO","__WASI_ERRNO_PROTONOSUPPORT","__WASI_ERRNO_PROTOTYPE","__WASI_ERRNO_RANGE","__WASI_ERRNO_ROFS","__WASI_ERRNO_SPIPE","__WASI_ERRNO_SRCH","__WASI_ERRNO_STALE","__WASI_ERRNO_SUCCESS","__WASI_ERRNO_TIMEDOUT","__WASI_ERRNO_TXTBSY","__WASI_ERRNO_XDEV","borrow","borrow_mut","clone","clone_into","default","eq","fmt","from","from","from","from","from","into","to_owned","try_from","try_into","type_id","wasi_errno","Memory","WasmPtr","add","borrow","borrow_mut","clone","clone_into","fmt","from","from","get_data","get_iovec","get_slice","into","is_null","mut_data","mut_iovec","mut_slice","sub","to_owned","try_from","try_into","type_id","write_data","AddressFamily","Both","ClockAndFd","ConnectState","Connected","Connecting","Datagram","Empty","FD","Inet4","Inet6","Listening","OnlyClock","OnlyFd","PrePoll","Read","RealClock","SocketType","Stream","Subscription","SubscriptionClock","SubscriptionFd","SubscriptionFdType","WasiSocketState","Write","async_tokio","backlog","bind_device","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","default","eq","err","fd","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from_wasi_subscription","fs_rights","into","into","into","into","into","into","into","into","into","local_addr","nonblocking","peer_addr","set_read","set_write","shutdown","so_conn_state","so_recv_buf_size","so_recv_timeout","so_reuseaddr","so_send_buf_size","so_send_timeout","sock_type","timeout","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","userdata","read","write","AsyncWasiSocket","accept","bind","bind_device","borrow","borrow_mut","connect","device","fd_fdstat_get","fmt","from","from_tcplistener","from_udpsocket","get_local","get_nonblocking","get_peer","get_so_accept_conn","get_so_error","get_so_recv_buf_size","get_so_recv_timeout","get_so_reuseaddr","get_so_send_buf_size","get_so_send_timeout","get_so_type","into","listen","open","recv","recv_from","send","send_to","set_nonblocking","set_so_recv_buf_size","set_so_recv_timeout","set_so_reuseaddr","set_so_send_buf_size","set_so_send_timeout","shutdown","state","sync_conn_state","try_from","try_into","type_id","__int32_t","__int64_t","__uint16_t","__uint32_t","__uint64_t","__uint8_t","__wasi_address_family_t","__wasi_address_t","__wasi_addrinfo_t","__wasi_advice_t","__wasi_aiflags_t","__wasi_ciovec_t","__wasi_clockid_t","__wasi_device_t","__wasi_dircookie_t","__wasi_dirent_t","__wasi_dirnamlen_t","__wasi_errno_t","__wasi_event_fd_readwrite_t","__wasi_event_t","__wasi_eventrwflags_t","__wasi_eventtype_t","__wasi_exitcode_t","__wasi_fd_t","__wasi_fdflags_t","__wasi_fdstat_t","__wasi_filedelta_t","__wasi_filesize_t","__wasi_filestat_t","__wasi_filetype_t","__wasi_fstflags_t","__wasi_inode_t","__wasi_iovec_t","__wasi_linkcount_t","__wasi_lookupflags_t","__wasi_oflags_t","__wasi_preopentype_t","__wasi_prestat_dir_t","__wasi_prestat_t","__wasi_prestat_u_t","__wasi_protocol_t","__wasi_riflags_t","__wasi_rights_t","__wasi_roflags_t","__wasi_sdflags_t","__wasi_siflags_t","__wasi_signal_t","__wasi_size_t","__wasi_sock_d_t","__wasi_sock_opt_level_t","__wasi_sock_opt_so_t","__wasi_sock_type_t","__wasi_sockaddr_in_t","__wasi_sockaddr_t","__wasi_subclockflags_t","__wasi_subscription_clock_t","__wasi_subscription_fd_readwrite_t","__wasi_subscription_t","__wasi_subscription_u_t","__wasi_subscription_u_u_t","__wasi_timestamp_t","__wasi_timeval","__wasi_userdata_t","__wasi_whence_t","ai_addr","ai_addrlen","ai_canonname","ai_canonname_len","ai_family","ai_flags","ai_next","ai_protocol","ai_socktype","atim","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","buf","buf","buf","buf_len","buf_len","buf_len","clock","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","const_uint8_t_ptr","ctim","d_ino","d_namlen","d_next","d_type","dev","dir","error","fd_read","fd_readwrite","fd_write","file_descriptor","filetype","flags","flags","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","fs_filetype","fs_flags","fs_rights_base","fs_rights_inheriting","id","ino","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","mtim","nbytes","nlink","pr_name_len","precision","sa_data","sa_data_len","sa_family","sin_addr","sin_family","sin_port","sin_zero","sin_zero_len","size","tag","tag","timeout","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tv_sec","tv_usec","type_","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","u","u","u","uint8_t_ptr","userdata","userdata","Type","__WASI_ADDRESS_FAMILY_INET4","__WASI_ADDRESS_FAMILY_INET6","__WASI_ADDRESS_FAMILY_UNSPEC","Type","__WASI_ADVICE_DONTNEED","__WASI_ADVICE_NOREUSE","__WASI_ADVICE_NORMAL","__WASI_ADVICE_RANDOM","__WASI_ADVICE_SEQUENTIAL","__WASI_ADVICE_WILLNEED","Type","__WASI_AIFLAGS_AI_ADDRCONFIG","__WASI_AIFLAGS_AI_ALL","__WASI_AIFLAGS_AI_CANONNAME","__WASI_AIFLAGS_AI_NUMERICHOST","__WASI_AIFLAGS_AI_NUMERICSERV","__WASI_AIFLAGS_AI_PASSIVE","__WASI_AIFLAGS_AI_V4MAPPED","Type","__WASI_CLOCKID_MONOTONIC","__WASI_CLOCKID_PROCESS_CPUTIME_ID","__WASI_CLOCKID_REALTIME","__WASI_CLOCKID_THREAD_CPUTIME_ID","Type","__WASI_ERRNO_2BIG","__WASI_ERRNO_ACCES","__WASI_ERRNO_ADDRINUSE","__WASI_ERRNO_ADDRNOTAVAIL","__WASI_ERRNO_AFNOSUPPORT","__WASI_ERRNO_AGAIN","__WASI_ERRNO_AIADDRFAMILY","__WASI_ERRNO_AIAGAIN","__WASI_ERRNO_AIBADFLAG","__WASI_ERRNO_AIFAIL","__WASI_ERRNO_AIFAMILY","__WASI_ERRNO_AIMEMORY","__WASI_ERRNO_AINODATA","__WASI_ERRNO_AINONAME","__WASI_ERRNO_AISERVICE","__WASI_ERRNO_AISOCKTYPE","__WASI_ERRNO_AISYSTEM","__WASI_ERRNO_ALREADY","__WASI_ERRNO_BADF","__WASI_ERRNO_BADMSG","__WASI_ERRNO_BUSY","__WASI_ERRNO_CANCELED","__WASI_ERRNO_CHILD","__WASI_ERRNO_CONNABORTED","__WASI_ERRNO_CONNREFUSED","__WASI_ERRNO_CONNRESET","__WASI_ERRNO_DEADLK","__WASI_ERRNO_DESTADDRREQ","__WASI_ERRNO_DOM","__WASI_ERRNO_DQUOT","__WASI_ERRNO_EXIST","__WASI_ERRNO_FAULT","__WASI_ERRNO_FBIG","__WASI_ERRNO_HOSTUNREACH","__WASI_ERRNO_IDRM","__WASI_ERRNO_ILSEQ","__WASI_ERRNO_INPROGRESS","__WASI_ERRNO_INTR","__WASI_ERRNO_INVAL","__WASI_ERRNO_IO","__WASI_ERRNO_ISCONN","__WASI_ERRNO_ISDIR","__WASI_ERRNO_LOOP","__WASI_ERRNO_MFILE","__WASI_ERRNO_MLINK","__WASI_ERRNO_MSGSIZE","__WASI_ERRNO_MULTIHOP","__WASI_ERRNO_NAMETOOLONG","__WASI_ERRNO_NETDOWN","__WASI_ERRNO_NETRESET","__WASI_ERRNO_NETUNREACH","__WASI_ERRNO_NFILE","__WASI_ERRNO_NOBUFS","__WASI_ERRNO_NODEV","__WASI_ERRNO_NOENT","__WASI_ERRNO_NOEXEC","__WASI_ERRNO_NOLCK","__WASI_ERRNO_NOLINK","__WASI_ERRNO_NOMEM","__WASI_ERRNO_NOMSG","__WASI_ERRNO_NOPROTOOPT","__WASI_ERRNO_NOSPC","__WASI_ERRNO_NOSYS","__WASI_ERRNO_NOTCAPABLE","__WASI_ERRNO_NOTCONN","__WASI_ERRNO_NOTDIR","__WASI_ERRNO_NOTEMPTY","__WASI_ERRNO_NOTRECOVERABLE","__WASI_ERRNO_NOTSOCK","__WASI_ERRNO_NOTSUP","__WASI_ERRNO_NOTTY","__WASI_ERRNO_NXIO","__WASI_ERRNO_OVERFLOW","__WASI_ERRNO_OWNERDEAD","__WASI_ERRNO_PERM","__WASI_ERRNO_PIPE","__WASI_ERRNO_PROTO","__WASI_ERRNO_PROTONOSUPPORT","__WASI_ERRNO_PROTOTYPE","__WASI_ERRNO_RANGE","__WASI_ERRNO_ROFS","__WASI_ERRNO_SPIPE","__WASI_ERRNO_SRCH","__WASI_ERRNO_STALE","__WASI_ERRNO_SUCCESS","__WASI_ERRNO_TIMEDOUT","__WASI_ERRNO_TXTBSY","__WASI_ERRNO_XDEV","Type","__WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP","Type","__WASI_EVENTTYPE_CLOCK","__WASI_EVENTTYPE_FD_READ","__WASI_EVENTTYPE_FD_WRITE","Type","__WASI_FDFLAGS_APPEND","__WASI_FDFLAGS_DSYNC","__WASI_FDFLAGS_NONBLOCK","__WASI_FDFLAGS_RSYNC","__WASI_FDFLAGS_SYNC","Type","__WASI_FILETYPE_BLOCK_DEVICE","__WASI_FILETYPE_CHARACTER_DEVICE","__WASI_FILETYPE_DIRECTORY","__WASI_FILETYPE_REGULAR_FILE","__WASI_FILETYPE_SOCKET_DGRAM","__WASI_FILETYPE_SOCKET_STREAM","__WASI_FILETYPE_SYMBOLIC_LINK","__WASI_FILETYPE_UNKNOWN","Type","__WASI_FSTFLAGS_ATIM","__WASI_FSTFLAGS_ATIM_NOW","__WASI_FSTFLAGS_MTIM","__WASI_FSTFLAGS_MTIM_NOW","Type","__WASI_LOOKUPFLAGS_SYMLINK_FOLLOW","Type","__WASI_OFLAGS_CREAT","__WASI_OFLAGS_DIRECTORY","__WASI_OFLAGS_EXCL","__WASI_OFLAGS_TRUNC","Type","__WASI_PREOPENTYPE_DIR","Type","__WASI_PROTOCOL_IPPROTO_IP","__WASI_PROTOCOL_IPPROTO_TCP","__WASI_PROTOCOL_IPPROTO_UDP","Type","__WASI_RIFLAGS_RECV_PEEK","__WASI_RIFLAGS_RECV_WAITALL","Type","__WASI_RIGHTS_FD_ADVISE","__WASI_RIGHTS_FD_ALLOCATE","__WASI_RIGHTS_FD_DATASYNC","__WASI_RIGHTS_FD_FDSTAT_SET_FLAGS","__WASI_RIGHTS_FD_FILESTAT_GET","__WASI_RIGHTS_FD_FILESTAT_SET_SIZE","__WASI_RIGHTS_FD_FILESTAT_SET_TIMES","__WASI_RIGHTS_FD_READ","__WASI_RIGHTS_FD_READDIR","__WASI_RIGHTS_FD_SEEK","__WASI_RIGHTS_FD_SYNC","__WASI_RIGHTS_FD_TELL","__WASI_RIGHTS_FD_WRITE","__WASI_RIGHTS_PATH_CREATE_DIRECTORY","__WASI_RIGHTS_PATH_CREATE_FILE","__WASI_RIGHTS_PATH_FILESTAT_GET","__WASI_RIGHTS_PATH_FILESTAT_SET_SIZE","__WASI_RIGHTS_PATH_FILESTAT_SET_TIMES","__WASI_RIGHTS_PATH_LINK_SOURCE","__WASI_RIGHTS_PATH_LINK_TARGET","__WASI_RIGHTS_PATH_OPEN","__WASI_RIGHTS_PATH_READLINK","__WASI_RIGHTS_PATH_REMOVE_DIRECTORY","__WASI_RIGHTS_PATH_RENAME_SOURCE","__WASI_RIGHTS_PATH_RENAME_TARGET","__WASI_RIGHTS_PATH_SYMLINK","__WASI_RIGHTS_PATH_UNLINK_FILE","__WASI_RIGHTS_POLL_FD_READWRITE","__WASI_RIGHTS_SOCK_BIND","__WASI_RIGHTS_SOCK_CLOSE","__WASI_RIGHTS_SOCK_OPEN","__WASI_RIGHTS_SOCK_RECV","__WASI_RIGHTS_SOCK_RECV_FROM","__WASI_RIGHTS_SOCK_SEND","__WASI_RIGHTS_SOCK_SEND_TO","__WASI_RIGHTS_SOCK_SHUTDOWN","Type","__WASI_ROFLAGS_RECV_DATA_TRUNCATED","Type","__WASI_SDFLAGS_RD","__WASI_SDFLAGS_WR","Type","__WASI_SIGNAL_ABRT","__WASI_SIGNAL_ALRM","__WASI_SIGNAL_BUS","__WASI_SIGNAL_CHLD","__WASI_SIGNAL_CONT","__WASI_SIGNAL_FPE","__WASI_SIGNAL_HUP","__WASI_SIGNAL_ILL","__WASI_SIGNAL_INT","__WASI_SIGNAL_KILL","__WASI_SIGNAL_NONE","__WASI_SIGNAL_PIPE","__WASI_SIGNAL_POLL","__WASI_SIGNAL_PROF","__WASI_SIGNAL_PWR","__WASI_SIGNAL_QUIT","__WASI_SIGNAL_SEGV","__WASI_SIGNAL_STOP","__WASI_SIGNAL_SYS","__WASI_SIGNAL_TERM","__WASI_SIGNAL_TRAP","__WASI_SIGNAL_TSTP","__WASI_SIGNAL_TTIN","__WASI_SIGNAL_TTOU","__WASI_SIGNAL_URG","__WASI_SIGNAL_USR1","__WASI_SIGNAL_USR2","__WASI_SIGNAL_VTALRM","__WASI_SIGNAL_WINCH","__WASI_SIGNAL_XCPU","__WASI_SIGNAL_XFSZ","Type","__WASI_SOCK_OPT_LEVEL_SOL_SOCKET","Type","__WASI_SOCK_OPT_SO_ACCEPTCONN","__WASI_SOCK_OPT_SO_BINDTODEVICE","__WASI_SOCK_OPT_SO_BROADCAST","__WASI_SOCK_OPT_SO_DONTROUTE","__WASI_SOCK_OPT_SO_ERROR","__WASI_SOCK_OPT_SO_KEEPALIVE","__WASI_SOCK_OPT_SO_LINGER","__WASI_SOCK_OPT_SO_OOBINLINE","__WASI_SOCK_OPT_SO_RCVBUF","__WASI_SOCK_OPT_SO_RCVLOWAT","__WASI_SOCK_OPT_SO_RCVTIMEO","__WASI_SOCK_OPT_SO_REUSEADDR","__WASI_SOCK_OPT_SO_SNDBUF","__WASI_SOCK_OPT_SO_SNDTIMEO","__WASI_SOCK_OPT_SO_TYPE","Type","__WASI_SOCK_TYPE_SOCK_ANY","__WASI_SOCK_TYPE_SOCK_DGRAM","__WASI_SOCK_TYPE_SOCK_STREAM","Type","__WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME","Type","__WASI_WHENCE_CUR","__WASI_WHENCE_END","__WASI_WHENCE_SET","APPEND","Absolute","Advice","BLOCK_DEVICE","CHARACTER_DEVICE","CREATE","DIRECTORY","DIRECTORY","DSYNC","DontNeed","EXCLUSIVE","FD_ADVISE","FD_ALLOCATE","FD_DATASYNC","FD_FDSTAT_SET_FLAGS","FD_FILESTAT_GET","FD_FILESTAT_SET_SIZE","FD_FILESTAT_SET_TIMES","FD_READ","FD_READDIR","FD_SEEK","FD_SYNC","FD_TELL","FD_WRITE","FdFlags","FdStat","FileType","Filestat","Lookupflags","NONBLOCK","NoReuse","Normal","OFlags","PATH_CREATE_DIRECTORY","PATH_CREATE_FILE","PATH_FILESTAT_GET","PATH_FILESTAT_SET_SIZE","PATH_FILESTAT_SET_TIMES","PATH_LINK_SOURCE","PATH_LINK_TARGET","PATH_OPEN","PATH_READLINK","PATH_REMOVE_DIRECTORY","PATH_RENAME_SOURCE","PATH_RENAME_TARGET","PATH_SYMLINK","PATH_UNLINK_FILE","POLL_FD_READWRITE","RD","RECV_DATA_TRUNCATED","RECV_PEEK","RECV_WAITALL","REGULAR_FILE","RSYNC","Random","ReaddirEntity","RiFlags","RoFlags","SOCKET_DGRAM","SOCKET_STREAM","SOCK_BIND","SOCK_CLOSE","SOCK_OPEN","SOCK_RECV","SOCK_RECV_FROM","SOCK_SEND","SOCK_SEND_TO","SOCK_SHUTDOWN","SYMBOLIC_LINK","SYMLINK_FOLLOW","SYNC","SdFlags","Sequential","SiFlags","SymbolicNow","SystemTimeSpec","TRUNCATE","UNKNOWN","WASIRights","WR","WillNeed","all","all","all","all","all","all","all","all","atim","bitand","bitand","bitand","bitand","bitand","bitand","bitand","bitand","bitand_assign","bitand_assign","bitand_assign","bitand_assign","bitand_assign","bitand_assign","bitand_assign","bitand_assign","bitor","bitor","bitor","bitor","bitor","bitor","bitor","bitor","bitor_assign","bitor_assign","bitor_assign","bitor_assign","bitor_assign","bitor_assign","bitor_assign","bitor_assign","bits","bits","bits","bits","bits","bits","bits","bits","bits","bits","bits","bits","bits","bits","bits","bits","bitxor","bitxor","bitxor","bitxor","bitxor","bitxor","bitxor","bitxor","bitxor_assign","bitxor_assign","bitxor_assign","bitxor_assign","bitxor_assign","bitxor_assign","bitxor_assign","bitxor_assign","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","can","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","complement","complement","complement","complement","complement","complement","complement","complement","contains","contains","contains","contains","contains","contains","contains","contains","ctim","default","difference","difference","difference","difference","difference","difference","difference","difference","dir_all","empty","empty","empty","empty","empty","empty","empty","empty","eq","eq","eq","extend","extend","extend","extend","extend","extend","extend","extend","fd_all","filetype","filetype","filetype","flags","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_bits","from_bits","from_bits","from_bits","from_bits","from_bits","from_bits","from_bits","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_truncate","from_bits_truncate","from_bits_truncate","from_bits_truncate","from_bits_truncate","from_bits_truncate","from_bits_truncate","from_bits_truncate","from_iter","from_iter","from_iter","from_iter","from_iter","from_iter","from_iter","from_iter","from_name","from_name","from_name","from_name","from_name","from_name","from_name","from_name","fs_rights_base","fs_rights_inheriting","inode","inode","insert","insert","insert","insert","insert","insert","insert","insert","intersection","intersection","intersection","intersection","intersection","intersection","intersection","intersection","intersects","intersects","intersects","intersects","intersects","intersects","intersects","intersects","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","is_all","is_all","is_all","is_all","is_all","is_all","is_all","is_all","is_empty","is_empty","is_empty","is_empty","is_empty","is_empty","is_empty","is_empty","iter","iter","iter","iter","iter","iter","iter","iter","iter_names","iter_names","iter_names","iter_names","iter_names","iter_names","iter_names","iter_names","mtim","name","next","nlink","not","not","not","not","not","not","not","not","remove","remove","remove","remove","remove","remove","remove","remove","set","set","set","set","set","set","set","set","size","sub","sub","sub","sub","sub","sub","sub","sub","sub_assign","sub_assign","sub_assign","sub_assign","sub_assign","sub_assign","sub_assign","sub_assign","symmetric_difference","symmetric_difference","symmetric_difference","symmetric_difference","symmetric_difference","symmetric_difference","symmetric_difference","symmetric_difference","sync","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","toggle","toggle","toggle","toggle","toggle","toggle","toggle","toggle","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","union","union","union","union","union","union","union","union","Dir","File","INode","PreOpenDir","Stderr","Stdin","Stdout","WasiDir","WasiFile","WasiPreOpenDir","WasiStderr","WasiStdin","WasiStdout","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","deref","deref_mut","dir_rights","fd","fd_advise","fd_advise","fd_advise","fd_advise","fd_allocate","fd_allocate","fd_allocate","fd_allocate","fd_datasync","fd_datasync","fd_datasync","fd_datasync","fd_fdstat_get","fd_fdstat_get","fd_fdstat_get","fd_fdstat_get","fd_fdstat_get","fd_fdstat_set_flags","fd_fdstat_set_flags","fd_fdstat_set_flags","fd_fdstat_set_flags","fd_fdstat_set_rights","fd_fdstat_set_rights","fd_fdstat_set_rights","fd_fdstat_set_rights","fd_fdstat_set_rights","fd_filestat_get","fd_filestat_get","fd_filestat_get","fd_filestat_get","fd_filestat_get","fd_filestat_set_size","fd_filestat_set_size","fd_filestat_set_size","fd_filestat_set_size","fd_filestat_set_times","fd_filestat_set_times","fd_filestat_set_times","fd_filestat_set_times","fd_filestat_set_times","fd_pread","fd_pread","fd_pread","fd_pread","fd_pwrite","fd_pwrite","fd_pwrite","fd_pwrite","fd_read","fd_read","fd_read","fd_read","fd_readdir","fd_seek","fd_seek","fd_seek","fd_seek","fd_sync","fd_sync","fd_sync","fd_sync","fd_tell","fd_tell","fd_tell","fd_tell","fd_write","fd_write","fd_write","fd_write","file_rights","flags","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","get_absolutize_path","guest_path","into","into","into","into","into","into","into","new","path_create_directory","path_filestat_get","path_open_dir","path_open_file","path_remove_directory","path_unlink_file","real_path","right","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","AsyncSocket","AsyncVM","AsyncWasiSocket","Closed","Errno","Inode","VFD","borrow","borrow_mut","fmt","from","from","from","from","from","from","into","is_inode","is_socket","try_from","try_into","type_id","vfs","wasi_types","yield_now","args_get","args_sizes_get","async_poll","async_socket","clock_res_get","clock_time_get","environ_get","environ_sizes_get","fd_advise","fd_allocate","fd_close","fd_datasync","fd_fdstat_get","fd_fdstat_set_flags","fd_fdstat_set_rights","fd_filestat_get","fd_filestat_set_size","fd_filestat_set_times","fd_pread","fd_prestat_dir_name","fd_prestat_get","fd_pwrite","fd_read","fd_readdir","fd_renumber","fd_seek","fd_sync","fd_tell","fd_write","path_create_directory","path_filestat_get","path_filestat_set_times","path_link","path_open","path_readlink","path_remove_directory","path_rename","path_symlink","path_unlink_file","proc_exit","proc_raise","random_get","sched_yield","poll_oneoff","addrinfo","sock_accept","sock_bind","sock_connect","sock_getlocaladdr","sock_getpeeraddr","sock_getsockopt","sock_listen","sock_lookup_ip","sock_open","sock_recv","sock_recv_from","sock_send","sock_send_to","sock_setsockopt","sock_shutdown","AddressFamily","Inet4","Inet6","Unspec","WasiAddrinfo","WasiSockaddr","ai_addr","ai_addrlen","ai_canonname","ai_canonnamelen","ai_family","ai_flags","ai_next","ai_protocol","ai_socktype","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","family","fmt","fmt","fmt","from","from","from","into","into","into","sa_data","sa_data_len","sock_getaddrinfo","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","Accept","Closed","Connected","Connecting","Empty","Empty","IoState","Listening","Poll","PollFdState","PreOpenDir","SerialConnectState","SerialPreOpen","SerialSocketType","SerialStderr","SerialStdin","SerialStdout","SerialTcpServer","SerialUdpSocket","SerialVFD","SerialWasiCtx","SerialWasiDir","SerialWasiFile","SerialWasiSocketState","Sleep","Stderr","Stdin","Stdout","TCP4","TCP6","TcpListener","TcpServer","TcpStream","UDP4","UDP6","UdpSocket","UdpSocket","WasiDir","WasiFile","args","backlog","bind_device","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default_to_async_socket","default_to_async_socket","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","dir_rights","envs","exit_code","file_rights","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","fs_rights","guest_path","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","io_state","local_addr","nonblocking","peer_addr","resume","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","serialize","so_conn_state","so_recv_buf_size","so_recv_timeout","so_reuseaddr","so_send_buf_size","so_send_timeout","sock_type","state","state","to_async_socket_with_std","to_async_socket_with_std","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_vfd","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vfs","vfs_preopen_limit","bind","ddl","ddl","fds","fd","fd","fd","local_addr","local_addr","local_addr","peer_addr","peer_addr","peer_addr","poll_read","poll_read","poll_read","poll_write","poll_write","poll_write","socket_type","socket_type","socket_type"],"q":[[0,"async_wasi"],[3,"async_wasi::object_pool"],[54,"async_wasi::snapshots"],[85,"async_wasi::snapshots::common"],[91,"async_wasi::snapshots::common::clock"],[93,"async_wasi::snapshots::common::error"],[200,"async_wasi::snapshots::common::memory"],[224,"async_wasi::snapshots::common::net"],[376,"async_wasi::snapshots::common::net::SubscriptionFdType"],[378,"async_wasi::snapshots::common::net::async_tokio"],[421,"async_wasi::snapshots::common::types"],[773,"async_wasi::snapshots::common::types::__wasi_address_family_t"],[777,"async_wasi::snapshots::common::types::__wasi_advice_t"],[784,"async_wasi::snapshots::common::types::__wasi_aiflags_t"],[792,"async_wasi::snapshots::common::types::__wasi_clockid_t"],[797,"async_wasi::snapshots::common::types::__wasi_errno_t"],[886,"async_wasi::snapshots::common::types::__wasi_eventrwflags_t"],[888,"async_wasi::snapshots::common::types::__wasi_eventtype_t"],[892,"async_wasi::snapshots::common::types::__wasi_fdflags_t"],[898,"async_wasi::snapshots::common::types::__wasi_filetype_t"],[907,"async_wasi::snapshots::common::types::__wasi_fstflags_t"],[912,"async_wasi::snapshots::common::types::__wasi_lookupflags_t"],[914,"async_wasi::snapshots::common::types::__wasi_oflags_t"],[919,"async_wasi::snapshots::common::types::__wasi_preopentype_t"],[921,"async_wasi::snapshots::common::types::__wasi_protocol_t"],[925,"async_wasi::snapshots::common::types::__wasi_riflags_t"],[928,"async_wasi::snapshots::common::types::__wasi_rights_t"],[965,"async_wasi::snapshots::common::types::__wasi_roflags_t"],[967,"async_wasi::snapshots::common::types::__wasi_sdflags_t"],[970,"async_wasi::snapshots::common::types::__wasi_signal_t"],[1002,"async_wasi::snapshots::common::types::__wasi_sock_opt_level_t"],[1004,"async_wasi::snapshots::common::types::__wasi_sock_opt_so_t"],[1020,"async_wasi::snapshots::common::types::__wasi_sock_type_t"],[1024,"async_wasi::snapshots::common::types::__wasi_subclockflags_t"],[1026,"async_wasi::snapshots::common::types::__wasi_whence_t"],[1030,"async_wasi::snapshots::common::vfs"],[1576,"async_wasi::snapshots::common::vfs::sync"],[1731,"async_wasi::snapshots::env"],[1756,"async_wasi::snapshots::preview_1"],[1799,"async_wasi::snapshots::preview_1::async_poll"],[1800,"async_wasi::snapshots::preview_1::async_socket"],[1816,"async_wasi::snapshots::preview_1::async_socket::addrinfo"],[1868,"async_wasi::snapshots::serialize"],[2137,"async_wasi::snapshots::serialize::IoState"],[2141,"async_wasi::snapshots::serialize::PollFdState"],[2159,"core::clone"],[2160,"core::result"],[2161,"serde::de"],[2162,"serde::de"],[2163,"core::fmt"],[2164,"core::option"],[2165,"core::iter::traits::iterator"],[2166,"serde::ser"],[2167,"serde::ser"],[2168,"alloc::string"],[2169,"alloc::vec"],[2170,"std::path"],[2171,"std::io::error"],[2172,"std::io::error"],[2173,"std::io"],[2174,"std::io"],[2175,"std::net::tcp"],[2176,"std::net::udp"],[2177,"core::time"],[2178,"libc::unix"],[2179,"std::net"],[2180,"core::iter::traits::collect"],[2181,"bitflags::iter"],[2182,"bitflags::iter"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Calls U::from(self).","Calls U::from(self).","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","Calls U::from(self).","","","","","","The format of the env argument should be “KEY=VALUE”","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","Calls U::from(self).","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","","","","","","","","","","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get a flags value with all known bits set.","Get a flags value with all known bits set.","Get a flags value with all known bits set.","Get a flags value with all known bits set.","Get a flags value with all known bits set.","Get a flags value with all known bits set.","Get a flags value with all known bits set.","Get a flags value with all known bits set.","","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","","Get the underlying bits value.","Get the underlying bits value.","","","Get the underlying bits value.","","Get the underlying bits value.","","Get the underlying bits value.","Get the underlying bits value.","","Get the underlying bits value.","","","Get the underlying bits value.","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","","","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","","Get a flags value with all bits unset.","Get a flags value with all bits unset.","Get a flags value with all bits unset.","Get a flags value with all bits unset.","Get a flags value with all bits unset.","Get a flags value with all bits unset.","Get a flags value with all bits unset.","Get a flags value with all bits unset.","","","","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Convert from a bits value.","Convert from a bits value.","Convert from a bits value.","Convert from a bits value.","Convert from a bits value.","Convert from a bits value.","Convert from a bits value.","Convert from a bits value.","","Convert from a bits value exactly.","Convert from a bits value exactly.","","","Convert from a bits value exactly.","","Convert from a bits value exactly.","","Convert from a bits value exactly.","","Convert from a bits value exactly.","","Convert from a bits value exactly.","Convert from a bits value exactly.","","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","","","","","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","","","","","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","","","","","","","","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,1,4,5,1,4,5,1,1,4,5,1,4,5,1,5,4,1,4,5,1,4,4,5,4,1,1,1,4,4,5,1,1,1,1,1,4,1,4,5,1,4,5,1,4,5,1,4,5,0,19,19,19,19,19,0,19,0,19,19,19,19,19,19,19,19,19,0,19,19,19,19,19,19,19,0,19,19,19,19,0,0,0,0,0,0,0,0,0,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,0,0,0,33,33,33,33,33,33,33,33,124,124,124,33,33,124,124,124,33,33,33,33,33,124,0,45,52,0,43,43,42,43,48,41,41,43,52,52,0,45,48,0,42,0,0,0,0,0,45,0,44,44,52,41,42,43,44,45,46,47,48,52,41,42,43,44,45,46,47,48,41,42,43,44,45,46,47,48,41,42,43,44,45,46,47,48,41,42,43,44,43,47,46,41,42,43,44,45,46,47,48,52,41,42,43,43,44,44,44,45,46,47,48,48,52,44,52,41,42,43,44,45,46,47,48,44,44,44,46,46,44,44,44,44,44,44,44,44,47,41,42,43,44,45,46,47,48,52,41,42,43,44,45,46,47,48,52,41,42,43,44,45,46,47,48,46,52,41,42,43,44,45,46,47,48,47,146,146,0,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,77,77,77,77,77,77,77,77,67,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,39,35,74,39,35,74,72,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,0,67,65,65,65,65,67,79,69,72,69,72,71,67,68,70,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,39,35,65,65,66,66,66,67,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,66,66,66,66,70,67,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,67,68,67,78,70,76,76,76,75,75,75,75,75,67,73,80,70,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,81,81,69,39,35,65,66,67,68,69,70,71,72,73,51,74,75,76,77,78,79,80,81,73,51,80,0,69,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,147,0,100,100,89,100,89,84,101,89,90,90,90,90,90,90,90,90,90,90,90,90,90,0,0,0,0,0,84,101,101,0,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,85,88,87,87,100,84,101,0,0,0,100,100,90,90,90,90,90,90,90,90,100,91,84,0,101,0,147,0,89,100,0,85,101,84,85,86,87,88,89,90,91,83,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,147,82,58,83,100,84,85,86,87,88,89,90,91,101,147,82,58,83,100,84,85,86,87,88,89,90,91,101,90,58,83,100,84,90,101,58,83,100,84,90,101,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,83,90,84,85,86,87,88,89,90,91,90,84,85,86,87,88,89,90,91,83,100,85,84,85,86,87,88,89,90,91,90,82,58,83,58,58,83,100,84,84,84,84,84,85,85,85,85,86,86,86,86,87,87,87,87,88,88,88,88,89,89,89,89,90,90,90,90,90,91,91,91,91,101,147,82,58,83,100,84,85,86,87,88,89,90,91,101,84,85,86,87,88,89,90,91,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,58,58,82,83,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,147,82,58,83,100,84,85,86,87,88,89,90,91,101,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,83,82,82,83,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,83,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,84,85,86,87,88,89,90,91,0,58,83,100,84,90,101,84,85,86,87,88,89,90,91,147,82,58,83,100,84,85,86,87,88,89,90,91,101,147,82,58,83,100,84,85,86,87,88,89,90,91,101,147,82,58,83,100,84,85,86,87,88,89,90,91,101,84,85,86,87,88,89,90,91,116,116,0,116,116,116,116,0,0,0,0,0,0,107,109,110,111,106,112,116,107,109,110,111,106,112,116,106,106,112,111,107,109,110,111,107,109,110,111,107,109,110,111,107,109,110,111,112,107,109,110,111,107,109,110,111,112,107,109,110,111,112,107,109,110,111,107,109,110,111,112,107,109,110,111,107,109,110,111,107,109,110,111,112,107,109,110,111,107,109,110,111,107,109,110,111,107,109,110,111,112,111,107,109,110,111,106,112,116,107,109,110,111,106,112,116,106,106,107,109,110,111,106,112,116,106,106,106,106,106,106,106,112,111,107,109,110,111,106,112,116,107,109,110,111,106,112,116,107,109,110,111,106,112,116,21,0,0,21,0,21,0,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,0,0,129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,135,135,0,0,137,137,137,137,137,137,137,137,137,135,136,137,135,136,137,135,136,137,135,136,137,136,135,136,137,135,136,137,135,136,137,136,136,0,135,136,137,135,136,137,135,136,137,135,136,137,139,145,49,49,139,49,0,49,139,0,145,0,0,0,0,0,0,0,0,0,0,0,0,0,139,145,145,145,141,141,138,145,138,141,141,138,145,145,145,140,50,50,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,142,143,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,144,140,140,144,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,138,139,140,140,141,141,49,49,50,50,122,119,121,123,120,142,143,144,145,145,50,144,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,140,50,50,50,140,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,50,50,50,50,50,50,50,142,143,142,143,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,144,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,138,139,140,141,49,50,122,119,121,123,120,142,143,144,145,140,140,148,149,150,150,151,152,153,151,152,153,151,152,153,151,152,153,151,152,153,151,152,153],"f":[0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[1,[-1]]],2,[]],[[[1,[-1]]],[[1,[-1]]],3],[[[4,[-1]]],[[4,[-1]]],3],[[[5,[-1]]],[[5,[-1]]],3],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[],[[1,[-1]]],[]],[[],[[5,[-1]]],[]],[-1,[[6,[[4,[-2]]]]],7,8],[[[1,[-1]],9],10,11],[[[4,[-1]],9],10,11],[[[5,[-1]],9],10,11],[-1,-1,[]],[-1,-1,[]],[[[1,[-1]],-2],[[4,[-3]]],[],12,[]],[-1,-1,[]],[[[1,[-1]],-2],[[4,[-3]]],[],12,[]],[[[1,[-1]],13],[[14,[-1]]],[]],[[[1,[-1]],13],[[14,[-1]]],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[4,[-1]],-2],[[1,[-3]]],[],12,[]],[-1,-2,[],[]],[[[1,[-1]]],[[0,[15]]],[]],[[[1,[-1]]],[[0,[15]]],[]],[[],[[1,[-1]]],[]],[[[1,[-1]],-1],[[2,[13,[14,[-1]]]]],[]],[[[1,[-1]],13],[[14,[-1]]],[]],[[[4,[-1]],-2],6,16,17],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],0,0,[-1,-2,[],[]],[-1,-2,[],[]],[19,19],[[-1,-2],2,[],[]],0,[[],19],0,0,[[19,9],10],[-1,-1,[]],[[19,20],[[6,[21,22]]]],[[19,20],[[6,[21,22]]]],[[19,21],[[6,[20,22]]]],[-1,-2,[],[]],0,[[],19],0,[[19,23],2],[[19,[24,[23]]],2],[[19,23],2],[[19,[24,[23]]],2],[[19,25,25],2],[[19,20],[[6,[2,22]]]],[[19,20,20],[[6,[2,22]]]],0,[-1,-2,[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],0,0,0,0,0,0,[26,[[6,[27,22]]]],[[19,26,28],[[6,[27,22]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[22,22],[[-1,-2],2,[],[]],[[],22],[[22,22],29],[[22,9],10],[30,22],[-1,-1,[]],[31,22],[32,22],[31,22],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],0,0,0,[[[33,[-1]],13],[],34],[-1,-2,[],[]],[-1,-2,[],[]],[[[33,[-1]]],[[33,[-1]]],[3,34]],[[-1,-2],2,[],[]],[[[33,[-1]],9],10,[11,34]],[13,[[33,[-1]]],34],[-1,-1,[]],[[-1,[33,[-2]]],[[6,[-2,22]]],[],34],[[-1,[33,[35]],36],[[6,[[24,[37]],22]]],[]],[[-1,[33,[-2]],13],[[6,[[38,[-2]],22]]],[],34],[-1,-2,[],[]],[[[33,[-1]]],29,34],[[-1,[33,[-2]]],[[6,[-2,22]]],[],34],[[-1,[33,[39]],36],[[6,[[24,[40]],22]]],[]],[[-1,[33,[-2]],13],[[6,[[38,[-2]],22]]],[],34],[[[33,[-1]],13],[],34],[-1,-2,[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],[[-1,[33,[-2]],-2],[[6,[2,22]]],[],34],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[41,41],[42,42],[43,43],[44,44],[45,45],[46,46],[47,47],[48,48],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[],41],[[],42],[[],43],[[],44],[[43,43],29],0,0,[[41,9],10],[[42,9],10],[[43,9],10],[[44,9],10],[[45,9],10],[[46,9],10],[[47,9],10],[[48,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[49,43],[-1,-1,[]],[-1,-1,[]],[50,44],[50,44],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[51,[[6,[48,22]]]],[-1,-1,[]],[[[38,[51]]],[[6,[52,22]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,[[46,53],2],[[46,53],2],0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],0,[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],0,0,0,0,[54,[[55,[54]]]],[[54,56],[[55,[2]]]],[[54,[14,[[38,[57]]]]],[[55,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[[54,56],[[55,[2]]]],[54,[[55,[[14,[[24,[57]]]]]]]],[54,[[6,[58,22]]]],[[54,9],10],[-1,-1,[]],[[59,44],[[55,[54]]]],[[60,44],[[55,[54]]]],[54,[[55,[56]]]],[54,29],[54,[[55,[56]]]],[54,[[55,[29]]]],[54,[[55,[[14,[31]]]]]],[54,13],[54,[[14,[61]]]],[54,29],[54,13],[54,[[14,[61]]]],[54,[[2,[41,42]]]],[-1,-2,[],[]],[[54,62],[[55,[2]]]],[44,[[55,[54]]]],[[54,[38,[40]],63],[[55,[[2,[13,29]]]]]],[[54,[38,[40]],63],[[55,[[2,[13,29,[14,[56]]]]]]]],[[54,[38,[37]],63],[[55,[13]]]],[[54,[38,[37]],56,63],[[55,[13]]]],[[54,29],[[55,[2]]]],[[54,13],[[55,[2]]]],[[54,[14,[61]]],[[55,[2]]]],[[54,29],[[55,[2]]]],[[54,13],[[55,[2]]]],[[54,[14,[61]]],[[55,[2]]]],[[54,64],[[55,[2]]]],0,[54,2],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,[39,39],[35,35],[65,65],[66,66],[67,67],[68,68],[69,69],[70,70],[71,71],[72,72],[73,73],[51,51],[74,74],[75,75],[76,76],[77,77],[78,78],[79,79],[80,80],[81,81],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[39,9],10],[[35,9],10],[[65,9],10],[[66,9],10],[[67,9],10],[[68,9],10],[[69,9],10],[[70,9],10],[[71,9],10],[[72,9],10],[[73,9],10],[[51,9],10],[[74,9],10],[[75,9],10],[[76,9],10],[[77,9],10],[[78,9],10],[[79,9],10],[[80,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[82,65],[-1,-1,[]],[58,66],[58,66],[83,67],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],0,0,0,[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[],84],[[],85],[[],86],[[],87],[[],88],[[],89],[[],90],[[],91],0,[[84,84],84],[[85,85],85],[[86,86],86],[[87,87],87],[[88,88],88],[[89,89],89],[[90,90],90],[[91,91],91],[[84,84],2],[[85,85],2],[[86,86],2],[[87,87],2],[[88,88],2],[[89,89],2],[[90,90],2],[[91,91],2],[[84,84],84],[[85,85],85],[[86,86],86],[[87,87],87],[[88,88],88],[[89,89],89],[[90,90],90],[[91,91],91],[[84,84],2],[[85,85],2],[[86,86],2],[[87,87],2],[[88,88],2],[[89,89],2],[[90,90],2],[[91,91],2],[84,92],[84,92],[85,93],[85,93],[86,94],[86,94],[87,95],[87,95],[88,96],[88,96],[89,97],[89,97],[90,98],[90,98],[91,99],[91,99],[[84,84],84],[[85,85],85],[[86,86],86],[[87,87],87],[[88,88],88],[[89,89],89],[[90,90],90],[[91,91],91],[[84,84],2],[[85,85],2],[[86,86],2],[[87,87],2],[[88,88],2],[[89,89],2],[[90,90],2],[[91,91],2],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[90,90],[[6,[2,22]]]],[58,58],[83,83],[100,100],[84,84],[90,90],[101,101],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[84,84],[85,85],[86,86],[87,87],[88,88],[89,89],[90,90],[91,91],[[84,84],29],[[85,85],29],[[86,86],29],[[87,87],29],[[88,88],29],[[89,89],29],[[90,90],29],[[91,91],29],0,[[],90],[[84,84],84],[[85,85],85],[[86,86],86],[[87,87],87],[[88,88],88],[[89,89],89],[[90,90],90],[[91,91],91],[[],90],[[],84],[[],85],[[],86],[[],87],[[],88],[[],89],[[],90],[[],91],[[83,83],29],[[100,100],29],[[85,85],29],[[84,-1],2,102],[[85,-1],2,102],[[86,-1],2,102],[[87,-1],2,102],[[88,-1],2,102],[[89,-1],2,102],[[90,-1],2,102],[[91,-1],2,102],[[],90],0,0,0,0,[[58,9],10],[[83,9],10],[[100,9],10],[[84,9],10],[[84,9],10],[[84,9],10],[[84,9],10],[[84,9],10],[[85,9],10],[[85,9],10],[[85,9],10],[[85,9],10],[[86,9],10],[[86,9],10],[[86,9],10],[[86,9],10],[[87,9],10],[[87,9],10],[[87,9],10],[[87,9],10],[[88,9],10],[[88,9],10],[[88,9],10],[[88,9],10],[[89,9],10],[[89,9],10],[[89,9],10],[[89,9],10],[[90,9],10],[[90,9],10],[[90,9],10],[[90,9],10],[[90,9],10],[[91,9],10],[[91,9],10],[[91,9],10],[[91,9],10],[[101,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[92,[[14,[84]]]],[93,[[14,[85]]]],[94,[[14,[86]]]],[95,[[14,[87]]]],[96,[[14,[88]]]],[97,[[14,[89]]]],[98,[[14,[90]]]],[99,[[14,[91]]]],[92,84],[92,84],[93,85],[93,85],[94,86],[94,86],[95,87],[95,87],[96,88],[96,88],[97,89],[97,89],[98,90],[98,90],[99,91],[99,91],[92,84],[93,85],[94,86],[95,87],[96,88],[97,89],[98,90],[99,91],[-1,84,102],[-1,85,102],[-1,86,102],[-1,87,102],[-1,88,102],[-1,89,102],[-1,90,102],[-1,91,102],[103,[[14,[84]]]],[103,[[14,[85]]]],[103,[[14,[86]]]],[103,[[14,[87]]]],[103,[[14,[88]]]],[103,[[14,[89]]]],[103,[[14,[90]]]],[103,[[14,[91]]]],0,0,0,0,[[84,84],2],[[85,85],2],[[86,86],2],[[87,87],2],[[88,88],2],[[89,89],2],[[90,90],2],[[91,91],2],[[84,84],84],[[85,85],85],[[86,86],86],[[87,87],87],[[88,88],88],[[89,89],89],[[90,90],90],[[91,91],91],[[84,84],29],[[85,85],29],[[86,86],29],[[87,87],29],[[88,88],29],[[89,89],29],[[90,90],29],[[91,91],29],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[84],[85],[86],[87],[88],[89],[90],[91],[84,29],[85,29],[86,29],[87,29],[88,29],[89,29],[90,29],[91,29],[84,29],[85,29],[86,29],[87,29],[88,29],[89,29],[90,29],[91,29],[84,[[104,[84]]]],[85,[[104,[85]]]],[86,[[104,[86]]]],[87,[[104,[87]]]],[88,[[104,[88]]]],[89,[[104,[89]]]],[90,[[104,[90]]]],[91,[[104,[91]]]],[84,[[105,[84]]]],[85,[[105,[85]]]],[86,[[105,[86]]]],[87,[[105,[87]]]],[88,[[105,[88]]]],[89,[[105,[89]]]],[90,[[105,[90]]]],[91,[[105,[91]]]],0,0,0,0,[84,84],[85,85],[86,86],[87,87],[88,88],[89,89],[90,90],[91,91],[[84,84],2],[[85,85],2],[[86,86],2],[[87,87],2],[[88,88],2],[[89,89],2],[[90,90],2],[[91,91],2],[[84,84,29],2],[[85,85,29],2],[[86,86,29],2],[[87,87,29],2],[[88,88,29],2],[[89,89,29],2],[[90,90,29],2],[[91,91,29],2],0,[[84,84],84],[[85,85],85],[[86,86],86],[[87,87],87],[[88,88],88],[[89,89],89],[[90,90],90],[[91,91],91],[[84,84],2],[[85,85],2],[[86,86],2],[[87,87],2],[[88,88],2],[[89,89],2],[[90,90],2],[[91,91],2],[[84,84],84],[[85,85],85],[[86,86],86],[[87,87],87],[[88,88],88],[[89,89],89],[[90,90],90],[[91,91],91],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[84,84],2],[[85,85],2],[[86,86],2],[[87,87],2],[[88,88],2],[[89,89],2],[[90,90],2],[[91,91],2],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[[84,84],84],[[85,85],85],[[86,86],86],[[87,87],87],[[88,88],88],[[89,89],89],[[90,90],90],[[91,91],91],0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[106],[106],0,0,[[107,108,108,101],[[6,[2,22]]]],[[109,108,108,101],[[6,[2,22]]]],[[110,108,108,101],[[6,[2,22]]]],[[111,108,108,101],[[6,[2,22]]]],[[107,108,108],[[6,[2,22]]]],[[109,108,108],[[6,[2,22]]]],[[110,108,108],[[6,[2,22]]]],[[111,108,108],[[6,[2,22]]]],[107,[[6,[2,22]]]],[109,[[6,[2,22]]]],[110,[[6,[2,22]]]],[111,[[6,[2,22]]]],[107,[[6,[58,22]]]],[109,[[6,[58,22]]]],[110,[[6,[58,22]]]],[111,[[6,[58,22]]]],[112,[[6,[58,22]]]],[[107,84],[[6,[2,22]]]],[[109,84],[[6,[2,22]]]],[[110,84],[[6,[2,22]]]],[[111,84],[[6,[2,22]]]],[[107,90,90],[[6,[2,22]]]],[[109,90,90],[[6,[2,22]]]],[[110,90,90],[[6,[2,22]]]],[[111,90,90],[[6,[2,22]]]],[[112,90,90],[[6,[2,22]]]],[107,[[6,[83,22]]]],[109,[[6,[83,22]]]],[110,[[6,[83,22]]]],[111,[[6,[83,22]]]],[112,[[6,[83,22]]]],[[107,108],[[6,[2,22]]]],[[109,108],[[6,[2,22]]]],[[110,108],[[6,[2,22]]]],[[111,108],[[6,[2,22]]]],[[107,28,28,113],[[6,[2,22]]]],[[109,28,28,113],[[6,[2,22]]]],[[110,28,28,113],[[6,[2,22]]]],[[111,28,28,113],[[6,[2,22]]]],[[112,28,28,113],[[6,[2,22]]]],[[107,[38,[40]],108],[[6,[13,22]]]],[[109,[38,[40]],108],[[6,[13,22]]]],[[110,[38,[40]],108],[[6,[13,22]]]],[[111,[38,[40]],108],[[6,[13,22]]]],[[107,[38,[37]],108],[[6,[13,22]]]],[[109,[38,[37]],108],[[6,[13,22]]]],[[110,[38,[37]],108],[[6,[13,22]]]],[[111,[38,[37]],108],[[6,[13,22]]]],[[107,[38,[40]]],[[6,[13,22]]]],[[109,[38,[40]]],[[6,[13,22]]]],[[110,[38,[40]]],[[6,[13,22]]]],[[111,[38,[40]]],[[6,[13,22]]]],[[112,13,[38,[57]]],[[6,[13,22]]]],[[107,114,115],[[6,[108,22]]]],[[109,114,115],[[6,[108,22]]]],[[110,114,115],[[6,[108,22]]]],[[111,114,115],[[6,[108,22]]]],[107,[[6,[2,22]]]],[109,[[6,[2,22]]]],[110,[[6,[2,22]]]],[111,[[6,[2,22]]]],[107,[[6,[108,22]]]],[109,[[6,[108,22]]]],[110,[[6,[108,22]]]],[111,[[6,[108,22]]]],[[107,[38,[37]]],[[6,[13,22]]]],[[109,[38,[37]]],[[6,[13,22]]]],[[110,[38,[37]]],[[6,[13,22]]]],[[111,[38,[37]]],[[6,[13,22]]]],0,0,[[107,9],10],[[109,9],10],[[110,9],10],[[111,9],10],[[106,9],10],[[112,9],10],[[116,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[106,-1],[[6,[25,22]]],[[118,[117]]]],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[25,25],106],[[106,103],[[6,[2,22]]]],[[106,103,29],[[6,[83,22]]]],[[106,-1,89,90,90,84],[[6,[112,22]]],[[118,[117]]]],[[106,-1,89,90,84],[[6,[111,22]]],[[118,[117]]]],[[106,103],[[6,[2,22]]]],[[106,103],[[6,[2,22]]]],0,0,[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[[21,9],10],[119,21],[120,21],[121,21],[122,21],[-1,-1,[]],[123,21],[-1,-2,[],[]],[21,29],[21,29],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],0,0,[-1,[[6,[2,22]]],[]],[[19,-1,[33,[36]],[33,[57]]],[[6,[2,22]]],124],[[19,-1,[33,[36]],[33,[36]]],[[6,[2,22]]],124],0,0,[[19,-1,26,[33,[28]]],[[6,[2,22]]],124],[[19,-1,26,28,[33,[28]]],[[6,[2,22]]],124],[[19,-1,[33,[36]],[33,[57]]],[[6,[2,22]]],124],[[19,-1,[33,[36]],[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,108,108,125],[[6,[2,22]]],124],[[19,-1,20,108,108],[[6,[2,22]]],124],[[19,-1,20],[[6,[2,22]]],124],[[19,-1,20],[[6,[2,22]]],124],[[19,-1,20,[33,[66]]],[[6,[2,22]]],124],[[19,-1,20,92],[[6,[2,22]]],124],[[19,-1,20,98,98],[[6,[2,22]]],124],[[19,-1,20,[33,[67]]],[[6,[2,22]]],124],[[19,-1,20,108],[[6,[2,22]]],124],[[19,-1,20,28,28,113],[[6,[2,22]]],124],[[19,-1,20,[33,[39]],36,108,[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,[33,[57]],36],[[6,[2,22]]],124],[[19,-1,20,[33,[80]]],[[6,[2,22]]],124],[[19,-1,20,[33,[35]],36,108,[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,[33,[39]],36,[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,[33,[57]],36,126,[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,20],[[6,[2,22]]],124],[[19,-1,20,114,115,[33,[108]]],[[6,[2,22]]],124],[[19,-1,20],[[6,[2,22]]],124],[[19,-1,20,[33,[108]]],[[6,[2,22]]],124],[[19,-1,20,[33,[35]],36,[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,[33,[57]],36],[[6,[2,22]]],124],[[19,-1,20,99,[33,[57]],36,[33,[67]]],[[6,[2,22]]],124],[[19,-1,20,99,[33,[57]],36,28,28,113],[[6,[2,22]]],124],[[19,-1,20,99,[33,[57]],36,20,[33,[57]],36],[[6,[2,22]]],124],[[19,-1,20,99,[33,[57]],36,97,98,98,92,[33,[20]]],[[6,[2,22]]],124],[[19,-1,20,[33,[57]],36,[33,[57]],36,[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,[33,[57]],36],[[6,[2,22]]],124],[[19,-1,20,[33,[57]],36,20,[33,[57]],36],[[6,[2,22]]],124],[[19,-1,[33,[57]],36,20,[33,[57]],36],[[6,[2,22]]],124],[[19,-1,20,[33,[57]],36],[[6,[2,22]]],124],[[19,-1,127],2,124],[[19,-1,128],[[6,[2,22]]],124],[[19,-1,[33,[57]],36],[[6,[2,22]]],124],[[19,-1],[[6,[2,22]]],129],[[19,-1,[33,[51]],[33,[69]],36,[33,[36]]],[[6,[2,22]]],124],0,[[19,-1,20,[33,[20]]],[[6,[2,22]]],124],[[19,-1,20,[33,[74]],62],[[6,[2,22]]],124],[[19,-1,20,[33,[74]],62],[[6,[2,22]]],124],[[19,-1,20,[33,[74]],[33,[62]],[33,[62]]],[[6,[2,22]]],124],[[19,-1,20,[33,[74]],[33,[62]],[33,[62]]],[[6,[2,22]]],124],[[19,-1,20,130,131,[33,[132]],[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,62],[[6,[2,22]]],124],[[19,-1,[33,[57]],36,133,[33,[57]],36,[33,[36]]],[[6,[2,22]]],124],[[19,-1,133,134,[33,[20]]],[[6,[2,22]]],124],[[19,-1,20,[33,[39]],36,95,[33,[36]],[33,[96]]],[[6,[2,22]]],124],[[19,-1,20,[33,[39]],36,[33,[74]],95,[33,[62]],[33,[36]],[33,[96]]],[[6,[2,22]]],124],[[19,-1,20,[33,[35]],36,94,[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,[33,[35]],36,[33,[74]],62,94,[33,[36]]],[[6,[2,22]]],124],[[19,-1,20,130,131,[33,[132]],36],[[6,[2,22]]],124],[[19,-1,20,93],[[6,[2,22]]],124],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[135,135],[136,136],[137,137],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],0,[[135,9],10],[[136,9],10],[[137,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,[[19,-1,[33,[57]],62,[33,[57]],62,[33,[2]],[33,[62]],62,[33,[62]]],[[6,[2,22]]],124],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[138,138],[139,139],[140,140],[141,141],[49,49],[50,50],[122,122],[119,119],[121,121],[123,123],[120,120],[142,142],[143,143],[144,144],[145,145],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[142,[[55,[21]]]],[143,[[55,[21]]]],[-1,[[6,[138]]],7],[-1,[[6,[139]]],7],[-1,[[6,[140]]],7],[-1,[[6,[141]]],7],[-1,[[6,[49]]],7],[-1,[[6,[50]]],7],[-1,[[6,[122]]],7],[-1,[[6,[119]]],7],[-1,[[6,[121]]],7],[-1,[[6,[123]]],7],[-1,[[6,[120]]],7],[-1,[[6,[142]]],7],[-1,[[6,[143]]],7],[-1,[[6,[144]]],7],[-1,[[6,[145]]],7],0,0,0,0,[[138,9],10],[[139,9],10],[[140,9],10],[[141,9],10],[[49,9],10],[[50,9],10],[[122,9],10],[[119,9],10],[[121,9],10],[[123,9],10],[[120,9],10],[[142,9],10],[[143,9],10],[[144,9],10],[[145,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[19,140],[[[2,[41,42]]],141],[-1,-1,[]],[43,49],[-1,-1,[]],[44,50],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[21,145],[-1,-1,[]],0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,[[140,-1],19,12],[[138,-1],6,17],[[139,-1],6,17],[[140,-1],6,17],[[141,-1],6,17],[[49,-1],6,17],[[50,-1],6,17],[[122,-1],6,17],[[119,-1],6,17],[[121,-1],6,17],[[123,-1],6,17],[[120,-1],6,17],[[142,-1],6,17],[[143,-1],6,17],[[144,-1],6,17],[[145,-1],6,17],0,0,0,0,0,0,0,0,0,[[142,59],[[55,[21]]]],[[143,60],[[55,[21]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[144,25],21],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,[[6,[-2]]],[],[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],[-1,18,[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"ObjectPool",3],[15,"tuple"],[8,"Clone",2159],[3,"SerialObjectPool",3],[3,"ObjectNode",3],[4,"Result",2160],[8,"Deserializer",2161],[8,"Deserialize",2161],[3,"Formatter",2162],[6,"Result",2162],[8,"Debug",2162],[8,"FnMut",2163],[15,"usize"],[4,"Option",2164],[8,"Iterator",2165],[8,"Serialize",2166],[8,"Serializer",2166],[3,"TypeId",2167],[3,"WasiCtx",54],[6,"__wasi_fd_t",421],[4,"VFD",1731],[3,"Errno",93],[3,"String",2168],[3,"Vec",2169],[3,"PathBuf",2170],[6,"Type",792],[15,"u64"],[6,"__wasi_timestamp_t",421],[15,"bool"],[6,"Type",797],[3,"Error",2171],[4,"ErrorKind",2171],[3,"WasmPtr",200],[8,"Sized",2172],[3,"__wasi_ciovec_t",421],[6,"__wasi_size_t",421],[3,"IoSlice",2173],[15,"slice"],[3,"__wasi_iovec_t",421],[3,"IoSliceMut",2173],[4,"AddressFamily",224],[4,"SocketType",224],[4,"ConnectState",224],[3,"WasiSocketState",224],[4,"SubscriptionFdType",224],[3,"SubscriptionFd",224],[3,"SubscriptionClock",224],[4,"Subscription",224],[4,"SerialConnectState",1868],[3,"SerialWasiSocketState",1868],[3,"__wasi_subscription_t",421],[4,"PrePoll",224],[6,"__wasi_userdata_t",421],[3,"AsyncWasiSocket",378],[6,"Result",2171],[4,"SocketAddr",2174],[15,"u8"],[3,"FdStat",1030],[3,"TcpListener",2175],[3,"UdpSocket",2176],[3,"Duration",2177],[15,"u32"],[6,"c_int",2178],[4,"Shutdown",2179],[3,"__wasi_dirent_t",421],[3,"__wasi_fdstat_t",421],[3,"__wasi_filestat_t",421],[3,"__wasi_event_fd_readwrite_t",421],[3,"__wasi_event_t",421],[3,"__wasi_subscription_clock_t",421],[3,"__wasi_subscription_fd_readwrite_t",421],[19,"__wasi_subscription_u_u_t",421],[3,"__wasi_subscription_u_t",421],[3,"__wasi_address_t",421],[3,"__wasi_sockaddr_in_t",421],[3,"__wasi_sockaddr_t",421],[3,"__wasi_addrinfo_t",421],[3,"__wasi_prestat_dir_t",421],[19,"__wasi_prestat_u_t",421],[3,"__wasi_prestat_t",421],[3,"__wasi_timeval",421],[3,"ReaddirEntity",1030],[3,"Filestat",1030],[3,"FdFlags",1030],[3,"SdFlags",1030],[3,"SiFlags",1030],[3,"RiFlags",1030],[3,"RoFlags",1030],[3,"OFlags",1030],[3,"WASIRights",1030],[3,"Lookupflags",1030],[6,"Type",892],[6,"Type",967],[6,"__wasi_siflags_t",421],[6,"Type",925],[6,"Type",965],[6,"Type",914],[6,"Type",928],[6,"Type",912],[3,"FileType",1030],[4,"Advice",1030],[8,"IntoIterator",2180],[15,"str"],[3,"Iter",2181],[3,"IterNames",2181],[3,"WasiPreOpenDir",1576],[3,"WasiStdin",1576],[6,"__wasi_filesize_t",421],[3,"WasiStdout",1576],[3,"WasiStderr",1576],[3,"WasiFile",1576],[3,"WasiDir",1576],[6,"Type",907],[6,"__wasi_filedelta_t",421],[6,"Type",1026],[4,"INode",1576],[3,"Path",2170],[8,"AsRef",2182],[3,"SerialStdout",1868],[3,"SerialWasiFile",1868],[3,"SerialStderr",1868],[3,"SerialStdin",1868],[3,"SerialWasiDir",1868],[8,"Memory",200],[6,"Type",777],[6,"__wasi_dircookie_t",421],[6,"__wasi_exitcode_t",421],[6,"Type",970],[8,"AsyncVM",1731],[6,"Type",1002],[6,"Type",1004],[15,"i32"],[6,"Type",773],[6,"Type",1020],[4,"AddressFamily",1816],[3,"WasiSockaddr",1816],[3,"WasiAddrinfo",1816],[4,"PollFdState",1868],[4,"IoState",1868],[3,"SerialWasiCtx",1868],[4,"SerialSocketType",1868],[3,"SerialTcpServer",1868],[3,"SerialUdpSocket",1868],[3,"SerialPreOpen",1868],[4,"SerialVFD",1868],[13,"Both",376],[4,"SystemTimeSpec",1030],[13,"Accept",2137],[13,"Sleep",2137],[13,"Poll",2137],[13,"UdpSocket",2141],[13,"TcpListener",2141],[13,"TcpStream",2141]],"b":[[189,"impl-From%3Cu16%3E-for-Errno"],[191,"impl-From%3C%26Error%3E-for-Errno"],[192,"impl-From%3CErrorKind%3E-for-Errno"],[193,"impl-From%3CError%3E-for-Errno"],[307,"impl-From%3CSerialWasiSocketState%3E-for-WasiSocketState"],[308,"impl-From%3C%26SerialWasiSocketState%3E-for-WasiSocketState"],[622,"impl-From%3CFdStat%3E-for-__wasi_fdstat_t"],[623,"impl-From%3C%26FdStat%3E-for-__wasi_fdstat_t"],[1152,"impl-Flags-for-FdFlags"],[1153,"impl-FdFlags"],[1154,"impl-SdFlags"],[1155,"impl-Flags-for-SdFlags"],[1156,"impl-Flags-for-SiFlags"],[1157,"impl-SiFlags"],[1158,"impl-Flags-for-RiFlags"],[1159,"impl-RiFlags"],[1160,"impl-Flags-for-RoFlags"],[1161,"impl-RoFlags"],[1162,"impl-OFlags"],[1163,"impl-Flags-for-OFlags"],[1164,"impl-WASIRights"],[1165,"impl-Flags-for-WASIRights"],[1166,"impl-Flags-for-Lookupflags"],[1167,"impl-Lookupflags"],[1279,"impl-Octal-for-FdFlags"],[1280,"impl-LowerHex-for-FdFlags"],[1281,"impl-Debug-for-FdFlags"],[1282,"impl-UpperHex-for-FdFlags"],[1283,"impl-Binary-for-FdFlags"],[1284,"impl-UpperHex-for-SdFlags"],[1285,"impl-Octal-for-SdFlags"],[1286,"impl-LowerHex-for-SdFlags"],[1287,"impl-Binary-for-SdFlags"],[1288,"impl-Octal-for-SiFlags"],[1289,"impl-LowerHex-for-SiFlags"],[1290,"impl-UpperHex-for-SiFlags"],[1291,"impl-Binary-for-SiFlags"],[1292,"impl-Binary-for-RiFlags"],[1293,"impl-UpperHex-for-RiFlags"],[1294,"impl-LowerHex-for-RiFlags"],[1295,"impl-Octal-for-RiFlags"],[1296,"impl-Binary-for-RoFlags"],[1297,"impl-UpperHex-for-RoFlags"],[1298,"impl-Octal-for-RoFlags"],[1299,"impl-LowerHex-for-RoFlags"],[1300,"impl-UpperHex-for-OFlags"],[1301,"impl-Binary-for-OFlags"],[1302,"impl-LowerHex-for-OFlags"],[1303,"impl-Octal-for-OFlags"],[1304,"impl-Binary-for-WASIRights"],[1305,"impl-UpperHex-for-WASIRights"],[1306,"impl-Debug-for-WASIRights"],[1307,"impl-Octal-for-WASIRights"],[1308,"impl-LowerHex-for-WASIRights"],[1309,"impl-Binary-for-Lookupflags"],[1310,"impl-UpperHex-for-Lookupflags"],[1311,"impl-LowerHex-for-Lookupflags"],[1312,"impl-Octal-for-Lookupflags"],[1336,"impl-Flags-for-FdFlags"],[1337,"impl-FdFlags"],[1338,"impl-SdFlags"],[1339,"impl-Flags-for-SdFlags"],[1340,"impl-Flags-for-SiFlags"],[1341,"impl-SiFlags"],[1342,"impl-Flags-for-RiFlags"],[1343,"impl-RiFlags"],[1344,"impl-Flags-for-RoFlags"],[1345,"impl-RoFlags"],[1346,"impl-Flags-for-OFlags"],[1347,"impl-OFlags"],[1348,"impl-Flags-for-WASIRights"],[1349,"impl-WASIRights"],[1350,"impl-Lookupflags"],[1351,"impl-Flags-for-Lookupflags"],[1741,"impl-From%3CSerialStdout%3E-for-VFD"],[1742,"impl-From%3CSerialWasiFile%3E-for-VFD"],[1743,"impl-From%3CSerialStderr%3E-for-VFD"],[1744,"impl-From%3CSerialStdin%3E-for-VFD"],[1746,"impl-From%3CSerialWasiDir%3E-for-VFD"]]},\ +"wasmedge_macro":{"doc":"Overview","t":"XX","n":["async_host_function","host_function"],"q":[[0,"wasmedge_macro"]],"d":["Declare a native async function that will be used to …","Declare a native function that will be used to create a …"],"i":[0,0],"f":[0,0],"c":[],"p":[],"b":[]},\ +"wasmedge_sdk":{"doc":"Overview","t":"QIDDEENINDDNNENNDNDNNDDDNDENNDDDDDDNDDENGNNNNNNNEDDDNDNENDDSNNNNNNNNNGIIIGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLALLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLKLKLLLLKLKLKLLLLLXLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLKLKLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLOALLLLLLLLLLLLLLKLLLLLKLLLLLLLLLLLLLLLKLKLKLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLAALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLKLFLLLLLLLLLLLLLLLLLLLLDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNENNNNNNNNNNNNNDLLLLLLLLLLLLLLLLLLLLNNNNNNNEEEEEENNNNNNNNNNNNNNNNNNNNNNNNNNNNENNNENNNNNNENNNENNNNNNENNNNNNENNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNENNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNENNNNNNNNENENNNNNNNNNNNNNNNNNNNNNNNNNNEENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMNNNENNNNENNNNGDNNNDDGDDDDGNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDNNNNNNNELLLLLLLLLLLLLLLLLLLLLLLLLLLLDDLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLL","n":["Array","AsInstance","Caller","Compiler","CompilerOptimizationLevel","CompilerOutputFormat","Const","Engine","Err","Executor","ExportType","ExternRef","ExternRef","ExternalInstanceType","F32","F64","Func","Func","FuncRef","FuncRef","FuncRef","FuncType","FuncTypeBuilder","Global","Global","GlobalType","HostRegistration","I32","I64","ImportObject","ImportObjectBuilder","ImportType","Instance","LogManager","Memory","Memory","MemoryType","Module","Mutability","Native","NeverType","O0","O1","O2","O3","Ok","Os","Oz","RefType","Statistics","Store","Table","Table","TableType","V128","ValType","Var","Vm","VmBuilder","WASM_TYPE","Wasi","WasiCryptoAsymmetricCommon","WasiCryptoCommon","WasiCryptoKx","WasiCryptoSignatures","WasiCryptoSymmetric","WasiNn","Wasm","WasmEdgeProcess","WasmEdgeResult","WasmVal","WasmValType","WasmValTypeList","WasmValue","active_module","active_module_mut","args","args_len","as_ptr","as_ref","auto_detect_plugins","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","compile_from_bytes","compile_from_file","config","contains","contains_module","cost","count","count_of_exports","count_of_imports","count_per_second","data_pointer","data_pointer_mut","default","default","default","default","default","default","default","dock","elem_ty","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","error","executor","executor","executor_mut","executor_mut","exports","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_bytes","from_file","func","func","func_count","func_count","func_names","func_names","get","get_export","get_value","global","global","global_count","global_count","global_names","global_names","grow","grow","hash","host_data","host_function","imports","instance","instance_mut","instance_names","instance_names","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","log_debug_info","log_error_info","log_off","maximum","maximum","memory","memory","memory","memory_count","memory_count","memory_names","memory_names","minimum","minimum","mod_name","mod_name","mod_name","mod_name","module_name","mutability","name","name","name","name","name","name","name","name","name","named_instance","named_instance_count","named_instance_count","named_module","named_module_mut","new","new","new","new","new","new","new","new","new","new","new","new","new","new","new","page","params","plugin","read","read_string","register_active_module","register_import_module","register_import_module","register_module","register_module_from_bytes","register_module_from_file","register_named_module","register_plugin_module","returns","returns_len","run","run","run_func","run_func","run_func","run_func_from_bytes","run_func_from_file","run_func_from_module","run_func_ref","run_func_ref","run_func_with_timeout","run_func_with_timeout","run_with_timeout","set","set_cost_limit","set_cost_table","set_value","shared","size","size","statistics","statistics_mut","store","store_mut","table","table","table_count","table_count","table_names","table_names","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_wasm_value","to_wasm_value","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","ty","ty","ty","ty","ty","ty","ty","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","types","utils","value_ty","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wasi","wasi_module","wasi_module_mut","wasm_types","wasm_types","wat2wasm","with_arg","with_args","with_config","with_func","with_func_by_type","with_global","with_memory","with_plugin","with_plugin_rustls","with_plugin_wasi_crypto","with_plugin_wasi_nn","with_plugin_wasmedge_process","with_return","with_returns","with_statistics","with_store","with_table","wrap","wrap_with_type","write","CommonConfigOptions","CompilerConfigOptions","Config","ConfigBuilder","HostRegistrationConfigOptions","RuntimeConfigOptions","StatisticsConfigOptions","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","bulk_memory_operations","bulk_memory_operations_enabled","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cost_measuring_enabled","count_instructions","default","default","default","default","default","default","dump_ir","dump_ir_enabled","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","function_references","function_references_enabled","generic_binary","generic_binary_enabled","instruction_counting_enabled","interpreter_mode","interpreter_mode_enabled","interruptible","interruptible_enabled","into","into","into","into","into","into","into","max_memory_pages","max_memory_pages","measure_cost","measure_time","multi_memories","multi_memories_enabled","multi_value","multi_value_enabled","mutable_globals","mutable_globals_enabled","new","new","new","new","new","new","non_trap_conversions","non_trap_conversions_enabled","optimization_level","optimization_level","out_format","out_format","reference_types","reference_types_enabled","sign_extension_operators","sign_extension_operators_enabled","simd","simd_enabled","tail_call","tail_call_enabled","threads","threads_enabled","time_measuring_enabled","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wasi","wasi_enabled","with_compiler_config","with_host_registration_config","with_runtime_config","with_statistics_config","Bool","F32","F64","I16","I32","I64","I8","Param","String","U16","U32","U64","U8","VecI16","VecI32","VecI64","VecI8","VecU16","VecU32","VecU64","VecU8","VmDock","borrow","borrow","borrow_mut","borrow_mut","fmt","fmt","from","from","into","into","new","run_func","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","AOTDisabled","Common","CompilerCreate","ConfigCreate","ConstExprRequired","ConstPtr","Core","CoreCommonError","CoreError","CoreExecutionError","CoreInstantiationError","CoreLoadError","CoreValidationError","CostLimitExceeded","Create","Create","Create","Create","Create","Create","Create","Create","CreateBinding","CreateImportModule","CreateSharedType","CreateWasi","CreateWasmEdgeProcess","CreateWithWasiContext","DataCountRequired","DataSegDoesNotFit","DivideByZero","DupExportName","DuplicateImportModule","DuplicateModuleInstance","ElemSegDoesNotFit","ExecuteTimeout","Execution","ExecutorCreate","ExpectSharedMemory","ExpectedZeroByte","Export","ExportError","FoundNulByte","FromUtf8","Func","FuncError","FuncNotFound","FuncType","FuncType","FuncTypeCreate","FuncTypeMismatch","Global","GlobalError","GlobalType","GlobalType","GlobalTypeCreate","HostFuncError","HostFuncFailed","IllegalGrammar","IllegalOpCode","IllegalPath","ImmutableGlobal","Import","ImportError","ImportObjCreate","IncompatibleDataCount","IncompatibleFuncCode","IncompatibleImportType","IndirectCallTypeMismatch","Instance","InstanceError","Instantiation","InstrTypeMismatch","IntegerOverflow","IntegerTooLarge","IntegerTooLong","Interrupted","InvalidAlignment","InvalidConvToInt","InvalidDataIdx","InvalidElemIdx","InvalidFuncIdx","InvalidFuncTypeIdx","InvalidGlobalIdx","InvalidImportModule","InvalidLabelIdx","InvalidLaneIdx","InvalidLimit","InvalidLocalIdx","InvalidMemPages","InvalidMemoryIdx","InvalidMut","InvalidRefIdx","InvalidResultArity","InvalidStartFunc","InvalidTableIdx","JunkSection","Load","LoaderCreate","MalformedElemType","MalformedExportKind","MalformedImportKind","MalformedMagic","MalformedRefType","MalformedSection","MalformedUTF8","MalformedValType","MalformedVersion","Mem","MemError","MemType","MemType","MemTypeCreate","MemoryOutOfBounds","ModifyConst","ModuleCreate","ModuleNameConflict","MultiMemories","MultiTables","MutPtr","NameSizeOutOfBounds","NotFound","NotFoundActiveModule","NotFoundActiveModule","NotFoundExecutor","NotFoundFunc","NotFoundFunc","NotFoundFuncRegistered","NotFoundFuncType","NotFoundGlobal","NotFoundGlobal","NotFoundGlobalRegistered","NotFoundImportModule","NotFoundLoader","NotFoundMappedFdHandler","NotFoundMem","NotFoundMem","NotFoundMemRegistered","NotFoundModule","NotFoundModule","NotFoundNulByte","NotFoundStatistics","NotFoundStore","NotFoundTable","NotFoundTable","NotFoundTableRegistered","NotFoundValidator","NotFoundWasiCryptoAsymmetricCommonModule","NotFoundWasiCryptoCommonModule","NotFoundWasiCryptoKxModule","NotFoundWasiCryptoSignaturesModule","NotFoundWasiCryptoSymmetricModule","NotFoundWasiModule","NotFoundWasiNnModule","NotFoundWasmEdgeProcessModule","NotValidated","Operation","Plugin","PluginError","Ptr2Ref","ReadError","RefTypeMismatch","Runtime","RuntimeError","SectionSizeMismatch","StatisticsCreate","Store","StoreError","Table","TableError","TableOutOfBounds","TableType","TableType","TableTypeCreate","TooManyLocals","Type","Type","Type","Type","Type","Type","TypeCheckFailed","UnalignedAtomicAccess","UndefinedElement","UnexpectedEnd","UninitializedElement","UnknownImport","UnmatchedValType","Unreachable","User","User","UserDefError","Utf8","Validation","ValidatorCreate","Vm","VmError","WasmEdgeError","WindowsPathConversion","WrongInstanceAddress","WrongInstanceIndex","WrongVMWorkflow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","source","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","actual","expected","actual","expected","func_name","global_name","mem_name","mod_name","mod_name","mod_name","mod_name","table_name","AUTO","Autodetect","CPU","ExecutionTarget","F32","F64","GGML","GPU","GraphEncoding","I16","I32","I64","I8","ModuleInstanceCreateFn","NNPreload","None","ONNX","OpenVINO","Plugin","PluginDescriptor","PluginInstance","PluginManager","PluginModule","PluginModuleBuilder","PluginVersion","ProgramOptionType","PyTorch","String","TPU","TensorFlow","TensorFlowLite","Toggle","U16","U32","U64","U8","add_module_descriptor","add_program_option","as_raw_ptr","as_raw_ptr","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone_into","clone_into","clone_into","cmp","cmp","count","default","eq","eq","ffi","find","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from_str","from_str","from_str","init_wasmedge_process","inner","into","into","into","into","into","into","into","into","into","load","mod_count","mod_instance","mod_names","name","name","names","new","new","new","new","nn_preload","partial_cmp","partial_cmp","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","with_func","with_global","with_host_data","with_memory","with_table","APIVersion","Create","Description","Description","ModuleCount","ModuleDescriptions","Name","Name","ProgramOptionCount","ProgramOptions","Version","WasmEdge_ModuleDescriptor","WasmEdge_ModuleInstanceContext","WasmEdge_PluginDescriptor","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","fmt","fmt","fmt","from","from","from","into","into","into","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","ExternRef","ExternRef","F32","F64","FuncRef","I32","I64","V128","Val","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","fmt","fmt","from","from","from","into","into","new","to_owned","to_owned","to_wasm_value","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","wasm_types","CoreVersion","Driver","aot_compiler","borrow","borrow","borrow_mut","borrow_mut","fmt","from","from","into","into","major","minor","patch","runtime_tool","try_from","try_from","try_into","try_into","type_id","type_id","unified_tool","version_string","vzip","vzip","WasiInstance","borrow","borrow_mut","clone","clone_into","exit_code","fmt","from","initialize","into","name","native_handler","to_owned","try_from","try_into","type_id","vzip"],"q":[[0,"wasmedge_sdk"],[649,"wasmedge_sdk::config"],[798,"wasmedge_sdk::dock"],[840,"wasmedge_sdk::error"],[1317,"wasmedge_sdk::error::ExportError"],[1319,"wasmedge_sdk::error::ImportError"],[1321,"wasmedge_sdk::error::StoreError"],[1329,"wasmedge_sdk::plugin"],[1498,"wasmedge_sdk::plugin::ffi"],[1548,"wasmedge_sdk::types"],[1585,"wasmedge_sdk::utils"],[1611,"wasmedge_sdk::wasi"],[1628,"core::option"],[1629,"core::marker"],[1630,"core::marker"],[1631,"alloc::boxed"],[1632,"core::convert"],[1633,"std::path"],[1634,"std::path"],[1635,"core::fmt"],[1636,"core::fmt"],[1637,"core::fmt"],[1638,"wasmedge_sys::instance::function"],[1639,"wasmedge_sys::instance::table"],[1640,"wasmedge_sys::instance::memory"],[1641,"wasmedge_sys::instance::global"],[1642,"alloc::string"],[1643,"core::hash"],[1644,"alloc::borrow"],[1645,"core::iter::traits::collect"],[1646,"wasmedge_sys::types"],[1647,"core::time"],[1648,"core::any"],[1649,"wat"],[1650,"core::ops::function"],[1651,"core::any"],[1652,"core::ffi::c_str"],[1653,"alloc::ffi::c_str"],[1654,"core::error"],[1655,"core::cmp"],[1656,"core::default"]],"d":["The array type that can hold all the represented values.","The object used as an module instance is required to …","Represents the calling frame on top of stack.","Defines WasmEdge ahead-of-time(AOT) compiler and the …","Defines WasmEdge AOT compiler optimization level.","Defines WasmEdge AOT compiler output binary format.","Identifies an immutable global variable.","The object that is used to perform a host function is …","Contains the error value","Defines an execution environment for both pure WASM and …","Defines the types of the exported instances.","Refers to the infinite union of all references to objects …","A reference to object.","Defines the type of external WasmEdge instances.","32-bit floating-point data as defined by the IEEE 754-2019.","64-bit floating-point data as defined by the IEEE 754-2019.","Defines a host function instance.","A WasmEdge instance that is a WasmEdge Func.","Defines a reference to a host function.","Refers to the infinite union of all references to host …","A reference to a host function.","Struct of WasmEdge FuncType.","Defines a type builder for creating a FuncType instance.","Defines a WebAssembly global variable, which stores a …","A WasmEdge instance that is a WasmEdge Global.","Struct of WasmEdge GlobalType.","Defines WasmEdge host module registration enum.","32-bit integer.","64-bit integer.","Defines an import object that contains the required import …","Creates a normal or wasi import object.","Defines the types of the imported instances.","Represents an instantiated module.","Manipulates the runtime logger.","Defines a linear memory.","A WasmEdge instance that is a WasmEdge Memory.","Struct of WasmEdge MemoryType.","Defines compiled in-memory representation of an input WASM …","Defines the mutability property of WasmEdge Global …","Native dynamic library format.","This is a workaround solution to the never type in Rust. …","Disable as many optimizations as possible.","Optimize quickly without destroying debuggability.","Optimize for fast execution as much as possible without …","Optimize for fast execution as much as possible.","Contains the success value","Optimize for small code size as much as possible without …","Optimize for small code size as much as possible.","Defines WasmEdge reference types.","Used to collect statistics of the WasmEdge runtime, such …","Represents all global state that can be manipulated by …","Defines a table storing the references to host functions …","A WasmEdge instance that is a WasmEdge Table.","Struct of WasmEdge TableType.","128-bit vector of packed integer or floating-point data.","Defines WasmEdge value types.","Identifies a mutable global variable.","A Vm defines a virtual environment for managing …","Constructs a Vm instance.","The Wasm type.","","","","","","","","WebAssembly with AOT compiled codes in custom sections.","","The WasmEdge result type.","Defines the function converting a value of Rust type to …","Describes the mapping of Rust type to Wasm type.","Describes the mapping of a tuple of Rust types to Wasm …","WebAssembly value type.","Returns a reference to the active module instance from …","Returns a mutable reference to the active module instance …","Returns the types of the arguments of a host function.","Returns the number of the arguments of a host function.","Returns the raw pointer to the inner …","Returns a reference to this function instance.","Auto detect all plugins in WASMEDGE_PLUGIN_PATH","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns a function type.","Creates a new ImportObject.","Creates a new Vm.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Compiles the given wasm bytes into a shared library file (*…","Compiles the given wasm file into a shared library file (*…","Defines the structs used to construct configurations.","Checks if the store contains a named module instance.","Checks if the vm contains a named module instance.","Returns the total cost in execution.","Returns the instruction count in execution.","Returns the count of the exported WasmEdge instances from …","Returns the count of the imported WasmEdge instances in …","Returns the instruction count per second in execution.","Returns the const data pointer to this memory.","Returns the data pointer to this memory.","","","","","","","","Defines WasmEdge VmDock and Param types.","Returns the element type defined in the TableType.","","","","","","","","","","","","Defines WasmEdge error types.","Returns the executor instance from this caller.","Returns a reference to the internal executor from this vm.","Returns the mutable executor instance from this caller.","Returns a mutable reference to the internal executor from …","Returns the export types of all exported WasmEdge …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Loads a WebAssembly binary module from in-memory bytes.","Returns a validated module from a file.","Returns the exported function instance in this module …","Returns the exported function instance in this module …","Returns the count of the exported function instances in …","Returns the count of the exported function instances in …","Returns the names of the exported function instances in …","Returns the names of the exported function instances in …","Returns the table element at the index.","Gets the export type by the name of a specific exported …","Returns the current value of this Global instance.","Returns the exported global instance in this module …","Returns the exported global instance in this module …","Returns the count of the exported global instances.","Returns the count of the exported global instances in this …","Returns the names of the exported global instances in this …","Returns the names of the exported global instances in this …","Grows this memory by the count pages.","Grows the size of this table by delta, initializing the …","","Returns the host data held by the module instance.","Declare a native function that will be used to create a …","Returns the import types of all imported WasmEdge …","Returns the module instance in this caller.","Returns the mutable module instance in this caller.","Returns the names of all registered named module instances.","Returns the names of all named module instances this vm …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Logs the debug information.","Logs the error information.","Sets the logging system off.","Returns the maximum size defined in the TableType.","Returns the maximum size defined in the MemoryType.","Returns the exported memory instance in this module …","Returns the memory instance by the given index from the …","Returns the exported memory instance in this module …","Returns the count of the exported memory instances in this …","Returns the count of the exported memory instances in this …","Returns the names of the exported memory instances in this …","Returns the names of the exported memory instances in this …","Returns the minimum size defined in the TableType.","Returns the minimum size defined in the MemoryType.","Returns the name of the module instance from which this …","Returns the name of the module instance from which this …","Returns the name of the module instance from which this …","Returns the name of the module instance from which this …","Returns the name of the module hosting the imported …","Returns the value mutability property defined in the …","Returns the name of this exported module instance.","Returns the exported name of this function.","Returns the exported name of this Global instance.","Returns the exported name of this memory.","Returns the exported name of this table instance.","Returns the name of the import object.","Returns the name of this exported module instance.","Returns the imported name of the WasmEdge instance.","Returns the exported name of the WasmEdge instance.","Returns the named module instance with the given name.","Returns the number of the named module instances in this …","Returns the count of the named module instances this vm …","Returns a reference to the named module instance with the …","Returns a mutable reference to the named module instance …","Creates a Caller instance with the given CallingFrame …","Creates a new AOT compiler.","Creates a new executor to be associated with the given …","Creates a new FuncTypeBuilder.","Creates a new wasm Global instance with the given type and …","Creates a new wasm memory instance with the given type.","Creates a new wasm table instance with the given type.","Creates a new ImportObjectBuilder.","Creates a new FuncType with the given types of arguments …","Creates a new TableType with the given element type and …","Creates a new MemoryType with the given size range.","Creates a new GlobalType with the given value type and …","Creates a new Statistics.","Creates a new Store.","Creates a new VmBuilder.","Returns the size, in WebAssembly pages (64 KiB of each …","Generates arguments of WasmValue types.","Defines plugin related structs.","Safely reads memory contents at the given offset into a …","Returns a string of byte length len from this memory, …","Registers and instantiates a WasmEdge compiled module into …","Registers and instantiates a WasmEdge import object into …","Registers an import object into this vm.","Registers a wasm module into this vm as a named or active …","Registers a wasm module from the given in-memory wasm …","Registers a wasm module into the vm from a wasm file.","Registers and instantiates a WasmEdge compiled module into …","Registers a PluginInstance into this store.","Returns the types of the returns of a host function.","Returns the number of the returns of a host function.","Runs this host function and returns the result.","Runs this host function the reference refers to.","Runs a host function instance and returns the results.","Runs a host function instance and returns the results.","Runs an exported wasm function in a (named or active) …","Runs an exported wasm function from the given in-memory …","Runs an exported wasm function from the given wasm file.","Runs an exported wasm function from the given wasm module.","Runs a host function instance by calling its reference and …","Runs a host function reference instance and returns the …","Runs a host function instance with a timeout setting.","Runs an exported wasm function in a (named or active) …","Runs this host function with a timeout setting.","Stores the data at the index of this table.","Sets the cost limit in execution.","Sets the cost of instructions.","Sets a new value of this Global instance.","Returns whether the memory is shared.","Returns the byte length of this memory. The returned value …","Returns the size of this Table.","Returns a reference to the internal statistics from this …","Returns a mutable reference to the internal statistics …","Returns a reference to the internal store from this vm.","Returns a mutable reference to the internal store from …","Returns the exported table instance in this module …","Returns the exported table instance in this module instance…","Returns the count of the exported table instances in this …","Returns the count of the exported table instances in this …","Returns the names of the exported table instances in this …","Returns the names of the exported table instances in this …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns a reference to the type of the host function.","Returns a reference to the ty of the host function this …","Returns a reference to the type of this Global instance.","Returns a reference to the type of this memory.","Returns a reference to the type of this table.","Returns the type of the imported WasmEdge instance, which …","Returns the type of the exported WasmEdge instance, which …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Defines the general types.","Defines WasmEdge Driver and CoreVersion types","Returns the value type defined in the GlobalType.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Defines wasi module instance.","Returns a reference to the [wasi module instance] from …","Returns a mutable reference to the [wasi module instance] …","Get the Wasm types for the tuple (list) of currently …","","Parses in-memory bytes as either the WebAssembly Text …","Adds a single argument to the function type.","Adds arguments to the function type.","Sets the Config for the Vm to build.","Adds a host function to the ImportObject to create.","Adds a host function to the ImportObject to create.","Adds a global to the ImportObject to create.","Adds a memory to the ImportObject to create.","Set the third-party plugin for the Vm to build.","Sets the rustls plugin for the Vm to build. The rustls …","Sets the wasi_crypto plugin for the Vm to build. The …","Sets the wasi_nn plugin for the Vm to build. The wasi_nn …","Sets the wasmedge_process plugin for the Vm to build. The …","Adds a single return to the function type.","Adds returns to the function type.","Sets the Statistics for the Vm to build.","Sets the Store for the Vm to build.","Adds a table to the ImportObject to create.","Creates a host function by wrapping a native function.","Creates a host function with the given func type.","Safely writes contents of a buffer to this memory at the …","Defines the common configuration options.","Defines a group of configuration options for AOT compiler.","Defines Config struct used to check/set the configuration …","Defines a builder for creating a Config.","Defines the host registration configuration options.","Defines a group of runtime configuration options.","Defines a group of the statistics configuration options.","","","","","","","","","","","","","","","Creates a new Config from the ConfigBuilder.","Enables or disables the BulkMemoryOperations option.","Checks if the BulkMemoryOperations option turns on or not.","","","","","","","","","","","","","Checks if the cost measuring option turns on or not.","Sets the instruction counting option.","","Creates a new default instance of CommonConfigOptions.","","","","","Sets the dump IR option of AOT compiler.","Checks if the dump IR option turns on or not.","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Enables or disables the FunctionReferences option.","Checks if the FunctionReferences option turns on or not.","Sets the generic binary option of AOT compiler.","Checks if the generic binary option of AOT compiler turns …","Checks if the instruction counting option turns on or not.","Enables or disables the ForceInterpreter option.","Checks if the ForceInterpreter option turns on or not.","Enables or Disables the Interruptible option of AOT …","Checks if the Interruptible option of AOT Compiler turns …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns the number of the memory pages available.","Sets the maximum number of the memory pages available.","Sets the cost measuring option.","Sets the time measuring option.","Enables or disables the MultiMemories option.","Checks if the MultiMemories option turns on or not.","Enables or disables the MultiValue option.","Checks if the MultiValue option turns on or not.","Enables or disables the ImportExportMutGlobals option.","Checks if the ImportExportMutGlobals option turns on or …","Creates a new ConfigBuilder with the given …","Creates a new instance of CommonConfigOptions.","Creates a new instance of CompilerConfigOptions.","Creates a new instance of RuntimeConfigOptions.","Creates a new instance of StatisticsConfigOptions.","Creates a new instance of HostRegistrationConfigOptions.","Enables or disables the NonTrapFloatToIntConversions …","Checks if the NonTrapFloatToIntConversions option turns on …","Returns the optimization level of AOT compiler.","Sets the optimization level of AOT compiler.","Returns the output binary format of AOT compiler.","Sets the output binary format of AOT compiler.","Enables or disables the ReferenceTypes option.","Checks if the ReferenceTypes option turns on or not.","Enables or disables the SignExtensionOperators option.","Checks if the SignExtensionOperators option turns on or …","Enables or disables the SIMD option.","Checks if the SIMD option turns on or not.","Enables or disables the TailCall option.","Checks if the TailCall option turns on or not.","Enables or disables the Threads option.","Checks if the Threads option turns on or not.","Checks if the cost measuring option turns on or not.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Enables or disables host registration wasi.","Checks if the host registration wasi option turns on or …","Sets the CompilerConfigOptions for the ConfigBuilder.","Sets the HostRegistrationConfigOptions for the …","Sets the RuntimeConfigOptions for the ConfigBuilder.","Sets the StatisticsConfigOptions for the ConfigBuilder.","","","","","","","","Defines a type container that wraps a value of Rust …","","","","","","","","","","","","","","Extends a Vm instance by supporting function arguments of …","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Creates a new VmDock to be associated with the given Vm.","Runs an exported WASM function registered in a named or …","","","","","","","","","","","","","","","Errors raised by WasmEdge Core.","The error type for the common errors from WasmEdge Core.","The error types raised by WasmEdge Core.","The error type for the execution phase from WasmEdge Core.","The error type for the instantiation phase from WasmEdge …","The error type for the load phase from WasmEdge Core.","The error type for the validation phase from WasmEdge Core.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The error types for WasmEdge ExportType.","","","","The error types for WasmEdge Function.","","","","","","","The error types for WasmEdge Global.","","","","The error type for the host function definition.","","","","","","","The error types for WasmEdge ImportType.","","","","","","","The error types for WasmEdge Instance.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The error types for WasmEdge Memory.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The error types for WasmEdge plugin.","","","","","","","","","The error types for WasmEdge Store.","","The error types for WasmEdge Table.","","","","","","","","","","","","","","","","","","","","","","","","","","","The error types for WasmEdge Vm.","The error types used by both wasmedge-sys and wasmedge …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Define where the graph should be executed.","","","","","Describes the encoding of the graph.","","","","","Defines the type of the function that creates a module …","Preload config for initializing the wasi_nn plug-in.","","","","Represents a loaded plugin. It provides the APIs for …","Represents Plugin descriptor for plugins.","","Defines the API to manage plugins.","Defines an import object that contains the required import …","Creates a plugin module.","Defines the version of a plugin.","Defines the type of the program options.","","","","","","","","","","","Adds a module descriptor to the plugin descriptor.","Adds a program option to the plugin descriptor.","Returns the raw pointer to the inner …","Returns the raw pointer to the inner …","","","","","","","","","","","","","","","","","","","Creates a new PluginModule.","","","","","","","","","Returns the count of loaded plugins.","","","","Defines low-level types used in Plugin development.","Returns the target plugin by its name.","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","Initializes the wasmedge_process plugin module instance …","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Load plugins from the given path.","Returns the count of the module instances in this plugin.","Returns a module instance that is generated from the …","Returns the names of all module instances in this plugin.","Returns the name of this plugin.","Returns the name of the plugin module instance.","Returns the names of all loaded plugins.","Creates a new preload config.","Creates a new plugin descriptor.","Creates a new plugin version.","Creates a new PluginModuleBuilder.","Initialize the wasi_nn plug-in with the preloads.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Adds a host function to the crate::ImportObject to create.","Adds a global to the PluginModule to create.","Adds host data to the PluginModule to create.","Adds a memory to the PluginModule to create.","Adds a table to the PluginModule to create.","","","","","","","","","","","","Module descriptor for plugins.","","Plugin descriptor for plugins.","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","A reference to opaque data in the wasm instance.","A reference to opaque data in the wasm instance.","32-bit floating-point data as defined by the IEEE 754-2019.","64-bit floating-point data as defined by the IEEE 754-2019.","A reference to a host function.","32-bit integer.","64-bit integer.","128-bit vector of packed integer or floating-point data.","Defines runtime values that a WebAssembly module can …","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Creates a new instance of ExternRef wrapping the given …","","","","","","","","","","","","","The version info of WasmEdge core","Defines WasmEdge Driver functions","Triggers the WasmEdge AOT compiler tool","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Returns the major version value of WasmEdge core.","Returns the minor version value of WasmEdge core.","Returns the patch version value of WasmEdge core.","Triggers the WasmEdge runtime tool","","","","","","","Triggers the WasmEdge unified tool","Returns the version string of WasmEdge core.","","","Represents a wasi module instance.","","","","","Returns the WASI exit code.","","Returns the argument unchanged.","Initializes the WASI host module with the given parameters.","Calls U::from(self).","Returns the name of this exported module instance.","Returns the native handler from the mapped FD/Handler.","","","","",""],"i":[127,0,0,0,0,0,24,0,3,0,0,23,5,0,5,5,0,30,0,23,5,0,0,0,30,0,0,5,5,0,0,0,0,0,0,30,0,0,0,26,0,25,25,25,25,3,25,25,0,0,0,0,30,0,5,0,24,0,0,128,28,28,28,28,28,28,28,26,28,0,0,0,0,0,1,1,4,4,9,15,1,47,40,23,5,24,25,26,27,28,15,17,16,29,30,31,32,18,4,9,33,2,34,35,55,36,56,48,37,38,22,1,47,40,23,5,24,25,26,27,28,15,17,16,29,30,31,32,18,4,9,33,2,34,35,55,36,56,48,37,38,22,1,17,18,22,23,5,24,25,26,27,28,15,16,29,30,31,32,4,9,33,2,34,35,36,37,38,1,23,5,24,25,26,27,28,15,16,29,30,31,32,4,9,33,2,34,35,36,37,38,1,40,40,0,38,1,37,37,36,36,37,31,31,17,18,4,33,34,35,22,0,33,23,5,24,25,26,28,30,4,33,34,35,0,47,1,47,1,36,47,40,23,5,24,25,26,27,28,15,17,16,29,30,30,31,32,18,4,9,33,2,34,35,55,36,56,48,37,38,22,1,47,47,40,23,23,23,5,5,5,24,24,24,25,25,25,26,26,26,27,28,28,15,17,16,29,30,30,30,31,32,18,4,4,9,33,33,2,34,34,35,35,55,36,56,48,37,38,22,1,36,36,129,2,129,2,129,2,32,36,29,129,2,129,2,129,2,31,32,28,2,0,36,47,47,38,1,47,40,23,5,24,25,26,27,28,15,17,16,29,30,31,32,18,4,9,33,2,34,35,55,36,56,48,37,38,22,1,55,55,55,33,34,129,47,2,129,2,129,2,33,34,15,29,31,32,56,35,129,15,29,31,32,9,2,56,48,38,38,1,1,1,47,40,27,17,29,31,32,18,4,33,34,35,37,38,22,31,0,0,31,31,38,38,1,1,1,1,38,38,4,4,15,16,130,27,1,1,1,1,130,27,27,1,15,32,37,37,29,34,31,32,1,1,1,1,129,2,129,2,129,2,23,5,24,25,26,27,28,15,16,29,30,31,32,4,9,33,2,34,35,36,37,38,1,30,131,16,47,40,23,5,24,25,26,27,28,15,17,16,29,30,31,32,18,4,9,33,2,34,35,55,36,56,48,37,38,22,1,47,40,23,5,24,25,26,27,28,15,17,16,29,30,31,32,18,4,9,33,2,34,35,55,36,56,48,37,38,22,1,15,16,29,31,32,56,48,47,40,23,5,24,25,26,27,28,15,17,16,29,30,31,32,18,4,9,33,2,34,35,55,36,56,48,37,38,22,1,0,0,35,47,40,23,5,24,25,26,27,28,15,17,16,29,30,31,32,18,4,9,33,2,34,35,55,36,56,48,37,38,22,1,0,1,1,127,16,0,17,17,22,18,18,18,18,22,22,22,22,22,17,17,22,22,18,15,15,31,0,0,0,0,0,0,0,79,63,80,81,82,83,84,79,63,80,81,82,83,84,79,80,63,63,80,81,82,83,84,63,80,81,82,83,84,63,83,79,80,81,82,83,84,81,63,79,63,80,81,82,83,84,79,63,80,81,82,83,84,80,63,81,63,63,80,63,81,63,79,63,80,81,82,83,84,63,82,83,83,80,63,80,63,80,63,79,80,81,82,83,84,80,63,63,81,63,81,80,63,80,63,80,63,80,63,80,63,63,63,80,81,82,83,84,79,63,80,81,82,83,84,79,63,80,81,82,83,84,79,63,80,81,82,83,84,79,63,80,81,82,83,84,84,63,79,79,79,79,86,86,86,86,86,86,86,0,86,86,86,86,86,86,86,86,86,86,86,86,86,0,85,86,85,86,85,86,85,86,85,86,85,85,85,86,85,86,85,86,85,86,99,98,69,69,101,89,69,0,0,0,0,0,0,99,88,89,90,91,94,95,96,97,88,94,89,94,94,97,100,102,103,101,97,97,102,69,98,69,103,100,69,0,69,69,69,0,99,92,93,69,103,69,0,92,93,69,0,103,100,100,100,101,69,0,69,100,100,102,103,69,0,98,103,103,100,100,99,101,103,101,101,101,101,101,97,101,101,101,101,101,101,100,101,101,101,101,100,98,69,100,100,100,100,100,100,100,100,100,69,0,92,93,69,103,90,69,102,101,101,89,100,95,96,97,97,94,96,96,97,94,96,96,97,97,94,94,96,96,96,97,69,97,97,94,96,96,97,97,97,97,97,97,97,97,97,99,69,69,0,89,100,103,104,99,100,69,69,0,69,0,103,92,93,69,100,88,89,90,91,92,93,101,103,103,100,103,102,90,103,69,104,99,69,98,69,69,0,0,69,103,103,99,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,69,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,69,69,69,69,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,69,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,132,132,133,133,134,135,136,134,137,136,135,137,117,116,117,0,112,112,116,117,0,112,112,112,112,0,0,112,116,116,0,0,0,0,0,0,0,0,116,112,117,116,116,112,112,112,112,112,110,110,110,114,121,116,117,122,120,110,123,115,114,121,116,117,122,120,110,123,115,114,115,116,117,114,116,117,114,116,117,122,115,116,117,0,122,121,121,116,116,117,117,122,120,110,123,115,114,121,116,117,122,120,110,123,115,114,121,116,117,122,123,121,116,117,122,120,110,123,115,114,122,120,120,120,120,114,122,121,110,123,115,122,116,117,116,117,114,121,116,117,121,116,117,122,120,110,123,115,114,121,116,117,122,120,110,123,115,114,121,116,117,122,120,110,123,115,114,121,116,117,122,120,110,123,115,114,115,115,115,115,115,113,124,124,113,113,113,124,113,113,113,113,0,0,0,10,124,113,10,124,113,10,124,113,10,124,113,10,124,113,10,124,113,10,124,113,10,124,113,10,124,113,10,124,113,10,124,113,10,124,113,0,66,66,66,66,66,66,66,0,66,125,66,125,66,125,66,125,66,125,66,66,125,66,125,125,66,125,125,66,125,66,125,66,125,66,125,125,0,0,126,138,126,138,126,126,138,126,138,126,138,138,138,126,138,126,138,126,138,126,126,138,138,126,0,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[1,[[3,[2]]]],[4,[[7,[[6,[5]]]]]],[4,8],[[[9,[-1]]],10,[11,12,13,14]],[15,16],[1,[[3,[1]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[17,4],[[18,-1,[7,[[19,[-2]]]]],[[3,[[9,[-2]]]]],[[21,[20]]],[11,12,13,14]],[22,[[3,[1]]]],[23,23],[5,5],[24,24],[25,25],[26,26],[27,27],[28,28],[15,15],[16,16],[29,29],[30,30],[31,31],[32,32],[4,4],[[[9,[-1]]],[[9,[-1]]],[14,11,12,13,14]],[33,33],[2,2],[34,34],[35,35],[36,36],[37,37],[38,38],[1,1],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[40,-1,-2,-3],[[3,[41]]],[[21,[[6,[42]]]]],[[21,[20]]],[[21,[43]]]],[[40,-1,-2,-3],[[3,[41]]],[[21,[43]]],[[21,[20]]],[[21,[43]]]],0,[[38,-1],44,[[21,[20]]]],[[1,-1],44,[[21,[20]]]],[37,45],[37,45],[36,8],[36,8],[37,46],[[31,8,8],[[3,[42]]]],[[31,8,8],[[3,[42]]]],[[],17],[[],18],[[],4],[[],33],[[],34],[[],35],[[],22],0,[33,23],[[23,23],44],[[5,5],44],[[24,24],44],[[25,25],44],[[26,26],44],[[28,28],44],[[30,30],44],[[4,4],44],[[33,33],44],[[34,34],44],[[35,35],44],0,[47,[[7,[27]]]],[1,27],[47,[[7,[27]]]],[1,27],[36,[[49,[48]]]],[[47,50],51],[[40,50],51],[[23,50],[[53,[39,52]]]],[[5,50],[[53,[39,52]]]],[[24,50],[[53,[39,52]]]],[[25,50],[[53,[39,52]]]],[[26,50],[[53,[39,52]]]],[[27,50],51],[[28,50],[[53,[39,52]]]],[[15,50],51],[[17,50],51],[[16,50],51],[[29,50],51],[[30,50],[[53,[39,52]]]],[[30,50],[[53,[39,52]]]],[[31,50],51],[[32,50],51],[[18,50],51],[[4,50],[[53,[39,52]]]],[[[9,[-1]],50],51,[54,11,12,13,14]],[[33,50],[[53,[39,52]]]],[[2,50],51],[[34,50],[[53,[39,52]]]],[[35,50],[[53,[39,52]]]],[[55,50],51],[[36,50],51],[[56,50],51],[[48,50],51],[[37,50],51],[[38,50],51],[[22,50],51],[[1,50],51],[57,47],[-1,-1,[]],[-1,-1,[]],[8,23],[58,23],[-1,-1,[]],[-1,-1,[]],[8,5],[58,5],[8,24],[-1,-1,[]],[58,24],[8,25],[58,25],[-1,-1,[]],[-1,-1,[]],[58,26],[8,26],[-1,-1,[]],[-1,-1,[]],[8,28],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[8,30],[-1,-1,[]],[58,30],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[59,4],[-1,-1,[]],[-1,-1,[]],[60,33],[-1,-1,[]],[-1,-1,[]],[61,34],[-1,-1,[]],[-1,-1,[]],[62,35],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[7,[63]],-1],[[3,[36]]],[[21,[[6,[42]]]]]],[[[7,[63]],-1],[[3,[36]]],[[21,[43]]]],[[-1,-2],[[3,[15]]],[],[[21,[20]]]],[[2,-1],[[3,[15]]],[[21,[20]]]],[-1,64,[]],[2,64],[-1,[[7,[[49,[65]]]]],[]],[2,[[7,[[49,[65]]]]]],[[32,8],[[3,[66]]]],[[36,-1],[[7,[30]]],[[21,[20]]]],[29,66],[[-1,-2],[[3,[29]]],[],[[21,[20]]]],[[2,-1],[[3,[29]]],[[21,[20]]]],[-1,64,[]],[2,64],[-1,[[7,[[49,[65]]]]],[]],[2,[[7,[[49,[65]]]]]],[[31,8],[[3,[39]]]],[[32,8,[7,[66]]],[[3,[8]]]],[[28,-1],39,67],[2,[[7,[-1]]],[12,13,14]],0,[36,[[49,[56]]]],[47,[[7,[2]]]],[47,[[7,[2]]]],[38,[[49,[65]]]],[1,[[49,[65]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[],39],[[],39],[[],39],[33,[[7,[8]]]],[34,[[7,[8]]]],[[-1,-2],[[3,[31]]],[],[[21,[20]]]],[[47,8],[[7,[31]]]],[[2,-1],[[3,[31]]],[[21,[20]]]],[-1,64,[]],[2,64],[-1,[[7,[[49,[65]]]]],[]],[2,[[7,[[49,[65]]]]]],[33,8],[34,8],[15,[[7,[20]]]],[29,[[7,[20]]]],[31,[[7,[20]]]],[32,[[7,[20]]]],[56,[[68,[20]]]],[35,24],[-1,20,[]],[15,[[7,[20]]]],[29,[[7,[20]]]],[31,[[7,[20]]]],[32,[[7,[20]]]],[[[9,[-1]]],20,[11,12,13,14]],[2,[[7,[65]]]],[56,[[68,[20]]]],[48,[[68,[20]]]],[[38,-1],[[3,[2]]],[[21,[20]]]],[38,8],[1,8],[[1,-1],[[3,[2]]],[[21,[20]]]],[[1,-1],[[3,[2]]],[[21,[20]]]],[57,47],[[[7,[63]]],[[3,[40]]]],[[[7,[63]],[7,[37]]],[[3,[27]]]],[[],17],[[35,66],[[3,[29]]]],[34,[[3,[31]]]],[33,[[3,[32]]]],[[],18],[[[7,[[49,[5]]]],[7,[[49,[5]]]]],4],[[23,8,[7,[8]]],33],[[8,[7,[8]],44],[[53,[34,[19,[69]]]]]],[[5,24],35],[[],[[3,[37]]]],[[],[[3,[38]]]],[[],22],[31,8],0,0,[[31,8,8],[[3,[[49,[42]]]]]],[[31,8,8],[[3,[65]]]],[[38,27,36],[[3,[2]]]],[[38,27,[9,[-1]]],[[3,[39]]],[11,12,13,14]],[[1,[9,[-1]]],[[3,[39]]],[11,12,13,14]],[[1,[7,[20]],36],[[3,[1]]]],[[1,-1,-2],[[3,[1]]],[[21,[20]]],[[21,[[6,[42]]]]]],[[1,-1,-2],[[3,[1]]],[[21,[20]]],[[21,[43]]]],[[38,27,-1,36],[[3,[2]]],[[21,[20]]]],[[38,27,70],[[3,[39]]]],[4,[[7,[[6,[5]]]]]],[4,8],[[15,27,-1],[[3,[[49,[71]]]]],72],[[16,27,-1],[[3,[[49,[71]]]]],72],[[-1,15,-2],[[3,[[49,[71]]]]],[],72],[[27,15,-1],[[3,[[49,[71]]]]],72],[[1,[7,[20]],-1,-2],[[3,[[49,[71]]]]],[[21,[20]]],72],[[1,[6,[42]],-1,-2],[[3,[[49,[73]]]]],[[21,[20]]],72],[[1,-1,-2,-3],[[3,[[49,[71]]]]],[[21,[43]]],[[21,[20]]],72],[[1,36,-1,-2],[[3,[[49,[73]]]]],[[21,[20]]],72],[[-1,16,-2],[[3,[[49,[71]]]]],[],72],[[27,16,-1],[[3,[[49,[71]]]]],72],[[27,15,-1,74],[[3,[[49,[71]]]]],72],[[1,[7,[20]],-1,-2,74],[[3,[[49,[71]]]]],[[21,[20]]],72],[[15,27,-1,74],[[3,[[49,[71]]]]],72],[[32,8,66],[[3,[39]]]],[[37,45],39],[[37,-1],39,[[21,[[6,[45]]]]]],[[29,66],[[3,[39]]]],[34,44],[31,45],[32,8],[1,[[7,[37]]]],[1,[[7,[37]]]],[1,38],[1,38],[[-1,-2],[[3,[32]]],[],[[21,[20]]]],[[2,-1],[[3,[32]]],[[21,[20]]]],[-1,64,[]],[2,64],[-1,[[7,[[49,[65]]]]],[]],[2,[[7,[[49,[65]]]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,65,[]],[-1,71,[]],[16,71],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[15,4],[16,4],[29,35],[31,34],[32,33],[56,[[3,[30]]]],[48,[[3,[30]]]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],0,0,[35,5],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[1,[[7,[76]]]],[1,[[7,[76]]]],[[],[[6,[5]]]],[[],[[6,[5]]]],[[[6,[42]]],[[53,[[68,[[6,[42]]]],77]]]],[[17,5],17],[[17,-1],17,72],[[22,63],22],[[18,-1,-2,[7,[[19,[-3]]]]],[[3,[18]]],[[21,[20]]],[78,12,13],[]],[[18,-1,4,-2,[7,[[19,[-3]]]]],[[3,[18]]],[[21,[20]]],[78,12,13],[]],[[18,-1,29],18,[[21,[20]]]],[[18,-1,31],18,[[21,[20]]]],[[22,-1,[7,[[49,[20]]]]],22,[[21,[20]]]],[22,22],[22,22],[22,22],[22,22],[[17,5],17],[[17,-1],17,72],[[22,37],22],[[22,38],22],[[18,-1,32],18,[[21,[20]]]],[[-1,[7,[[19,[-2]]]]],[[3,[15]]],[78,12,13],[]],[[4,-1,[7,[[19,[-2]]]]],[[3,[15]]],[78,12,13],[]],[[31,-1,8],[[3,[39]]],[[21,[[6,[42]]]]]],0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[79,[[3,[63]]]],[[80,44],80],[63,44],[63,63],[80,80],[81,81],[82,82],[83,83],[84,84],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[63,44],[[83,44],83],[[],79],[[],80],[[],81],[[],82],[[],83],[[],84],[[81,44],81],[63,44],[[79,50],51],[[63,50],51],[[80,50],51],[[81,50],51],[[82,50],51],[[83,50],51],[[84,50],51],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[80,44],80],[63,44],[[81,44],81],[63,44],[63,44],[[80,44],80],[63,44],[[81,44],81],[63,44],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[63,8],[[82,8],82],[[83,44],83],[[83,44],83],[[80,44],80],[63,44],[[80,44],80],[63,44],[[80,44],80],[63,44],[80,79],[[],80],[[],81],[[],82],[[],83],[[],84],[[80,44],80],[63,44],[63,25],[[81,25],81],[63,26],[[81,26],81],[[80,44],80],[63,44],[[80,44],80],[63,44],[[80,44],80],[63,44],[[80,44],80],[63,44],[[80,44],80],[63,44],[63,44],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[84,44],84],[63,44],[[79,81],79],[[79,84],79],[[79,82],79],[[79,83],79],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[85,50],51],[[86,50],51],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[1,85],[[85,-1,[49,[86]]],[[3,[[53,[[49,[[19,[87]]]],65]]]]],[[21,[20]]]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,75,[]],[-1,75,[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[69,69],[88,88],[89,89],[90,90],[91,91],[92,92],[93,93],[94,94],[95,95],[96,96],[97,97],[98,98],[99,99],[100,100],[101,101],[102,102],[103,103],[104,104],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[69,69],44],[[88,88],44],[[89,89],44],[[90,90],44],[[91,91],44],[[92,92],44],[[93,93],44],[[94,94],44],[[95,95],44],[[96,96],44],[[97,97],44],[[98,98],44],[[99,99],44],[[100,100],44],[[101,101],44],[[102,102],44],[[103,103],44],[[104,104],44],[[69,50],[[53,[39,52]]]],[[69,50],[[53,[39,52]]]],[[88,50],[[53,[39,52]]]],[[88,50],[[53,[39,52]]]],[[89,50],[[53,[39,52]]]],[[89,50],[[53,[39,52]]]],[[90,50],[[53,[39,52]]]],[[90,50],[[53,[39,52]]]],[[91,50],[[53,[39,52]]]],[[91,50],[[53,[39,52]]]],[[92,50],[[53,[39,52]]]],[[92,50],[[53,[39,52]]]],[[93,50],[[53,[39,52]]]],[[93,50],[[53,[39,52]]]],[[94,50],[[53,[39,52]]]],[[94,50],[[53,[39,52]]]],[[95,50],[[53,[39,52]]]],[[95,50],[[53,[39,52]]]],[[96,50],[[53,[39,52]]]],[[96,50],[[53,[39,52]]]],[[97,50],[[53,[39,52]]]],[[97,50],[[53,[39,52]]]],[[98,50],[[53,[39,52]]]],[[98,50],[[53,[39,52]]]],[[99,50],[[53,[39,52]]]],[[99,50],[[53,[39,52]]]],[[100,50],[[53,[39,52]]]],[[100,50],[[53,[39,52]]]],[[101,50],[[53,[39,52]]]],[[101,50],[[53,[39,52]]]],[[102,50],[[53,[39,52]]]],[[102,50],[[53,[39,52]]]],[[103,50],[[53,[39,52]]]],[[103,50],[[53,[39,52]]]],[[104,50],[[53,[39,52]]]],[[104,50],[[53,[39,52]]]],[105,69],[106,69],[107,69],[108,69],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[69,[[7,[109]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[110,-1,-2,[7,[111]]],[[3,[110]]],[[21,[20]]],[[21,[20]]]],[[110,-1,-2,112],[[3,[110]]],[[21,[20]]],[[21,[20]]]],[110,113],[114,10],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[115,[-1]],-2],[[3,[114]]],[11,12,13,14],[[21,[20]]]],[116,116],[117,117],[114,114],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[116,116],118],[[117,117],118],[[],8],[[],[[115,[-1]]],[119,11,12,13,14]],[[116,116],44],[[117,117],44],0,[-1,[[3,[120]]],[[21,[20]]]],[[121,50],51],[[121,50],51],[[116,50],51],[[116,50],51],[[117,50],51],[[117,50],51],[[122,50],51],[[120,50],51],[[110,50],51],[[123,50],51],[[[115,[-1]],50],51,[54,11,12,13,14]],[[114,50],51],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[20,[[53,[121]]]],[20,[[53,[116]]]],[20,[[53,[117]]]],[[[7,[[49,[20]]]],44],39],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[7,[43]]],[[3,[39]]]],[120,8],[[120,-1],[[3,[70]]],[[21,[20]]]],[120,[[49,[65]]]],[120,65],[114,20],[[],[[49,[65]]]],[[-1,116,117,-2],121,[[21,[20]]],[[21,[43]]]],[[-1,-2,123],[[3,[110]]],[[21,[20]]],[[21,[20]]]],[[8,8,8,8],123],[[],[[115,[-1]]],[11,12,13,14]],[[[49,[121]]],39],[[116,116],[[7,[118]]]],[[117,117],[[7,[118]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,65,[]],[-1,65,[]],[-1,65,[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[115,[-1]],-2,-3,[7,[[19,[-4]]]]],[[3,[[115,[-1]]]]],[11,12,13,14],[[21,[20]]],[78,12,13],[]],[[[115,[-1]],-2,29],[[115,[-1]]],[11,12,13,14],[[21,[20]]]],[[[115,[-1]],[19,[-1]]],[[115,[-1]]],[11,12,13,14]],[[[115,[-1]],-2,31],[[115,[-1]]],[11,12,13,14],[[21,[20]]]],[[[115,[-1]],-2,32],[[115,[-1]]],[11,12,13,14],[[21,[20]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[10,10],[124,124],[113,113],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[10,50],[[53,[39,52]]]],[[124,50],[[53,[39,52]]]],[[113,50],[[53,[39,52]]]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,75,[]],[-1,75,[]],[-1,75,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[66,66],[125,125],[[-1,-2],39,[],[]],[[-1,-2],39,[],[]],[[66,50],51],[[125,50],51],[73,66],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,125,[12,13]],[-1,-2,[],[]],[-1,-2,[],[]],[125,71],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,75,[]],[-1,75,[]],[-1,-2,[],[]],[-1,-2,[],[]],[[],[[6,[5]]]],0,0,[-1,58,72],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[126,50],51],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[[],8],[[],8],[[],8],[-1,58,72],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,75,[]],[-1,75,[]],[-1,58,72],[[],65],[-1,-2,[],[]],[-1,-2,[],[]],0,[-1,-2,[],[]],[-1,-2,[],[]],[76,76],[[-1,-2],39,[],[]],[76,8],[[76,50],51],[-1,-1,[]],[[76,[7,[[49,[20]]]],[7,[[49,[20]]]],[7,[[49,[20]]]]],39],[-1,-2,[],[]],[76,20],[[76,58],[[3,[45]]]],[-1,-2,[],[]],[-1,[[53,[-2]]],[],[]],[-1,[[53,[-2]]],[],[]],[-1,75,[]],[-1,-2,[],[]]],"c":[],"p":[[3,"Vm",0],[3,"Instance",0],[6,"WasmEdgeResult",0],[3,"FuncType",0],[4,"ValType",0],[15,"slice"],[4,"Option",1628],[15,"u32"],[3,"ImportObject",0],[3,"WasmEdge_ModuleInstanceContext",1498],[8,"Sized",1629],[8,"Send",1629],[8,"Sync",1629],[8,"Clone",1630],[3,"Func",0],[3,"FuncRef",0],[3,"FuncTypeBuilder",0],[3,"ImportObjectBuilder",0],[3,"Box",1631],[15,"str"],[8,"AsRef",1632],[3,"VmBuilder",0],[4,"RefType",0],[4,"Mutability",0],[4,"CompilerOptimizationLevel",0],[4,"CompilerOutputFormat",0],[3,"Executor",0],[4,"HostRegistration",0],[3,"Global",0],[4,"ExternalInstanceType",0],[3,"Memory",0],[3,"Table",0],[3,"TableType",0],[3,"MemoryType",0],[3,"GlobalType",0],[3,"Module",0],[3,"Statistics",0],[3,"Store",0],[15,"tuple"],[3,"Compiler",0],[3,"PathBuf",1633],[15,"u8"],[3,"Path",1633],[15,"bool"],[15,"u64"],[15,"f64"],[3,"Caller",0],[3,"ExportType",0],[3,"Vec",1634],[3,"Formatter",1635],[6,"Result",1635],[3,"Error",1635],[4,"Result",1636],[8,"Debug",1635],[3,"LogManager",0],[3,"ImportType",0],[3,"CallingFrame",1637],[15,"i32"],[3,"FuncType",1638],[3,"TableType",1639],[3,"MemType",1640],[3,"GlobalType",1641],[3,"Config",649],[15,"usize"],[3,"String",1642],[4,"Val",1548],[8,"Hasher",1643],[4,"Cow",1644],[4,"WasmEdgeError",840],[6,"PluginInstance",1329],[6,"WasmValue",0],[8,"IntoIterator",1645],[3,"WasmValue",1646],[3,"Duration",1647],[3,"TypeId",1648],[3,"WasiInstance",1611],[3,"Error",1649],[8,"Fn",1650],[3,"ConfigBuilder",649],[3,"CommonConfigOptions",649],[3,"CompilerConfigOptions",649],[3,"RuntimeConfigOptions",649],[3,"StatisticsConfigOptions",649],[3,"HostRegistrationConfigOptions",649],[3,"VmDock",798],[4,"Param",798],[8,"Any",1648],[4,"FuncError",840],[4,"MemError",840],[4,"GlobalError",840],[4,"TableError",840],[4,"ImportError",840],[4,"ExportError",840],[4,"InstanceError",840],[4,"PluginError",840],[4,"StoreError",840],[4,"VmError",840],[4,"CoreError",840],[4,"CoreCommonError",840],[4,"CoreLoadError",840],[4,"CoreValidationError",840],[4,"CoreInstantiationError",840],[4,"CoreExecutionError",840],[4,"HostFuncError",840],[3,"FromUtf8Error",1642],[3,"Utf8Error",1651],[3,"FromBytesWithNulError",1652],[3,"NulError",1653],[8,"Error",1654],[3,"PluginDescriptor",1329],[6,"ModuleInstanceCreateFn",1329],[6,"ProgramOptionType",1329],[3,"WasmEdge_PluginDescriptor",1498],[3,"PluginModule",1329],[3,"PluginModuleBuilder",1329],[4,"GraphEncoding",1329],[4,"ExecutionTarget",1329],[4,"Ordering",1655],[8,"Default",1656],[3,"Plugin",1329],[3,"NNPreload",1329],[3,"PluginManager",1329],[3,"PluginVersion",1329],[3,"WasmEdge_ModuleDescriptor",1498],[3,"ExternRef",1548],[3,"Driver",1585],[8,"WasmValTypeList",0],[8,"WasmValType",0],[8,"AsInstance",0],[8,"Engine",0],[8,"WasmVal",0],[13,"Type",1317],[13,"Type",1319],[13,"NotFoundFuncRegistered",1321],[13,"NotFoundGlobalRegistered",1321],[13,"NotFoundMemRegistered",1321],[13,"NotFoundTableRegistered",1321],[3,"CoreVersion",1585]],"b":[[243,"impl-Display-for-ExternalInstanceType"],[244,"impl-Debug-for-ExternalInstanceType"],[265,"impl-From%3Cu32%3E-for-RefType"],[266,"impl-From%3Ci32%3E-for-RefType"],[269,"impl-From%3Cu32%3E-for-ValType"],[270,"impl-From%3Ci32%3E-for-ValType"],[271,"impl-From%3Cu32%3E-for-Mutability"],[273,"impl-From%3Ci32%3E-for-Mutability"],[274,"impl-From%3Cu32%3E-for-CompilerOptimizationLevel"],[275,"impl-From%3Ci32%3E-for-CompilerOptimizationLevel"],[278,"impl-From%3Ci32%3E-for-CompilerOutputFormat"],[279,"impl-From%3Cu32%3E-for-CompilerOutputFormat"],[287,"impl-From%3Cu32%3E-for-ExternalInstanceType"],[289,"impl-From%3Ci32%3E-for-ExternalInstanceType"],[1132,"impl-Debug-for-WasmEdgeError"],[1133,"impl-Display-for-WasmEdgeError"],[1134,"impl-Display-for-FuncError"],[1135,"impl-Debug-for-FuncError"],[1136,"impl-Debug-for-MemError"],[1137,"impl-Display-for-MemError"],[1138,"impl-Display-for-GlobalError"],[1139,"impl-Debug-for-GlobalError"],[1140,"impl-Debug-for-TableError"],[1141,"impl-Display-for-TableError"],[1142,"impl-Debug-for-ImportError"],[1143,"impl-Display-for-ImportError"],[1144,"impl-Display-for-ExportError"],[1145,"impl-Debug-for-ExportError"],[1146,"impl-Display-for-InstanceError"],[1147,"impl-Debug-for-InstanceError"],[1148,"impl-Display-for-PluginError"],[1149,"impl-Debug-for-PluginError"],[1150,"impl-Debug-for-StoreError"],[1151,"impl-Display-for-StoreError"],[1152,"impl-Display-for-VmError"],[1153,"impl-Debug-for-VmError"],[1154,"impl-Debug-for-CoreError"],[1155,"impl-Display-for-CoreError"],[1156,"impl-Display-for-CoreCommonError"],[1157,"impl-Debug-for-CoreCommonError"],[1158,"impl-Display-for-CoreLoadError"],[1159,"impl-Debug-for-CoreLoadError"],[1160,"impl-Debug-for-CoreValidationError"],[1161,"impl-Display-for-CoreValidationError"],[1162,"impl-Display-for-CoreInstantiationError"],[1163,"impl-Debug-for-CoreInstantiationError"],[1164,"impl-Display-for-CoreExecutionError"],[1165,"impl-Debug-for-CoreExecutionError"],[1166,"impl-Display-for-HostFuncError"],[1167,"impl-Debug-for-HostFuncError"],[1168,"impl-From%3CFromUtf8Error%3E-for-WasmEdgeError"],[1169,"impl-From%3CUtf8Error%3E-for-WasmEdgeError"],[1170,"impl-From%3CFromBytesWithNulError%3E-for-WasmEdgeError"],[1171,"impl-From%3CNulError%3E-for-WasmEdgeError"],[1402,"impl-Debug-for-NNPreload"],[1403,"impl-Display-for-NNPreload"],[1404,"impl-Display-for-GraphEncoding"],[1405,"impl-Debug-for-GraphEncoding"],[1406,"impl-Display-for-ExecutionTarget"],[1407,"impl-Debug-for-ExecutionTarget"]]},\ +"wasmedge_sys":{"doc":"Overview","t":"IIDDDIDDDDDDDDDDDDDDDDDDDNEDDKLKLKLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKLLLLLLKKLKKKKLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKLLLLLLLLLLLLKLLLLLALLLLLLLKLKLLLLLLLLLLKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLAALLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMRRRRRRRRRRRRRRRRRRRRMMMMMMMMMMNNRRMMMRRRMNNMMMRRRRRRRRRRMMRRRRRRDFFFFFDFFFFFFDFFFFFDFFGRRRRRRGRRFFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFFFGRRGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRFDFFFFFFFFDFFFFFFGRRRRDFFFFFDFFFFFFDFFFFFDFFFFGGRDFFFFFFFDFDFFFFFFFDFFFFFFFFFDFFFDFFFFDFFFFFFFFFFFFFFFFFFFFFFGRRGRRRRRDFDFFFFFFFFFDRFDGRRRRRRRRRRRRRGRRRRRRRRRRRRRRRGRRDFFFFFFDFFFFFFFDFFFFFDFFFFFFDFFFFFFFDFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFGRRRRRRRDFFFDFFFFFFFFFFFFFFFFFFFFGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRGGGRGGGGGGGGGDGGRGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLAAAAAGDDDLLLLLLLLLLLLLLDDLLLLLLLLLDDLLLLLLLLLLLLLLIIDDNEDKKKKLLLLLLLKLKLKLKLKLLKLKLKLLLKLKLKLLLKLKLDDLLLLLLLLLLLLNNNNNNDGNDDDDDDENNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLMMLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLLFFFFFFFFFF","n":["AsImport","AsInstance","CallingFrame","Compiler","Config","Engine","Executor","ExportType","FuncRef","FuncType","Function","Global","GlobalType","ImportModule","ImportType","Instance","Loader","MemType","Memory","Module","Statistics","Store","Table","TableType","Validator","Wasi","WasiInstance","WasiModule","WasmValue","add_func","add_func","add_global","add_global","add_memory","add_memory","add_table","add_table","annotations","annotations_enabled","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","bulk_memory_operations","bulk_memory_operations_enabled","call_func","call_func_ref","call_func_with_timeout","clear","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","compile_from_bytes","compile_from_file","contains","cost_in_total","count_instructions","count_of_exports","count_of_imports","create","create","create","create","create","create","create","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","dump_ir","dump_ir_enabled","exception_handling","exception_handling_enabled","exports","ffi","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","frame","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_bytes","from_file","func_len","func_names","function_references","function_references_enabled","generic_binary","generic_binary_enabled","get_aot_compiler_output_format","get_aot_optimization_level","get_func","get_global","get_max_memory_pages","get_memory","get_table","global_len","global_names","imports","instance","instr_count","instr_per_sec","interpreter_mode","interpreter_mode_enabled","interruptible","interruptible_enabled","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","is_cost_measuring","is_instruction_counting","is_time_measuring","measure_cost","measure_time","mem_len","mem_names","memory64","memory64_enabled","module","module_len","module_name","module_names","multi_memories","multi_memories_enabled","multi_value","multi_value_enabled","mutable_globals","mutable_globals_enabled","name","name","name","name","non_trap_conversions","non_trap_conversions_enabled","plugin","reference_types","reference_types_enabled","register_active_module","register_import_module","register_named_module","register_plugin_instance","register_wasi_instance","run_func","run_func","run_func_ref","run_func_ref","set_aot_compiler_output_format","set_aot_optimization_level","set_cost_limit","set_cost_table","set_max_memory_pages","sign_extension_operators","sign_extension_operators_enabled","simd","simd_enabled","table_len","table_names","tail_call","tail_call_enabled","threads","threads_enabled","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","ty","ty","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","types","utils","validate","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wasi","wasi_enabled","APIVersion","Buf","Build","Code","Create","DefaultValue","Description","Description","Description","HasMax","INT16_MAX","INT16_MIN","INT32_MAX","INT32_MIN","INT8_MAX","INT8_MIN","INTPTR_MAX","INTPTR_MIN","INT_FAST16_MAX","INT_FAST16_MIN","INT_FAST32_MAX","INT_FAST32_MIN","INT_FAST8_MAX","INT_FAST8_MIN","INT_LEAST16_MAX","INT_LEAST16_MIN","INT_LEAST32_MAX","INT_LEAST32_MIN","INT_LEAST8_MAX","INT_LEAST8_MIN","Length","Major","Max","Min","Minor","ModuleCount","ModuleDescriptions","Name","Name","Name","None","None","PTRDIFF_MAX","PTRDIFF_MIN","Patch","ProgramOptionCount","ProgramOptions","SIG_ATOMIC_MAX","SIG_ATOMIC_MIN","SIZE_MAX","Shared","Some","Some","Storage","Type","Type","UINT16_MAX","UINT32_MAX","UINT8_MAX","UINTPTR_MAX","UINT_FAST16_MAX","UINT_FAST32_MAX","UINT_FAST8_MAX","UINT_LEAST16_MAX","UINT_LEAST32_MAX","UINT_LEAST8_MAX","Value","Version","WASMEDGE_VERSION","WASMEDGE_VERSION_MAJOR","WASMEDGE_VERSION_MINOR","WASMEDGE_VERSION_PATCH","WINT_MAX","WINT_MIN","WasmEdge_ASTModuleContext","WasmEdge_ASTModuleDelete","WasmEdge_ASTModuleListExports","WasmEdge_ASTModuleListExportsLength","WasmEdge_ASTModuleListImports","WasmEdge_ASTModuleListImportsLength","WasmEdge_Async","WasmEdge_AsyncCancel","WasmEdge_AsyncDelete","WasmEdge_AsyncGet","WasmEdge_AsyncGetReturnsLength","WasmEdge_AsyncWait","WasmEdge_AsyncWaitFor","WasmEdge_CallingFrameContext","WasmEdge_CallingFrameGetExecutor","WasmEdge_CallingFrameGetMemoryInstance","WasmEdge_CallingFrameGetModuleInstance","WasmEdge_CompilerCompile","WasmEdge_CompilerCompileFromBuffer","WasmEdge_CompilerContext","WasmEdge_CompilerCreate","WasmEdge_CompilerDelete","WasmEdge_CompilerOptimizationLevel","WasmEdge_CompilerOptimizationLevel_O0","WasmEdge_CompilerOptimizationLevel_O1","WasmEdge_CompilerOptimizationLevel_O2","WasmEdge_CompilerOptimizationLevel_O3","WasmEdge_CompilerOptimizationLevel_Os","WasmEdge_CompilerOptimizationLevel_Oz","WasmEdge_CompilerOutputFormat","WasmEdge_CompilerOutputFormat_Native","WasmEdge_CompilerOutputFormat_Wasm","WasmEdge_ConfigureAddHostRegistration","WasmEdge_ConfigureAddProposal","WasmEdge_ConfigureCompilerGetOptimizationLevel","WasmEdge_ConfigureCompilerGetOutputFormat","WasmEdge_ConfigureCompilerIsDumpIR","WasmEdge_ConfigureCompilerIsGenericBinary","WasmEdge_ConfigureCompilerIsInterruptible","WasmEdge_ConfigureCompilerSetDumpIR","WasmEdge_ConfigureCompilerSetGenericBinary","WasmEdge_ConfigureCompilerSetInterruptible","WasmEdge_ConfigureCompilerSetOptimizationLevel","WasmEdge_ConfigureCompilerSetOutputFormat","WasmEdge_ConfigureContext","WasmEdge_ConfigureCreate","WasmEdge_ConfigureDelete","WasmEdge_ConfigureGetMaxMemoryPage","WasmEdge_ConfigureHasHostRegistration","WasmEdge_ConfigureHasProposal","WasmEdge_ConfigureIsAllowAFUNIX","WasmEdge_ConfigureIsForceInterpreter","WasmEdge_ConfigureRemoveHostRegistration","WasmEdge_ConfigureRemoveProposal","WasmEdge_ConfigureSetAllowAFUNIX","WasmEdge_ConfigureSetForceInterpreter","WasmEdge_ConfigureSetMaxMemoryPage","WasmEdge_ConfigureStatisticsIsCostMeasuring","WasmEdge_ConfigureStatisticsIsInstructionCounting","WasmEdge_ConfigureStatisticsIsTimeMeasuring","WasmEdge_ConfigureStatisticsSetCostMeasuring","WasmEdge_ConfigureStatisticsSetInstructionCounting","WasmEdge_ConfigureStatisticsSetTimeMeasuring","WasmEdge_Driver_Compiler","WasmEdge_Driver_Tool","WasmEdge_Driver_UniTool","WasmEdge_ErrCategory","WasmEdge_ErrCategory_UserLevelError","WasmEdge_ErrCategory_WASM","WasmEdge_ErrCode","WasmEdge_ErrCode_AOTDisabled","WasmEdge_ErrCode_ConstExprRequired","WasmEdge_ErrCode_CostLimitExceeded","WasmEdge_ErrCode_DataCountRequired","WasmEdge_ErrCode_DataSegDoesNotFit","WasmEdge_ErrCode_DivideByZero","WasmEdge_ErrCode_DupExportName","WasmEdge_ErrCode_ENDCodeExpected","WasmEdge_ErrCode_ElemSegDoesNotFit","WasmEdge_ErrCode_ExpectSharedMemory","WasmEdge_ErrCode_ExpectedZeroByte","WasmEdge_ErrCode_FuncNotFound","WasmEdge_ErrCode_FuncSigMismatch","WasmEdge_ErrCode_HostFuncError","WasmEdge_ErrCode_IllegalGrammar","WasmEdge_ErrCode_IllegalOpCode","WasmEdge_ErrCode_IllegalPath","WasmEdge_ErrCode_ImmutableGlobal","WasmEdge_ErrCode_IncompatibleDataCount","WasmEdge_ErrCode_IncompatibleFuncCode","WasmEdge_ErrCode_IncompatibleImportType","WasmEdge_ErrCode_IndirectCallTypeMismatch","WasmEdge_ErrCode_InstrTypeMismatch","WasmEdge_ErrCode_IntegerOverflow","WasmEdge_ErrCode_IntegerTooLarge","WasmEdge_ErrCode_IntegerTooLong","WasmEdge_ErrCode_Interrupted","WasmEdge_ErrCode_IntrinsicsTableNotFound","WasmEdge_ErrCode_InvalidAlignment","WasmEdge_ErrCode_InvalidConvToInt","WasmEdge_ErrCode_InvalidDataIdx","WasmEdge_ErrCode_InvalidElemIdx","WasmEdge_ErrCode_InvalidFuncIdx","WasmEdge_ErrCode_InvalidFuncTypeIdx","WasmEdge_ErrCode_InvalidGlobalIdx","WasmEdge_ErrCode_InvalidLabelIdx","WasmEdge_ErrCode_InvalidLaneIdx","WasmEdge_ErrCode_InvalidLimit","WasmEdge_ErrCode_InvalidLocalIdx","WasmEdge_ErrCode_InvalidMemPages","WasmEdge_ErrCode_InvalidMemoryIdx","WasmEdge_ErrCode_InvalidMut","WasmEdge_ErrCode_InvalidRefIdx","WasmEdge_ErrCode_InvalidResultArity","WasmEdge_ErrCode_InvalidStartFunc","WasmEdge_ErrCode_InvalidTableIdx","WasmEdge_ErrCode_JunkSection","WasmEdge_ErrCode_LengthOutOfBounds","WasmEdge_ErrCode_MalformedElemType","WasmEdge_ErrCode_MalformedExportKind","WasmEdge_ErrCode_MalformedImportKind","WasmEdge_ErrCode_MalformedMagic","WasmEdge_ErrCode_MalformedRefType","WasmEdge_ErrCode_MalformedSection","WasmEdge_ErrCode_MalformedUTF8","WasmEdge_ErrCode_MalformedValType","WasmEdge_ErrCode_MalformedVersion","WasmEdge_ErrCode_MemoryOutOfBounds","WasmEdge_ErrCode_ModuleNameConflict","WasmEdge_ErrCode_MultiMemories","WasmEdge_ErrCode_MultiTables","WasmEdge_ErrCode_NotValidated","WasmEdge_ErrCode_ReadError","WasmEdge_ErrCode_RefTypeMismatch","WasmEdge_ErrCode_RuntimeError","WasmEdge_ErrCode_SectionSizeMismatch","WasmEdge_ErrCode_SharedMemoryNoMax","WasmEdge_ErrCode_Success","WasmEdge_ErrCode_TableOutOfBounds","WasmEdge_ErrCode_Terminated","WasmEdge_ErrCode_TooManyLocals","WasmEdge_ErrCode_TypeCheckFailed","WasmEdge_ErrCode_UnalignedAtomicAccess","WasmEdge_ErrCode_UndefinedElement","WasmEdge_ErrCode_UnexpectedEnd","WasmEdge_ErrCode_UninitializedElement","WasmEdge_ErrCode_UnknownImport","WasmEdge_ErrCode_Unreachable","WasmEdge_ErrCode_UserDefError","WasmEdge_ErrCode_WrongInstanceAddress","WasmEdge_ErrCode_WrongInstanceIndex","WasmEdge_ErrCode_WrongVMWorkflow","WasmEdge_ExecutorAsyncInvoke","WasmEdge_ExecutorContext","WasmEdge_ExecutorCreate","WasmEdge_ExecutorDelete","WasmEdge_ExecutorExperimentalRegisterPostHostFunction","WasmEdge_ExecutorExperimentalRegisterPreHostFunction","WasmEdge_ExecutorInstantiate","WasmEdge_ExecutorInvoke","WasmEdge_ExecutorRegister","WasmEdge_ExecutorRegisterImport","WasmEdge_ExportTypeContext","WasmEdge_ExportTypeGetExternalName","WasmEdge_ExportTypeGetExternalType","WasmEdge_ExportTypeGetFunctionType","WasmEdge_ExportTypeGetGlobalType","WasmEdge_ExportTypeGetMemoryType","WasmEdge_ExportTypeGetTableType","WasmEdge_ExternalType","WasmEdge_ExternalType_Function","WasmEdge_ExternalType_Global","WasmEdge_ExternalType_Memory","WasmEdge_ExternalType_Table","WasmEdge_FunctionInstanceContext","WasmEdge_FunctionInstanceCreate","WasmEdge_FunctionInstanceCreateBinding","WasmEdge_FunctionInstanceDelete","WasmEdge_FunctionInstanceGetData","WasmEdge_FunctionInstanceGetFunctionType","WasmEdge_FunctionTypeContext","WasmEdge_FunctionTypeCreate","WasmEdge_FunctionTypeDelete","WasmEdge_FunctionTypeGetParameters","WasmEdge_FunctionTypeGetParametersLength","WasmEdge_FunctionTypeGetReturns","WasmEdge_FunctionTypeGetReturnsLength","WasmEdge_GlobalInstanceContext","WasmEdge_GlobalInstanceCreate","WasmEdge_GlobalInstanceDelete","WasmEdge_GlobalInstanceGetGlobalType","WasmEdge_GlobalInstanceGetValue","WasmEdge_GlobalInstanceSetValue","WasmEdge_GlobalTypeContext","WasmEdge_GlobalTypeCreate","WasmEdge_GlobalTypeDelete","WasmEdge_GlobalTypeGetMutability","WasmEdge_GlobalTypeGetValType","WasmEdge_HostFunc_t","WasmEdge_HostRegistration","WasmEdge_HostRegistration_Wasi","WasmEdge_ImportTypeContext","WasmEdge_ImportTypeGetExternalName","WasmEdge_ImportTypeGetExternalType","WasmEdge_ImportTypeGetFunctionType","WasmEdge_ImportTypeGetGlobalType","WasmEdge_ImportTypeGetMemoryType","WasmEdge_ImportTypeGetModuleName","WasmEdge_ImportTypeGetTableType","WasmEdge_Limit","WasmEdge_LimitIsEqual","WasmEdge_LoaderContext","WasmEdge_LoaderCreate","WasmEdge_LoaderDelete","WasmEdge_LoaderParseFromBuffer","WasmEdge_LoaderParseFromFile","WasmEdge_LogOff","WasmEdge_LogSetDebugLevel","WasmEdge_LogSetErrorLevel","WasmEdge_MemoryInstanceContext","WasmEdge_MemoryInstanceCreate","WasmEdge_MemoryInstanceDelete","WasmEdge_MemoryInstanceGetData","WasmEdge_MemoryInstanceGetMemoryType","WasmEdge_MemoryInstanceGetPageSize","WasmEdge_MemoryInstanceGetPointer","WasmEdge_MemoryInstanceGetPointerConst","WasmEdge_MemoryInstanceGrowPage","WasmEdge_MemoryInstanceSetData","WasmEdge_MemoryTypeContext","WasmEdge_MemoryTypeCreate","WasmEdge_MemoryTypeDelete","WasmEdge_MemoryTypeGetLimit","WasmEdge_ModuleDescriptor","WasmEdge_ModuleInstanceAddFunction","WasmEdge_ModuleInstanceAddGlobal","WasmEdge_ModuleInstanceAddMemory","WasmEdge_ModuleInstanceAddTable","WasmEdge_ModuleInstanceContext","WasmEdge_ModuleInstanceCreate","WasmEdge_ModuleInstanceCreateWASI","WasmEdge_ModuleInstanceCreateWithData","WasmEdge_ModuleInstanceDelete","WasmEdge_ModuleInstanceFindFunction","WasmEdge_ModuleInstanceFindGlobal","WasmEdge_ModuleInstanceFindMemory","WasmEdge_ModuleInstanceFindTable","WasmEdge_ModuleInstanceGetHostData","WasmEdge_ModuleInstanceGetModuleName","WasmEdge_ModuleInstanceInitWASI","WasmEdge_ModuleInstanceInitWasmEdgeProcess","WasmEdge_ModuleInstanceListFunction","WasmEdge_ModuleInstanceListFunctionLength","WasmEdge_ModuleInstanceListGlobal","WasmEdge_ModuleInstanceListGlobalLength","WasmEdge_ModuleInstanceListMemory","WasmEdge_ModuleInstanceListMemoryLength","WasmEdge_ModuleInstanceListTable","WasmEdge_ModuleInstanceListTableLength","WasmEdge_ModuleInstanceWASIGetExitCode","WasmEdge_ModuleInstanceWASIGetNativeHandler","WasmEdge_Mutability","WasmEdge_Mutability_Const","WasmEdge_Mutability_Var","WasmEdge_NumType","WasmEdge_NumType_F32","WasmEdge_NumType_F64","WasmEdge_NumType_I32","WasmEdge_NumType_I64","WasmEdge_NumType_V128","WasmEdge_PluginContext","WasmEdge_PluginCreateModule","WasmEdge_PluginDescriptor","WasmEdge_PluginFind","WasmEdge_PluginGetPluginName","WasmEdge_PluginInitWASINN","WasmEdge_PluginListModule","WasmEdge_PluginListModuleLength","WasmEdge_PluginListPlugins","WasmEdge_PluginListPluginsLength","WasmEdge_PluginLoadFromPath","WasmEdge_PluginLoadWithDefaultPaths","WasmEdge_PluginVersionData","WasmEdge_Plugin_CurrentAPIVersion","WasmEdge_Plugin_GetDescriptor","WasmEdge_ProgramOption","WasmEdge_ProgramOptionType","WasmEdge_ProgramOptionType_Double","WasmEdge_ProgramOptionType_Float","WasmEdge_ProgramOptionType_Int16","WasmEdge_ProgramOptionType_Int32","WasmEdge_ProgramOptionType_Int64","WasmEdge_ProgramOptionType_Int8","WasmEdge_ProgramOptionType_None","WasmEdge_ProgramOptionType_String","WasmEdge_ProgramOptionType_Toggle","WasmEdge_ProgramOptionType_UInt16","WasmEdge_ProgramOptionType_UInt32","WasmEdge_ProgramOptionType_UInt64","WasmEdge_ProgramOptionType_UInt8","WasmEdge_Proposal","WasmEdge_Proposal_Annotations","WasmEdge_Proposal_BulkMemoryOperations","WasmEdge_Proposal_ExceptionHandling","WasmEdge_Proposal_ExtendedConst","WasmEdge_Proposal_FunctionReferences","WasmEdge_Proposal_ImportExportMutGlobals","WasmEdge_Proposal_Memory64","WasmEdge_Proposal_MultiMemories","WasmEdge_Proposal_MultiValue","WasmEdge_Proposal_NonTrapFloatToIntConversions","WasmEdge_Proposal_ReferenceTypes","WasmEdge_Proposal_SIMD","WasmEdge_Proposal_SignExtensionOperators","WasmEdge_Proposal_TailCall","WasmEdge_Proposal_Threads","WasmEdge_RefType","WasmEdge_RefType_ExternRef","WasmEdge_RefType_FuncRef","WasmEdge_Result","WasmEdge_ResultGen","WasmEdge_ResultGetCategory","WasmEdge_ResultGetCode","WasmEdge_ResultGetMessage","WasmEdge_ResultOK","WasmEdge_StatisticsClear","WasmEdge_StatisticsContext","WasmEdge_StatisticsCreate","WasmEdge_StatisticsDelete","WasmEdge_StatisticsGetInstrCount","WasmEdge_StatisticsGetInstrPerSecond","WasmEdge_StatisticsGetTotalCost","WasmEdge_StatisticsSetCostLimit","WasmEdge_StatisticsSetCostTable","WasmEdge_StoreContext","WasmEdge_StoreCreate","WasmEdge_StoreDelete","WasmEdge_StoreFindModule","WasmEdge_StoreListModule","WasmEdge_StoreListModuleLength","WasmEdge_String","WasmEdge_StringCopy","WasmEdge_StringCreateByBuffer","WasmEdge_StringCreateByCString","WasmEdge_StringDelete","WasmEdge_StringIsEqual","WasmEdge_StringWrap","WasmEdge_TableInstanceContext","WasmEdge_TableInstanceCreate","WasmEdge_TableInstanceDelete","WasmEdge_TableInstanceGetData","WasmEdge_TableInstanceGetSize","WasmEdge_TableInstanceGetTableType","WasmEdge_TableInstanceGrow","WasmEdge_TableInstanceSetData","WasmEdge_TableTypeContext","WasmEdge_TableTypeCreate","WasmEdge_TableTypeDelete","WasmEdge_TableTypeGetLimit","WasmEdge_TableTypeGetRefType","WasmEdge_VMAsyncExecute","WasmEdge_VMAsyncExecuteRegistered","WasmEdge_VMAsyncRunWasmFromASTModule","WasmEdge_VMAsyncRunWasmFromBuffer","WasmEdge_VMAsyncRunWasmFromFile","WasmEdge_VMCleanup","WasmEdge_VMContext","WasmEdge_VMCreate","WasmEdge_VMDelete","WasmEdge_VMExecute","WasmEdge_VMExecuteRegistered","WasmEdge_VMGetActiveModule","WasmEdge_VMGetExecutorContext","WasmEdge_VMGetFunctionList","WasmEdge_VMGetFunctionListLength","WasmEdge_VMGetFunctionType","WasmEdge_VMGetFunctionTypeRegistered","WasmEdge_VMGetImportModuleContext","WasmEdge_VMGetLoaderContext","WasmEdge_VMGetRegisteredModule","WasmEdge_VMGetStatisticsContext","WasmEdge_VMGetStoreContext","WasmEdge_VMGetValidatorContext","WasmEdge_VMInstantiate","WasmEdge_VMListRegisteredModule","WasmEdge_VMListRegisteredModuleLength","WasmEdge_VMLoadWasmFromASTModule","WasmEdge_VMLoadWasmFromBuffer","WasmEdge_VMLoadWasmFromFile","WasmEdge_VMRegisterModuleFromASTModule","WasmEdge_VMRegisterModuleFromBuffer","WasmEdge_VMRegisterModuleFromFile","WasmEdge_VMRegisterModuleFromImport","WasmEdge_VMRunWasmFromASTModule","WasmEdge_VMRunWasmFromBuffer","WasmEdge_VMRunWasmFromFile","WasmEdge_VMValidate","WasmEdge_ValType","WasmEdge_ValType_ExternRef","WasmEdge_ValType_F32","WasmEdge_ValType_F64","WasmEdge_ValType_FuncRef","WasmEdge_ValType_I32","WasmEdge_ValType_I64","WasmEdge_ValType_V128","WasmEdge_ValidatorContext","WasmEdge_ValidatorCreate","WasmEdge_ValidatorDelete","WasmEdge_ValidatorValidate","WasmEdge_Value","WasmEdge_ValueGenExternRef","WasmEdge_ValueGenF32","WasmEdge_ValueGenF64","WasmEdge_ValueGenFuncRef","WasmEdge_ValueGenI32","WasmEdge_ValueGenI64","WasmEdge_ValueGenNullRef","WasmEdge_ValueGenV128","WasmEdge_ValueGetExternRef","WasmEdge_ValueGetF32","WasmEdge_ValueGetF64","WasmEdge_ValueGetFuncRef","WasmEdge_ValueGetI32","WasmEdge_ValueGetI64","WasmEdge_ValueGetV128","WasmEdge_ValueIsNullRef","WasmEdge_VersionGet","WasmEdge_VersionGetMajor","WasmEdge_VersionGetMinor","WasmEdge_VersionGetPatch","WasmEdge_WrapFunc_t","_ATFILE_SOURCE","_BITS_STDINT_INTN_H","_BITS_STDINT_UINTN_H","_BITS_TIME64_H","_BITS_TYPESIZES_H","_BITS_TYPES_H","_BITS_WCHAR_H","_DEFAULT_SOURCE","_FEATURES_H","_POSIX_C_SOURCE","_POSIX_SOURCE","_STDC_PREDEF_H","_STDINT_H","_SYS_CDEFS_H","__FD_SETSIZE","__GLIBC_MINOR__","__GLIBC_USE_DEPRECATED_GETS","__GLIBC_USE_DEPRECATED_SCANF","__GLIBC_USE_IEC_60559_BFP_EXT","__GLIBC_USE_IEC_60559_BFP_EXT_C2X","__GLIBC_USE_IEC_60559_EXT","__GLIBC_USE_IEC_60559_FUNCS_EXT","__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X","__GLIBC_USE_IEC_60559_TYPES_EXT","__GLIBC_USE_ISOC2X","__GLIBC_USE_LIB_EXT2","__GLIBC__","__GNU_LIBRARY__","__HAVE_GENERIC_SELECTION","__INO_T_MATCHES_INO64_T","__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64","__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI","__OFF_T_MATCHES_OFF64_T","__RLIM_T_MATCHES_RLIM64_T","__STATFS_MATCHES_STATFS64","__STDC_IEC_559_COMPLEX__","__STDC_IEC_559__","__STDC_IEC_60559_BFP__","__STDC_IEC_60559_COMPLEX__","__STDC_ISO_10646__","__SYSCALL_WORDSIZE","__TIMESIZE","__USE_ATFILE","__USE_FORTIFY_LEVEL","__USE_ISOC11","__USE_ISOC95","__USE_ISOC99","__USE_MISC","__USE_POSIX","__USE_POSIX199309","__USE_POSIX199506","__USE_POSIX2","__USE_POSIX_IMPLICITLY","__USE_XOPEN2K","__USE_XOPEN2K8","__WORDSIZE","__WORDSIZE_TIME64_COMPAT32","__blkcnt64_t","__blkcnt_t","__blksize_t","__bool_true_false_are_defined","__caddr_t","__clock_t","__clockid_t","__daddr_t","__dev_t","__fsblkcnt64_t","__fsblkcnt_t","__fsfilcnt64_t","__fsfilcnt_t","__fsid_t","__fsword_t","__gid_t","__glibc_c99_flexarr_available","__id_t","__ino64_t","__ino_t","__int16_t","__int32_t","__int64_t","__int8_t","__int_least16_t","__int_least32_t","__int_least64_t","__int_least8_t","__intmax_t","__intptr_t","__key_t","__loff_t","__mode_t","__nlink_t","__off64_t","__off_t","__pid_t","__quad_t","__rlim64_t","__rlim_t","__sig_atomic_t","__socklen_t","__ssize_t","__suseconds64_t","__suseconds_t","__syscall_slong_t","__syscall_ulong_t","__time_t","__timer_t","__u_char","__u_int","__u_long","__u_quad_t","__u_short","__uid_t","__uint16_t","__uint32_t","__uint64_t","__uint8_t","__uint_least16_t","__uint_least32_t","__uint_least64_t","__uint_least8_t","__uintmax_t","__useconds_t","__val","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","false_","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","int128_t","int_fast16_t","int_fast32_t","int_fast64_t","int_fast8_t","int_least16_t","int_least32_t","int_least64_t","int_least8_t","intmax_t","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","true_","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","uint128_t","uint_fast16_t","uint_fast32_t","uint_fast64_t","uint_fast8_t","uint_least16_t","uint_least32_t","uint_least64_t","uint_least8_t","uintmax_t","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","CallingFrame","as_ptr","executor_mut","memory_mut","module_instance","function","global","memory","module","table","CustomFnWrapper","FuncRef","FuncType","Function","as_ptr","as_ptr","as_ref","call","call","create","create_sync_func","create_with_custom_wrapper","params_len","params_type_iter","returns_len","returns_type_iter","ty","ty","Global","GlobalType","as_ptr","as_ptr","create","create","get_value","mutability","set_value","ty","value_type","MemType","Memory","as_ptr","as_ptr","create","create","data_pointer","data_pointer_mut","get_data","grow","max","min","set_data","shared","size","ty","AsImport","AsInstance","ImportModule","Instance","Wasi","WasiInstance","WasiModule","add_func","add_global","add_memory","add_table","as_ptr","as_ptr","as_ptr","as_raw_ptr","create","create","exit_code","func_len","func_len","func_names","func_names","get_func","get_func","get_global","get_global","get_memory","get_memory","get_native_handler","get_table","get_table","global_len","global_len","global_names","global_names","host_data","init_wasi","mem_len","mem_len","mem_names","mem_names","name","name","name","name","table_len","table_len","table_names","table_names","Table","TableType","as_ptr","as_ptr","capacity","create","create","elem_ty","get_data","grow","max","min","set_data","ty","F32","F64","I16","I32","I64","I8","ModuleDescriptor","ModuleInstanceCreateFn","None","Plugin","PluginDescriptor","PluginManager","PluginModule","PluginVersion","ProgramOption","ProgramOptionType","String","Toggle","U16","U32","U64","U8","add_func","add_global","add_memory","add_module_descriptor","add_program_option","add_table","as_ptr","as_raw_ptr","as_raw_ptr","as_raw_ptr","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone_into","clone_into","count","create","create","create","create","create","drop","eq","find","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","init_wasmedge_process","inner","into","into","into","into","into","into","into","into","load_plugins","load_plugins_from_default_paths","major","minor","mod_count","mod_instance","mod_names","name","name","names","nn_preload","patch","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","WasmValue","as_raw","extern_ref","from_extern_ref","from_f32","from_f64","from_func_ref","from_i32","from_i64","from_null_ref","from_v128","func_ref","is_null_ref","to_f32","to_f64","to_i32","to_i64","to_v128","ty","driver_aot_compiler","driver_runtime_tool","driver_unified_tool","log_debug_info","log_error_info","log_off","version_major_value","version_minor_value","version_patch_value","version_string"],"q":[[0,"wasmedge_sys"],[458,"wasmedge_sys::ffi"],[1494,"wasmedge_sys::frame"],[1499,"wasmedge_sys::instance"],[1504,"wasmedge_sys::instance::function"],[1522,"wasmedge_sys::instance::global"],[1533,"wasmedge_sys::instance::memory"],[1549,"wasmedge_sys::instance::module"],[1598,"wasmedge_sys::instance::table"],[1612,"wasmedge_sys::plugin"],[1747,"wasmedge_sys::types"],[1766,"wasmedge_sys::utils"],[1776,"core::convert"],[1777,"core::marker"],[1778,"core::marker"],[1779,"alloc::vec"],[1780,"wasmedge_types"],[1781,"core::iter::traits::collect"],[1782,"core::time"],[1783,"std::path"],[1784,"core::option"],[1785,"core::fmt"],[1786,"core::fmt"],[1787,"wasmedge_types"],[1788,"core::result"],[1789,"wasmedge_types"],[1790,"core::ops::function"],[1791,"alloc::boxed"],[1792,"core::ffi"],[1793,"core::iter::traits::iterator"],[1794,"wasmedge_types"]],"d":["The module to be registered via the the …","The object as an module instance is required to implement …","Represents a calling frame on top of stack.","Defines WasmEdge ahead-of-time(AOT) compiler and the …","Defines Config struct used to check/set the configuration …","The object that is used to perform a host function is …","Defines an execution environment for both pure WASM and …","Defines the types of the exported wasm values.","Defines a reference to a host function.","Defines the type of a host function.","Defines a host function.","Defines a WebAssembly global variable, which stores a …","Defines the type of a wasm global variable.","An ImportModule represents a host module with a name. A …","Defines the types of the imported wasm value.","An Instance represents an instantiated module. In the …","Loader is used to load WASM modules from the given WASM …","Defines the type of a wasm memory instance","Defines a WebAssembly memory instance, which is a linear …","Defines compiled in-memory representation of an input WASM …","Struct of WasmEdge Statistics.","A Store represents all global state that can be …","A WasmEdge Table defines a WebAssembly table instance …","A WasmEdge TableType classifies a Table instance over …","Struct of WasmEdge Validator.","Defines the import module instance of WasiModule type.","Defines three types of module instances that can be …","A WasiModule is a module instance for the WASI …","Defines a WebAssembly value.","Imports a host function instance.","","Imports a global instance.","","Imports a memory instance.","","Imports a table instance.","","Enables or disables the Annotations option. By default, …","Checks if the Annotations option turns on or not.","Provides a raw pointer to the inner ASTModule context.","Provides a raw pointer to the inner ImportType context.","Provides a raw pointer to the inner ExportType context.","Provides a raw pointer to the inner Compiler context.","Provides a raw pointer to the inner Configure context.","Provides a raw pointer to the inner Executor context.","Provides a raw pointer to the inner Loader context.","Provides a raw pointer to the inner Statistics context.","Provides a raw pointer to the inner Store context.","Provides a raw pointer to the inner Validator context.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Enables or disables the BulkMemoryOperations option. By …","Checks if the BulkMemoryOperations option turns on or not.","Runs a host function instance and returns the results.","Runs a host function reference instance and returns the …","Run a host function instance and return the results or …","Clears the data in this statistics.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Compiles the input WASM from the given bytes for the AOT …","Compiles the input WASM from the given file path for the …","Checks if the Store contains a module of which the name …","Returns the total cost in execution.","Sets the instruction counting option. By default, the …","Returns the count of wasm exports in the Module.","Returns the number of wasm imports in the Module.","Creates a new AOT compiler.","Creates a new Config.","Creates a new executor to be associated with the given …","Create a new Loader to be associated with the given global …","Creates a new Statistics.","Creates a new Store.","Creates a new Validator to be associated with the given …","","","","","","","","","","","","","","","","","","","","","","","","Sets the dump IR option of AOT compiler. By default, the …","Checks if the dump IR option turns on or not.","Enables or disables the ExceptionHandling option. By …","Checks if the ExceptionHandling option turns on or not.","Returns the types of wasm exports in the Module.","Foreign function interfaces generated from WasmEdge C-API.","","","","","","","","","","","","","","","","","","","","","","","","","","Defines WasmEdge CallingFrame.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Loads a WASM module from a in-memory bytes.","Loads a WASM module from a WASM file.","Returns the length of the exported function instances in …","Returns the names of the exported function instances in …","Enables or disables the FunctionReferences option. By …","Checks if the FunctionReferences option turns on or not.","Sets the generic binary option of AOT compiler. By …","Checks if the generic binary option of AOT compiler turns …","Returns the output binary format of AOT compiler.","Returns the optimization level of AOT compiler.","Returns the exported function instance by name.","Returns the exported global instance by name.","Returns the number of the memory pages available.","Returns the exported memory instance by name.","Returns the exported table instance by name.","Returns the length of the exported global instances in …","Returns the names of the exported global instances in this …","Returns the types of wasm imports in the Module.","Defines WasmEdge instance structs, including Function, …","Returns the instruction count in execution.","Returns the instruction count per second in execution.","Enables or disables the ForceInterpreter option. By …","Checks if the ForceInterpreter option turns on or not.","Enables or Disables the Interruptible option of AOT …","Checks if the Interruptible option of AOT Compiler turns …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Checks if the cost measuring option turns on or not.","Checks if the instruction counting option turns on or not.","Checks if the time measuring option turns on or not.","Sets the cost measuring option. By default, the option is …","Sets the time measuring option. By default, the option is …","Returns the length of the exported memory instances in …","Returns the names of all exported memory instances in this …","Enables or disables the Memory64 option. By default, the …","Checks if the Memory64 option turns on or not.","Returns the module instance by the module name.","Returns the length of the registered modules.","Returns the module name that this import is expected to …","Returns the names of all registered modules.","Enables or disables the MultiMemories option. By default, …","Checks if the MultiMemories option turns on or not.","Enables or disables the MultiValue option. By default, the …","Checks if the MultiValue option turns on or not.","Enables or disables the ImportExportMutGlobals option. By …","Checks if the ImportExportMutGlobals option turns on or …","Returns the name of the module instance.","Returns the field name of the module that this import is …","Returns the name by which this export is known by.","","Enables or disables the NonTrapFloatToIntConversions …","Checks if the NonTrapFloatToIntConversions option turns on …","Defines PluginManager and Plugin structs.","Enables or disables the ReferenceTypes option. By default, …","Checks if the ReferenceTypes option turns on or not.","Registers and instantiates a WasmEdge module into a store …","Registers and instantiates a import module into a store.","Registers and instantiates a WasmEdge module into a store.","Registers plugin module instance into a store.","Registers and instantiates the given WASI instance into a …","Runs a host function instance and returns the results.","","Runs a host function instance by calling its reference and …","","Sets the output binary format of AOT compiler. By default, …","Sets the optimization level of AOT compiler. By default, …","Sets the cost limit in execution.","Sets the cost of instructions.","Sets the maximum number of the memory pages available.","Enables or disables the SignExtensionOperators option. By …","Checks if the SignExtensionOperators option turns on or …","Enables or disables the SIMD option. By default, the …","Checks if the SIMD option turns on or not.","Returns the length of the exported table instances in this …","Returns the names of the exported table instances in this …","Enables or disables the TailCall option. By default, the …","Checks if the TailCall option turns on or not.","Enables or disables the Threads option. By default, the …","Checks if the Threads option turns on or not.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the type of this import.","Returns the type of this export.","","","","","","","","","","","","","","","","","","","","","","","","","","Defines the WebAssembly primitive types.","Defines the versioning and logging functions.","Validates a given WasmEdge Module.","","","","","","","","","","","","","","","","","","","","","","","","","","Enables or disables host registration wasi. By default, …","Checks if host registration wasi turns on or not.","","","","","","","","","","Boolean to describe has max value or not.","","","","","","","","","","","","","","","","","","","","","","","Maximum value. Will be ignored if the HasMax is false.","Minimum value.","","","","","","","No value.","No value.","","","","","","","","","Boolean to describe is shared memory or not.","Some value of type T.","Some value of type T.","","","","","","","","","","","","","","","","","","","","","","","Deletion of the WasmEdge_ASTModuleContext.","List the exports of the AST module.","Get the length of exports list of the AST module.","List the imports of the AST module.","Get the length of imports list of the AST module.","","Cancel a WasmEdge_Async execution.","Deletion of the WasmEdge_Async.","Wait and get the result of WasmEdge_Async execution.","Wait and get the return list length of the WasmEdge_Async …","Wait a WasmEdge_Async execution.","Wait a WasmEdge_Async execution with timeout.","","Get the executor context from the current calling frame.","Get the memory instance by index from the module instance …","Get the module instance of the current calling frame.","Compile the input WASM from the file path.","Compile the input WASM from the given buffer.","","Creation of the WasmEdge_CompilerContext.","Deletion of the WasmEdge_CompilerContext.","","","","","","","","","","","Add a built-in host registration setting into …","Add a proposal setting into the WasmEdge_ConfigureContext.","Get the optimization level of the AOT compiler.","Get the output binary format of the AOT compiler.","Get the dump IR option of the AOT compiler.","Get the generic binary option of the AOT compiler.","Get the interruptible option of the AOT compiler.","Set the dump IR option of the AOT compiler.","Set the generic binary option of the AOT compiler.","Set the interruptible option of the AOT compiler.","Set the optimization level of the AOT compiler.","Set the output binary format of the AOT compiler.","","Creation of the WasmEdge_ConfigureContext.","Deletion of the WasmEdge_ConfigureContext.","Get the setting of the page limit of memory instances.","Check if a built-in host registration setting exists in the","Check if a proposal setting exists in the …","Get the AllowAFUNIX option.","Get the force interpreter mode execution option.","Remove a built-in host registration setting in the …","Remove a proposal setting in the WasmEdge_ConfigureContext.","Set the option of enabling/disabling AF_UNIX support in …","Set the force interpreter mode execution option.","Set the page limit of memory instances.","Get the cost measuring option for the statistics.","Get the instruction counting option for the statistics.","Get the time measuring option for the statistics.","Set the cost measuring option for the statistics.","Set the instruction counting option for the statistics.","Set the time measuring option for the statistics.","Entrypoint for the compiler tool.","Entrypoint for the runtime tool.","Entrypoint for the unified tool.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Asynchronous invoke a WASM function by the function …","","Creation of the WasmEdge_ExecutorContext.","Deletion of the WasmEdge_ExecutorContext.","Register a host function that will be invoked after …","Register a host function that will be invoked before …","Instantiate an AST Module into a module instance.","Invoke a WASM function by the function instance.","Instantiate an AST Module into a named module instance and …","Register a module instance into a store with exporting its …","","Get the external name from an export type.","Get the external type from an export type.","Get the external value (which is function type) from an …","Get the external value (which is global type) from an …","Get the external value (which is memory type) from an …","Get the external value (which is table type) from an …","","","","","","","Creation of the WasmEdge_FunctionInstanceContext for host …","Creation of the WasmEdge_FunctionInstanceContext for host …","Deletion of the WasmEdge_FunctionInstanceContext.","Get the function data field of the function instance.","Get the function type context of the function instance.","","Creation of the WasmEdge_FunctionTypeContext.","Deletion of the WasmEdge_FunctionTypeContext.","Get the parameter types list from the …","Get the parameter types list length from the …","Get the return types list from the …","Get the return types list length from the …","","Creation of the WasmEdge_GlobalInstanceContext.","Deletion of the WasmEdge_GlobalInstanceContext.","Get the global type context from a global instance.","Get the value from a global instance.","Set the value from a global instance.","","Creation of the WasmEdge_GlobalTypeContext.","Deletion of the WasmEdge_GlobalTypeContext.","Get the mutability from a global type.","Get the value type from a global type.","","","","","Get the external name from an import type.","Get the external type from an import type.","Get the external value (which is function type) from an …","Get the external value (which is global type) from an …","Get the external value (which is memory type) from an …","Get the module name from an import type.","Get the external value (which is table type) from an …","Struct of WASM limit.","Compare the two WasmEdge_Limit objects.","","Creation of the WasmEdge_LoaderContext.","Deletion of the WasmEdge_LoaderContext.","Load and parse the WASM module from a buffer into …","Load and parse the WASM module from a WASM file into a …","Set the logging system off.","Set the logging system to filter to debug level.","Set the logging system to filter to error level.","","Creation of the WasmEdge_MemoryInstanceContext.","Deletion of the WasmEdge_MemoryInstanceContext.","Copy the data to the output buffer from a memory instance.","Get the memory type context from a memory instance.","Get the current page size (64 KiB of each page) of a …","Get the data pointer in a memory instance.","Get the const data pointer in a const memory instance.","Grow a memory instance with a page size.","Copy the data into a memory instance from the input buffer.","","Creation of the WasmEdge_MemoryTypeContext.","Deletion of the WasmEdge_MemoryTypeContext.","Get the limit from a memory type.","Module descriptor for plugins.","Add a function instance context into a …","Add a global instance context into a …","Add a memory instance context into a …","Add a table instance context into a …","","Creation of the WasmEdge_ModuleInstanceContext.","Creation of the WasmEdge_ModuleInstanceContext for the …","Creation of the WasmEdge_ModuleInstanceContext with host …","Deletion of the WasmEdge_ModuleInstanceContext.","Get the exported function instance context of a module …","Get the exported global instance context of a module …","Get the exported memory instance context of a module …","Get the exported table instance context of a module …","Get the host data set into the module instance when …","Get the export module name of a module instance.","Initialize the WasmEdge_ModuleInstanceContext for the WASI …","Initialize the WasmEdge_ModuleInstanceContext for the …","List the exported function names of a module instance.","Get the length of exported function list of a module …","List the exported global names of a module instance.","Get the length of exported global list of a module …","List the exported memory names of a module instance.","Get the length of exported memory list of a module …","List the exported table names of a module instance.","Get the length of exported table list of a module instance.","Get the WASI exit code.","Get the native handler from the WASI mapped FD/Handler.","","","","","","","","","","","Create the module instance in the plug-in by the module …","Plugin descriptor for plugins.","Find the loaded plug-in context by name.","Get the plug-in name of the plug-in context.","Initialize the wasi_nn plug-in.","List the modules in the plug-in context with their names.","Get the length of module list in the plug-in context.","List the loaded plug-ins with their names.","Get the length of loaded plug-in list.","Load the plugin with the given file or directory.","Load plugins with the default search paths.","Version data for plugins.","","Implement by plugins for returning the plugin descriptor.","Program option for plugins.","Type of option value.","Boolean value.","Boolean value.","Boolean value.","Boolean value.","Boolean value.","Boolean value.","No option value.","WasmEdge_String.","Boolean value.","Boolean value.","Boolean value.","Boolean value.","Boolean value.","","","","","","","","","","","","","","","","","","","","WasmEdge result struct.","Generate the result with code.","Get the error category.","Get the result code.","Get the result message.","Check the result is a success or not.","Clear all data in the WasmEdge_StatisticsContext.","","Creation of the WasmEdge_StatisticsContext.","Deletion of the WasmEdge_StatisticsContext.","Get the instruction count in execution.","Get the instruction count per second in execution.","Get the total cost in execution.","Set the cost limit in execution.","Set the costs of instructions.","","Creation of the WasmEdge_StoreContext.","Deletion of the WasmEdge_StoreContext.","Get the module instance context by the module name.","List the registered module names.","Get the length of registered module list in store.","WasmEdge string struct.","Copy the content of WasmEdge_String object to the buffer.","Creation of the WasmEdge_String with the buffer and its …","Creation of the WasmEdge_String with the C string.","Deletion of the WasmEdge_String.","Compare the two WasmEdge_String objects.","Create the WasmEdge_String wraps to the buffer.","","Creation of the WasmEdge_TableInstanceContext.","Deletion of the WasmEdge_TableInstanceContext.","Get the reference value in a table instance.","Get the size of a table instance.","Get the table type context from a table instance.","Grow a table instance with a size.","Set the reference value into a table instance.","","Creation of the WasmEdge_TableTypeContext.","Deletion of the WasmEdge_TableTypeContext.","Get the limit from a table type.","Get the reference type from a table type.","Asynchronous invoke a WASM function by name.","Asynchronous invoke a WASM function by its module name and …","Instantiate the WASM module from a WasmEdge AST Module and …","Instantiate the WASM module from a buffer and asynchronous …","Instantiate the WASM module from a WASM file and …","Reset of WasmEdge_VMContext.","","Creation of the WasmEdge_VMContext.","Deletion of the WasmEdge_VMContext.","Invoke a WASM function by name.","Invoke a WASM function by its module name and function …","Get the current instantiated module in VM.","Get the executor context used in the WasmEdge_VMContext.","Get the exported function list.","Get the length of exported function list.","Get the function type by function name.","Get the function type by function name.","Get the module instance corresponding to the …","Get the loader context used in the WasmEdge_VMContext.","Get the registered module in VM by the module name.","Get the statistics context used in the WasmEdge_VMContext.","Get the store context used in the WasmEdge_VMContext.","Get the validator context used in the WasmEdge_VMContext.","Instantiate the validated WASM module in the VM context.","List the registered module names in the WasmEdge_VMContext.","Get the length of registered module list in the …","Load the WASM module from loaded WasmEdge AST Module.","Load the WASM module from a buffer.","Load the WASM module from a WASM file.","Instantiate and register an AST Module into a named module …","Register and instantiate WASM into the store in VM from a …","Register and instantiate WASM into the store in VM from a …","Register a module instance into the store in VM with …","Instantiate the WASM module from a WasmEdge AST Module and …","Instantiate the WASM module from a buffer and invoke a …","Instantiate the WASM module from a WASM file and invoke a …","Validate the WASM module loaded into the VM context.","","","","","","","","","","Creation of the WasmEdge_ValidatorContext.","Deletion of the WasmEdge_ValidatorContext.","Validate the WasmEdge AST Module.","WasmEdge WASM value struct.","Generate the function reference WASM value.","Generate the F32 WASM value.","Generate the F64 WASM value.","Generate the function reference WASM value.","Generate the I32 WASM value.","Generate the I64 WASM value.","Generate the NULL reference WASM value.","Generate the V128 WASM value.","Retrieve the external reference from the WASM value.","Retrieve the F32 value from the WASM value.","Retrieve the F64 value from the WASM value.","Retrieve the function instance context from the WASM value.","Retrieve the I32 value from the WASM value.","Retrieve the I64 value from the WASM value.","Retrieve the V128 value from the WASM value.","Specify the WASM value is a null reference or not.","Get the version string of the WasmEdge C API.","Get the major version value of the WasmEdge C API.","Get the minor version value of the WasmEdge C API.","Get the patch version value of the WasmEdge C API.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Represents a calling frame on top of stack.","Provides a raw pointer to the inner CallingFrame context.","Returns the executor instance from this calling frame.","Returns the memory instance by the given index from the …","Returns the module instance in this calling frame.","Defines WasmEdge Function and FuncType structs.","Defines WasmEdge Global and GlobalType structs.","Defines WasmEdge Memory and MemType structs.","Defines WasmEdge Instance and other relevant types.","Defines WasmEdge Table and TableType structs.","","Defines a reference to a host function.","Defines the type of a host function.","Defines a host function.","Provides a raw pointer to the inner function context.","Provides a raw pointer to the inner function type context.","Returns a reference to this Function instance.","Runs this host function and returns the result.","Runs this host function the reference refers to.","Create a new FuncType to be associated with the given …","Creates a host function with the given function type.","Creates a host function with the given function type and …","Returns the number of the arguments of a Function.","Returns an Iterator of the arguments of a Function.","Returns the number of the returns of a Function.","Returns an Iterator of the return types of a Function.","Returns the underlying wasm type of this Function.","Returns the underlying wasm type of the host function this …","Defines a WebAssembly global variable, which stores a …","Defines the type of a wasm global variable.","Provides a raw pointer to the inner global context.","Provides a raw pointer to the inner global type context.","Creates a new Global instance to be associated with the …","Create a new GlobalType to be associated with the given …","Returns the value of the Global instance.","Returns the Mutability value of the GlobalType.","Sets the value of the Global instance.","Returns the underlying wasm type of a Global instance.","Returns the value type of the GlobalType.","Defines the type of a wasm memory instance","Defines a WebAssembly memory instance, which is a linear …","Provides a raw pointer to the inner memory context.","Provides a raw pointer to the inner memory type context.","Create a new Memory to be associated with the given …","Create a new MemType to be associated with the given limit …","Returns the const data pointer to the Memory.","Returns the data pointer to the Memory.","Copies the data from the Memory to the output buffer.","Grows this WebAssembly memory by count pages.","Returns the maximum size of a Memory allowed to grow.","Returns the initial size of a Memory.","Copies the data from the given input buffer into the Memory…","Returns whether the memory is shared or not.","Returns the size, in WebAssembly pages (64 KiB of each …","Returns the type of the Memory.","The module to be registered via the the …","The object as an module instance is required to implement …","An ImportModule represents a host module with a name. A …","An Instance represents an instantiated module. In the …","Defines the import module instance of WasiModule type.","Defines three types of module instances that can be …","A WasiModule is a module instance for the WASI …","Imports a host function instance.","Imports a global instance.","Imports a memory instance.","Imports a table instance.","Provides a raw pointer to the inner module instance …","Provides a raw pointer to the inner module instance …","Provides a raw pointer to the inner module instance …","Returns the raw pointer to the inner …","Creates a module instance which is used to import host …","Creates a WASI host module which contains the WASI host …","Returns the WASI exit code.","Returns the length of the exported function instances in …","Returns the length of the exported function instances in …","Returns the names of the exported function instances in …","Returns the names of the exported function instances in …","Returns the exported function instance by name.","Returns the exported function instance by name.","Returns the exported global instance by name.","Returns the exported global instance by name.","Returns the exported memory instance by name.","Returns the exported memory instance by name.","Returns the native handler from the mapped FD/Handler.","Returns the exported table instance by name.","Returns the exported table instance by name.","Returns the length of the exported global instances in …","Returns the length of the exported global instances in …","Returns the names of the exported global instances in this …","Returns the names of the exported global instances in this …","Returns the host data held by the module instance.","Initializes the WASI host module with the given parameters.","Returns the length of the exported memory instances in …","Returns the length of the exported memory instances in …","Returns the names of all exported memory instances in this …","Returns the names of all exported memory instances in this …","Returns the name of the module instance.","Returns the name of this exported module instance.","Returns the name of the module instance.","Returns the name of the import object.","Returns the length of the exported table instances in this …","Returns the length of the exported table instances in this …","Returns the names of the exported table instances in this …","Returns the names of the exported table instances in this …","A WasmEdge Table defines a WebAssembly table instance …","A WasmEdge TableType classifies a Table instance over …","Provides a raw pointer to the inner table context.","Provides a raw pointer to the inner table type context.","Returns the capacity of the Table.","Creates a new Table to be associated with the given …","Creates a new TableType to be associated with the given …","Returns the element type.","Returns the element value at a specific position in the …","Increases the capacity of the Table.","Returns the maximum size of the Table.","Returns the initial size of the Table.","Sets a new element value at a specific position in the …","Returns the TableType of the Table.","","","","","","","Defines the module descriptor for plugins.","Defines the type of the function that creates a module …","","Represents a loaded plugin. It provides the APIs for …","Represents Plugin descriptor for plugins.","Defines the APIs for loading plugins and check the basic …","Represents a Plugin module instance.","Defines the version of a plugin.","Defines the program option for plugins.","Defines the type of the program options.","","","","","","","","","","","","","Provides a raw pointer to the inner Plugin context.","Returns the raw pointer to the inner …","Returns the raw pointer to the inner …","Provides a raw pointer to the inner module instance …","","","","","","","","","","","","","","","","","","","","","","Returns the count of loaded plugins.","Creates a new program option.","Creates a new module descriptor.","Creates a new plugin version.","","Creates a module instance which is used to import host …","","","Returns the target plugin by its name.","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Initializes the wasmedge_process plugin module instance …","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Load a single or multiple plugins from a given path.","Load plugins from the default path. The default plugin …","","","Returns the count of the module instances in this plugin.","Returns a plugin module instance that is generated from …","Returns the names of all module instances in this plugin.","Returns the name of this plugin.","","Returns the names of all loaded plugins.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Defines a WebAssembly value.","Returns the raw WasmEdge_Value.","Returns the reference to an external object.","Creates a WasmValue from a reference to an external object.","Creates a WasmValue from a f32 value.","Creates a WasmValue from a f64 value.","Creates a WasmValue from a FuncRef.","Creates a WasmValue from a i32 value.","Creates a WasmValue from a i64 value.","Creates a WasmValue from a RefType value.","Creates a WasmValue from a i128 value.","Returns the FuncRef(crate::FuncRef).","Checks if a WasmValue is NullRef or not.","Generates a f32 value from a WasmValue.","Generates a f64 value from a WasmValue.","Generates a i32 value from a WasmValue.","Generates a i64 value from a WasmValue.","Generates a v128 value from a WasmValue.","Returns the type of a WasmValue.","Triggers the WasmEdge AOT compiler tool","Triggers the WasmEdge runtime tool","Triggers the WasmEdge unified tool","Logs the debug information.","Logs the error information.","Sets the logging system off.","Returns the major version value.","Returns the minor version value.","Returns the patch version value.","Returns the version string."],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,0,115,5,115,5,115,5,115,5,13,13,15,17,19,21,13,24,26,28,30,32,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,42,12,53,26,28,30,34,32,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,42,12,53,26,28,30,34,32,13,13,24,24,24,28,15,13,24,1,38,10,11,40,5,41,42,12,28,30,34,15,13,24,1,38,10,11,40,5,41,42,12,28,30,34,21,21,30,28,13,15,15,21,13,24,26,28,30,32,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,12,53,26,28,30,32,13,13,13,13,15,0,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,42,12,53,26,28,30,34,32,0,15,17,19,21,13,24,49,1,50,50,38,10,51,51,11,52,52,40,5,41,42,12,53,53,26,28,30,34,34,32,26,26,116,116,13,13,13,13,13,13,116,116,13,116,116,116,116,15,0,28,28,13,13,13,13,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,42,12,53,26,28,30,34,32,13,13,13,13,13,116,116,13,13,30,30,17,30,13,13,13,13,13,13,115,17,19,5,13,13,0,13,13,24,24,24,24,24,94,24,94,24,13,13,28,28,13,13,13,13,13,116,116,13,13,13,13,15,13,24,1,38,10,11,40,5,41,42,12,28,30,34,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,42,12,53,26,28,30,34,32,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,42,12,53,26,28,30,34,32,17,19,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,42,12,53,26,28,30,34,32,0,0,32,15,17,19,21,13,24,49,1,50,38,10,51,11,52,40,5,41,42,12,53,26,28,30,34,32,13,13,90,71,89,72,88,87,87,88,90,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,89,73,73,89,90,90,87,88,90,117,118,0,0,89,90,90,0,0,0,73,117,118,87,61,87,0,0,0,0,0,0,0,0,0,0,61,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,0,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,92,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,89,90,0,0,0,0,0,0,0,0,0,0,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,0,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,0,0,0,0,0,0,0,0,0,0,70,61,71,72,73,23,29,74,16,75,76,77,18,20,22,27,33,25,31,78,79,80,81,82,83,84,85,86,87,88,89,90,0,49,49,49,49,0,0,0,0,0,0,0,0,0,1,50,1,1,38,50,1,1,50,50,50,50,1,38,0,0,10,51,10,51,10,51,10,10,51,0,0,11,52,11,52,11,11,11,11,52,52,11,52,11,11,0,0,0,0,42,0,0,115,115,115,115,40,5,41,42,5,41,41,116,40,116,40,116,40,116,40,116,40,41,116,40,116,40,116,40,40,41,116,40,116,40,115,40,41,42,116,40,116,40,0,0,12,53,12,12,53,53,12,12,53,53,12,12,91,91,91,91,91,91,0,0,91,0,0,0,0,0,0,0,91,91,91,91,91,91,105,105,105,106,106,105,108,109,106,105,111,108,91,110,109,93,106,105,111,108,91,110,109,93,106,105,93,91,105,91,105,111,110,109,93,106,105,105,91,111,111,108,91,110,109,93,106,105,111,108,91,91,110,109,93,106,105,111,110,111,108,91,110,109,93,106,105,111,111,93,93,108,108,108,108,105,111,111,93,91,105,111,108,91,110,109,93,106,105,111,108,91,110,109,93,106,105,111,108,91,110,109,93,106,105,111,108,91,110,109,93,106,105,0,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,0,0,0,0,0,0,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,-2,1],2,[],[[4,[3]]]],[[[5,[-1]],-2,1],2,[6,7,8,9],[[4,[3]]]],[[-1,-2,10],2,[],[[4,[3]]]],[[[5,[-1]],-2,10],2,[6,7,8,9],[[4,[3]]]],[[-1,-2,11],2,[],[[4,[3]]]],[[[5,[-1]],-2,11],2,[6,7,8,9],[[4,[3]]]],[[-1,-2,12],2,[],[[4,[3]]]],[[[5,[-1]],-2,12],2,[6,7,8,9],[[4,[3]]]],[[13,14],2],[13,14],[15,16],[17,18],[19,20],[21,22],[13,23],[24,25],[26,27],[28,29],[30,31],[32,33],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[13,14],2],[13,14],[[24,1,-1],[[36,[[35,[34]]]]],37],[[24,38,-1],[[36,[[35,[34]]]]],37],[[24,1,-1,39],[[36,[[35,[34]]]]],37],[28,2],[15,15],[13,13],[24,24],[1,1],[38,38],[10,10],[11,11],[40,40],[[[5,[-1]]],[[5,[-1]]],[9,6,7,8,9]],[41,41],[42,42],[12,12],[28,28],[30,30],[34,34],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[21,-1,-2],[[36,[2]]],[[4,[[44,[43]]]]],[[4,[45]]]],[[21,-1,-2],[[36,[2]]],[[4,[45]]],[[4,[45]]]],[[30,-1],14,[[4,[3]]]],[28,46],[[13,14],2],[15,47],[15,47],[[[48,[13]]],[[36,[21]]]],[[],[[36,[13]]]],[[[48,[13]],[48,[28]]],[[36,[24]]]],[[[48,[13]]],[[36,[26]]]],[[],[[36,[28]]]],[[],[[36,[30]]]],[[[48,[13]]],[[36,[32]]]],[15,2],[17,2],[19,2],[21,2],[13,2],[24,2],[49,2],[1,2],[50,2],[38,2],[10,2],[51,2],[11,2],[52,2],[40,2],[[[5,[-1]]],2,[6,7,8,9]],[41,2],[12,2],[53,2],[26,2],[28,2],[30,2],[32,2],[[13,14],2],[13,14],[[13,14],2],[13,14],[15,[[35,[19]]]],0,[[15,54],55],[[17,54],55],[[19,54],55],[[21,54],55],[[13,54],55],[[24,54],55],[[49,54],55],[[1,54],55],[[50,54],55],[[38,54],55],[[10,54],55],[[51,54],55],[[11,54],55],[[52,54],55],[[40,54],55],[[[5,[-1]],54],55,[56,6,7,8,9]],[[41,54],55],[[42,54],55],[[12,54],55],[[53,54],55],[[26,54],55],[[28,54],55],[[30,54],55],[[34,54],55],[[32,54],55],0,[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[57,50],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[58,51],[-1,-1,[]],[59,52],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[60,53],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[61,34],[-1,-1,[]],[[26,-1],[[36,[15]]],[[4,[[44,[43]]]]]],[[26,-1],[[36,[15]]],[[4,[45]]]],[-1,47,[]],[-1,[[48,[[35,[62]]]]],[]],[[13,14],2],[13,14],[[13,14],2],[13,14],[13,63],[13,64],[[-1,-2],[[36,[1]]],[],[[4,[3]]]],[[-1,-2],[[36,[10]]],[],[[4,[3]]]],[13,47],[[-1,-2],[[36,[11]]],[],[[4,[3]]]],[[-1,-2],[[36,[12]]],[],[[4,[3]]]],[-1,47,[]],[-1,[[48,[[35,[62]]]]],[]],[15,[[35,[17]]]],0,[28,46],[28,65],[[13,14],2],[13,14],[[13,14],2],[13,14],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[13,14],[13,14],[13,14],[[13,14],2],[[13,14],2],[-1,47,[]],[-1,[[48,[[35,[62]]]]],[]],[[13,14],2],[13,14],[[30,-1],[[36,[40]]],[[4,[3]]]],[30,47],[17,[[66,[3]]]],[30,[[48,[[35,[62]]]]]],[[13,14],2],[13,14],[[13,14],2],[13,14],[[13,14],2],[13,14],[-1,3,[]],[17,[[66,[3]]]],[19,[[66,[3]]]],[[[5,[-1]]],3,[6,7,8,9]],[[13,14],2],[13,14],0,[[13,14],2],[13,14],[[24,30,15],[[36,[40]]]],[[24,30,[5,[-1]]],[[36,[2]]],[6,7,8,9]],[[24,30,15,-1],[[36,[40]]],[[4,[3]]]],[[24,30,40],[[36,[2]]]],[[24,30,42],[[36,[2]]]],[[-1,1,-2],[[36,[[35,[34]]]]],[],37],[[24,1,-1],[[36,[[35,[34]]]]],37],[[-1,38,-2],[[36,[[35,[34]]]]],[],37],[[24,38,-1],[[36,[[35,[34]]]]],37],[[13,63],2],[[13,64],2],[[28,46],2],[[28,-1],2,[[4,[[44,[46]]]]]],[[13,47],2],[[13,14],2],[13,14],[[13,14],2],[13,14],[-1,47,[]],[-1,[[48,[[35,[62]]]]],[]],[[13,14],2],[13,14],[[13,14],2],[13,14],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[17,[[36,[68]]]],[19,[[36,[68]]]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],0,0,[[32,15],[[36,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[13,14],2],[13,14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[70,70],[61,61],[71,71],[72,72],[73,73],[23,23],[29,29],[74,74],[16,16],[75,75],[76,76],[77,77],[18,18],[20,20],[22,22],[27,27],[33,33],[25,25],[31,31],[78,78],[79,79],[80,80],[81,81],[82,82],[83,83],[84,84],[85,85],[86,86],[87,87],[88,88],[89,89],[90,90],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],0,[[70,54],55],[[61,54],55],[[71,54],55],[[72,54],55],[[73,54],55],[[23,54],55],[[29,54],55],[[74,54],55],[[16,54],55],[[75,54],55],[[76,54],55],[[77,54],55],[[18,54],55],[[20,54],55],[[22,54],55],[[27,54],55],[[33,54],55],[[25,54],55],[[31,54],55],[[78,54],55],[[79,54],55],[[80,54],55],[[81,54],55],[[82,54],55],[[83,54],55],[[84,54],55],[[85,54],55],[[86,54],55],[[87,54],55],[[88,54],55],[[89,54],55],[[90,54],55],[91,92],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[93,89],[-1,-1,[]],[-1,-1,[]],0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[49,83],[49,[[48,[24]]]],[[49,47],[[48,[11]]]],[49,[[48,[40]]]],0,0,0,0,0,0,0,0,0,[1,79],[50,16],[1,38],[[1,-1,-2],[[36,[[35,[34]]]]],94,37],[[38,-1,-2],[[36,[[35,[34]]]]],94,37],[[-1,-2],[[36,[50]]],37,37],[[50,[96,[95]],[48,[[96,[-1]]]],46],[[36,[1]]],[]],[[50,97,98,98,14,46],[[36,[1]]]],[50,47],[50,[[0,[99]]]],[50,47],[50,[[0,[99]]]],[1,[[36,[50]]]],[38,[[36,[50]]]],0,0,[10,82],[51,77],[[51,34],[[36,[10]]]],[[100,101],[[36,[51]]]],[10,34],[51,101],[[10,34],[[36,[2]]]],[10,[[36,[51]]]],[51,100],0,0,[11,81],[52,75],[52,[[36,[11]]]],[[47,[48,[47]],14],[[36,[52]]]],[[11,47,47],[[36,[43]]]],[[11,47,47],[[36,[43]]]],[[11,47,47],[[36,[[35,[43]]]]]],[[11,47],[[36,[2]]]],[52,[[48,[47]]]],[52,47],[[11,-1,47],[[36,[2]]],[[4,[[44,[43]]]]]],[52,14],[11,47],[11,[[36,[52]]]],0,0,0,0,0,0,0,[[-1,-2,1],2,[],[[4,[3]]]],[[-1,-2,10],2,[],[[4,[3]]]],[[-1,-2,11],2,[],[[4,[3]]]],[[-1,-2,12],2,[],[[4,[3]]]],[40,78],[[[5,[-1]]],78,[6,7,8,9]],[41,78],[42,78],[[-1,[48,[[96,[-2]]]]],[[36,[[5,[-2]]]]],[[4,[3]]],[6,7,8,9]],[[[48,[[35,[3]]]],[48,[[35,[3]]]],[48,[[35,[3]]]]],[[36,[41]]]],[41,47],[-1,47,[]],[40,47],[-1,[[48,[[35,[62]]]]],[]],[40,[[48,[[35,[62]]]]]],[[-1,-2],[[36,[1]]],[],[[4,[3]]]],[[40,-1],[[36,[1]]],[[4,[3]]]],[[-1,-2],[[36,[10]]],[],[[4,[3]]]],[[40,-1],[[36,[10]]],[[4,[3]]]],[[-1,-2],[[36,[11]]],[],[[4,[3]]]],[[40,-1],[[36,[11]]],[[4,[3]]]],[[41,102],[[36,[46]]]],[[-1,-2],[[36,[12]]],[],[[4,[3]]]],[[40,-1],[[36,[12]]],[[4,[3]]]],[-1,47,[]],[40,47],[-1,[[48,[[35,[62]]]]],[]],[40,[[48,[[35,[62]]]]]],[40,[[48,[-1]]],[7,8,9]],[[41,[48,[[35,[3]]]],[48,[[35,[3]]]],[48,[[35,[3]]]]],2],[-1,47,[]],[40,47],[-1,[[48,[[35,[62]]]]],[]],[40,[[48,[[35,[62]]]]]],[-1,3,[]],[40,[[48,[62]]]],[41,3],[42,3],[-1,47,[]],[40,47],[-1,[[48,[[35,[62]]]]],[]],[40,[[48,[[35,[62]]]]]],0,0,[12,80],[53,76],[12,103],[53,[[36,[12]]]],[[104,47,[48,[47]]],[[36,[53]]]],[53,104],[[12,47],[[36,[34]]]],[[12,47],[[36,[2]]]],[53,[[48,[47]]]],[53,47],[[12,34,47],[[36,[2]]]],[12,[[36,[53]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[105,-1,1],2,[[4,[3]]]],[[105,-1,10],2,[[4,[3]]]],[[105,-1,11],2,[[4,[3]]]],[[106,-1,-2,[48,[107]]],[[36,[106]]],[[4,[3]]],[[4,[3]]]],[[106,-1,-2,91],[[36,[106]]],[[4,[3]]],[[4,[3]]]],[[105,-1,12],2,[[4,[3]]]],[108,86],[109,88],[106,90],[105,78],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[91,91],[105,105],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[],47],[[-1,-2,91],[[36,[110]]],[[4,[3]]],[[4,[3]]]],[[-1,-2,[48,[107]]],[[36,[109]]],[[4,[3]]],[[4,[3]]]],[[47,47,47,47],93],[[-1,-2,93],[[36,[106]]],[[4,[3]]],[[4,[3]]]],[[-1,[48,[[96,[-2]]]]],[[36,[105]]],[[4,[3]]],[6,7,8,9]],[105,2],[[91,91],14],[-1,[[36,[108]]],[[4,[3]]]],[[111,54],55],[[108,54],55],[[91,54],55],[[110,54],55],[[109,54],55],[[93,54],55],[[106,54],55],[[105,54],55],[-1,-1,[]],[-1,-1,[]],[92,91],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[48,[[35,[3]]]],14],2],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[36,[2]]],[[4,[45]]]],[[],2],0,0,[108,47],[[108,-1],[[36,[40]]],[[4,[3]]]],[108,[[35,[62]]]],[108,62],[105,3],[[],[[35,[62]]]],[[[35,[3]]],2],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,[[67,[-2]]],[],[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,69,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,[34,61],[34,[[48,[-1]]],[]],[-1,34,[]],[112,34],[65,34],[38,34],[102,34],[113,34],[104,34],[114,34],[34,[[48,[38]]]],[34,14],[34,112],[34,65],[34,102],[34,113],[34,114],[34,100],[-1,102,37],[-1,102,37],[-1,102,37],[[],2],[[],2],[[],2],[[],47],[[],47],[[],47],[[],62]],"c":[],"p":[[3,"Function",0],[15,"tuple"],[15,"str"],[8,"AsRef",1776],[3,"ImportModule",0],[8,"Sized",1777],[8,"Send",1777],[8,"Sync",1777],[8,"Clone",1778],[3,"Global",0],[3,"Memory",0],[3,"Table",0],[3,"Config",0],[15,"bool"],[3,"Module",0],[3,"WasmEdge_FunctionTypeContext",458],[3,"ImportType",0],[3,"WasmEdge_ImportTypeContext",458],[3,"ExportType",0],[3,"WasmEdge_ExportTypeContext",458],[3,"Compiler",0],[3,"WasmEdge_CompilerContext",458],[3,"WasmEdge_ConfigureContext",458],[3,"Executor",0],[3,"WasmEdge_ExecutorContext",458],[3,"Loader",0],[3,"WasmEdge_LoaderContext",458],[3,"Statistics",0],[3,"WasmEdge_StatisticsContext",458],[3,"Store",0],[3,"WasmEdge_StoreContext",458],[3,"Validator",0],[3,"WasmEdge_ValidatorContext",458],[3,"WasmValue",0],[3,"Vec",1779],[6,"WasmEdgeResult",1780],[8,"IntoIterator",1781],[3,"FuncRef",0],[3,"Duration",1782],[3,"Instance",0],[3,"WasiModule",0],[4,"WasiInstance",0],[15,"u8"],[15,"slice"],[3,"Path",1783],[15,"u64"],[15,"u32"],[4,"Option",1784],[3,"CallingFrame",0],[3,"FuncType",0],[3,"GlobalType",0],[3,"MemType",0],[3,"TableType",0],[3,"Formatter",1785],[6,"Result",1785],[8,"Debug",1785],[3,"FuncType",1780],[3,"GlobalType",1780],[3,"MemoryType",1780],[3,"TableType",1780],[3,"WasmEdge_Value",458],[3,"String",1786],[4,"CompilerOutputFormat",1780],[4,"CompilerOptimizationLevel",1780],[15,"f64"],[4,"Cow",1787],[4,"Result",1788],[4,"ExternalInstanceType",1780],[3,"TypeId",1789],[3,"__fsid_t",458],[3,"WasmEdge_String",458],[3,"WasmEdge_Result",458],[3,"WasmEdge_Limit",458],[3,"WasmEdge_ASTModuleContext",458],[3,"WasmEdge_MemoryTypeContext",458],[3,"WasmEdge_TableTypeContext",458],[3,"WasmEdge_GlobalTypeContext",458],[3,"WasmEdge_ModuleInstanceContext",458],[3,"WasmEdge_FunctionInstanceContext",458],[3,"WasmEdge_TableInstanceContext",458],[3,"WasmEdge_MemoryInstanceContext",458],[3,"WasmEdge_GlobalInstanceContext",458],[3,"WasmEdge_CallingFrameContext",458],[3,"WasmEdge_Async",458],[3,"WasmEdge_VMContext",458],[3,"WasmEdge_PluginContext",458],[3,"WasmEdge_ProgramOption",458],[3,"WasmEdge_ModuleDescriptor",458],[3,"WasmEdge_PluginVersionData",458],[3,"WasmEdge_PluginDescriptor",458],[4,"ProgramOptionType",1612],[6,"WasmEdge_ProgramOptionType",458],[3,"PluginVersion",1612],[8,"Engine",0],[8,"Fn",1790],[3,"Box",1791],[6,"CustomFnWrapper",1504],[4,"c_void",1792],[8,"Iterator",1793],[4,"ValType",1780],[4,"Mutability",1780],[15,"i32"],[15,"usize"],[4,"RefType",1780],[3,"PluginModule",1612],[3,"PluginDescriptor",1612],[6,"ModuleInstanceCreateFn",1612],[3,"Plugin",1612],[3,"ModuleDescriptor",1612],[3,"ProgramOption",1612],[3,"PluginManager",1612],[15,"f32"],[15,"i64"],[15,"i128"],[8,"AsImport",0],[8,"AsInstance",0],[6,"WasmEdge_HostFunc_t",458],[6,"WasmEdge_WrapFunc_t",458]],"b":[]},\ +"wasmedge_types":{"doc":"The wasmedge-types crate defines a group of common data …","t":"EENNNNENNNNNDNDENNNDENENNNNNNNENDNENNNNNNNNNNGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFNNNNNNNEEEEEENNNNNNNNNNNNNNNNNNNNNNNNNNNNENNNENNNNNNENNNENNNNNNENNNNNNENNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNENNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNENNNNNNNNENENNNNNNNNNNNNNNNNNNNNNNNNNNEENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMM","n":["CompilerOptimizationLevel","CompilerOutputFormat","Const","Err","ExternRef","ExternRef","ExternalInstanceType","F32","F64","Func","FuncRef","FuncRef","FuncType","Global","GlobalType","HostRegistration","I32","I64","Memory","MemoryType","Mutability","Native","NeverType","O0","O1","O2","O3","Ok","Os","Oz","RefType","Table","TableType","V128","ValType","Var","Wasi","WasiCryptoAsymmetricCommon","WasiCryptoCommon","WasiCryptoKx","WasiCryptoSignatures","WasiCryptoSymmetric","WasiNn","Wasm","WasmEdgeProcess","WasmEdgeResult","args","args_len","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","default","elem_ty","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","error","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","hash","into","into","into","into","into","into","into","into","into","into","into","into","maximum","maximum","minimum","minimum","mutability","new","new","new","new","returns","returns_len","shared","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","value_ty","wat2wasm","AOTDisabled","Common","CompilerCreate","ConfigCreate","ConstExprRequired","ConstPtr","Core","CoreCommonError","CoreError","CoreExecutionError","CoreInstantiationError","CoreLoadError","CoreValidationError","CostLimitExceeded","Create","Create","Create","Create","Create","Create","Create","Create","CreateBinding","CreateImportModule","CreateSharedType","CreateWasi","CreateWasmEdgeProcess","CreateWithWasiContext","DataCountRequired","DataSegDoesNotFit","DivideByZero","DupExportName","DuplicateImportModule","DuplicateModuleInstance","ElemSegDoesNotFit","ExecuteTimeout","Execution","ExecutorCreate","ExpectSharedMemory","ExpectedZeroByte","Export","ExportError","FoundNulByte","FromUtf8","Func","FuncError","FuncNotFound","FuncType","FuncType","FuncTypeCreate","FuncTypeMismatch","Global","GlobalError","GlobalType","GlobalType","GlobalTypeCreate","HostFuncError","HostFuncFailed","IllegalGrammar","IllegalOpCode","IllegalPath","ImmutableGlobal","Import","ImportError","ImportObjCreate","IncompatibleDataCount","IncompatibleFuncCode","IncompatibleImportType","IndirectCallTypeMismatch","Instance","InstanceError","Instantiation","InstrTypeMismatch","IntegerOverflow","IntegerTooLarge","IntegerTooLong","Interrupted","InvalidAlignment","InvalidConvToInt","InvalidDataIdx","InvalidElemIdx","InvalidFuncIdx","InvalidFuncTypeIdx","InvalidGlobalIdx","InvalidImportModule","InvalidLabelIdx","InvalidLaneIdx","InvalidLimit","InvalidLocalIdx","InvalidMemPages","InvalidMemoryIdx","InvalidMut","InvalidRefIdx","InvalidResultArity","InvalidStartFunc","InvalidTableIdx","JunkSection","Load","LoaderCreate","MalformedElemType","MalformedExportKind","MalformedImportKind","MalformedMagic","MalformedRefType","MalformedSection","MalformedUTF8","MalformedValType","MalformedVersion","Mem","MemError","MemType","MemType","MemTypeCreate","MemoryOutOfBounds","ModifyConst","ModuleCreate","ModuleNameConflict","MultiMemories","MultiTables","MutPtr","NameSizeOutOfBounds","NotFound","NotFoundActiveModule","NotFoundActiveModule","NotFoundExecutor","NotFoundFunc","NotFoundFunc","NotFoundFuncRegistered","NotFoundFuncType","NotFoundGlobal","NotFoundGlobal","NotFoundGlobalRegistered","NotFoundImportModule","NotFoundLoader","NotFoundMappedFdHandler","NotFoundMem","NotFoundMem","NotFoundMemRegistered","NotFoundModule","NotFoundModule","NotFoundNulByte","NotFoundStatistics","NotFoundStore","NotFoundTable","NotFoundTable","NotFoundTableRegistered","NotFoundValidator","NotFoundWasiCryptoAsymmetricCommonModule","NotFoundWasiCryptoCommonModule","NotFoundWasiCryptoKxModule","NotFoundWasiCryptoSignaturesModule","NotFoundWasiCryptoSymmetricModule","NotFoundWasiModule","NotFoundWasiNnModule","NotFoundWasmEdgeProcessModule","NotValidated","Operation","Plugin","PluginError","Ptr2Ref","ReadError","RefTypeMismatch","Runtime","RuntimeError","SectionSizeMismatch","StatisticsCreate","Store","StoreError","Table","TableError","TableOutOfBounds","TableType","TableType","TableTypeCreate","TooManyLocals","Type","Type","Type","Type","Type","Type","TypeCheckFailed","UnalignedAtomicAccess","UndefinedElement","UnexpectedEnd","UninitializedElement","UnknownImport","UnmatchedValType","Unreachable","User","User","UserDefError","Utf8","Validation","ValidatorCreate","Vm","VmError","WasmEdgeError","WindowsPathConversion","WrongInstanceAddress","WrongInstanceIndex","WrongVMWorkflow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","source","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","actual","expected","actual","expected","func_name","global_name","mem_name","mod_name","mod_name","mod_name","mod_name","table_name"],"q":[[0,"wasmedge_types"],[227,"wasmedge_types::error"],[686,"wasmedge_types::error::ExportError"],[688,"wasmedge_types::error::ImportError"],[690,"wasmedge_types::error::StoreError"],[698,"core::option"],[699,"core::fmt"],[700,"core::fmt"],[701,"alloc::vec"],[702,"alloc::string"],[703,"core::result"],[704,"core::any"],[705,"alloc::borrow"],[706,"wat"],[707,"alloc::string"],[708,"core::str::error"],[709,"alloc::ffi::c_str"],[710,"core::error"]],"d":["Defines WasmEdge AOT compiler optimization level.","Defines WasmEdge AOT compiler output binary format.","Identifies an immutable global variable.","Contains the error value","Refers to the infinite union of all references to objects …","A reference to object.","Defines the type of external WasmEdge instances.","32-bit floating-point data as defined by the IEEE 754-2019.","64-bit floating-point data as defined by the IEEE 754-2019.","A WasmEdge instance that is a WasmEdge Func.","Refers to the infinite union of all references to host …","A reference to a host function.","Struct of WasmEdge FuncType.","A WasmEdge instance that is a WasmEdge Global.","Struct of WasmEdge GlobalType.","Defines WasmEdge host module registration enum.","32-bit integer.","64-bit integer.","A WasmEdge instance that is a WasmEdge Memory.","Struct of WasmEdge MemoryType.","Defines the mutability property of WasmEdge Global …","Native dynamic library format.","This is a workaround solution to the never type in Rust. …","Disable as many optimizations as possible.","Optimize quickly without destroying debuggability.","Optimize for fast execution as much as possible without …","Optimize for fast execution as much as possible.","Contains the success value","Optimize for small code size as much as possible without …","Optimize for small code size as much as possible.","Defines WasmEdge reference types.","A WasmEdge instance that is a WasmEdge Table.","Struct of WasmEdge TableType.","128-bit vector of packed integer or floating-point data.","Defines WasmEdge value types.","Identifies a mutable global variable.","","","","","","","","WebAssembly with AOT compiled codes in custom sections.","","The WasmEdge result type.","Returns the types of the arguments of a host function.","Returns the number of the arguments of a host function.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the element type defined in the TableType.","","","","","","","","","","","","Defines WasmEdge error types.","","","","","","","","","","","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns the maximum size defined in the TableType.","Returns the maximum size defined in the MemoryType.","Returns the minimum size defined in the TableType.","Returns the minimum size defined in the MemoryType.","Returns the value mutability property defined in the …","Creates a new FuncType with the given types of arguments …","Creates a new TableType with the given element type and …","Creates a new MemoryType with the given size range.","Creates a new GlobalType with the given value type and …","Returns the types of the returns of a host function.","Returns the number of the returns of a host function.","Returns whether the memory is shared.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the value type defined in the GlobalType.","Parses in-memory bytes as either the WebAssembly Text …","","","","","","","Errors raised by WasmEdge Core.","The error type for the common errors from WasmEdge Core.","The error types raised by WasmEdge Core.","The error type for the execution phase from WasmEdge Core.","The error type for the instantiation phase from WasmEdge …","The error type for the load phase from WasmEdge Core.","The error type for the validation phase from WasmEdge Core.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The error types for WasmEdge ExportType.","","","","The error types for WasmEdge Function.","","","","","","","The error types for WasmEdge Global.","","","","The error type for the host function definition.","","","","","","","The error types for WasmEdge ImportType.","","","","","","","The error types for WasmEdge Instance.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The error types for WasmEdge Memory.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The error types for WasmEdge plugin.","","","","","","","","","The error types for WasmEdge Store.","","The error types for WasmEdge Table.","","","","","","","","","","","","","","","","","","","","","","","","","","","The error types for WasmEdge Vm.","The error types used by both wasmedge-sys and wasmedge …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,7,23,6,2,0,2,2,11,6,2,0,11,0,0,2,2,11,0,0,9,0,8,8,8,8,23,8,8,0,11,0,2,0,7,10,10,10,10,10,10,10,9,10,0,1,1,6,2,7,8,9,10,11,1,12,13,14,15,6,2,7,8,9,10,11,1,12,13,14,15,6,2,7,8,9,10,11,1,12,13,14,15,6,2,7,8,9,10,11,1,12,13,14,15,1,12,13,14,12,6,2,7,8,9,10,11,1,12,13,14,0,6,2,7,8,9,10,11,11,1,12,13,14,15,6,6,6,2,2,2,7,7,7,8,8,8,9,9,9,10,10,11,11,11,1,12,13,14,15,10,6,2,7,8,9,10,11,1,12,13,14,15,12,13,12,13,14,1,12,13,14,1,1,13,6,2,7,8,9,10,11,1,12,13,14,15,11,6,2,7,8,9,10,11,1,12,13,14,15,6,2,7,8,9,10,11,1,12,13,14,15,6,2,7,8,9,10,11,1,12,13,14,15,14,0,42,41,30,30,44,32,30,0,0,0,0,0,0,42,31,32,33,34,37,38,39,40,31,37,32,37,37,40,43,45,46,44,40,40,45,30,41,30,46,43,30,0,30,30,30,0,42,35,36,30,46,30,0,35,36,30,0,46,43,43,43,44,30,0,30,43,43,45,46,30,0,41,46,46,43,43,42,44,46,44,44,44,44,44,40,44,44,44,44,44,44,43,44,44,44,44,43,41,30,43,43,43,43,43,43,43,43,43,30,0,35,36,30,46,33,30,45,44,44,32,43,38,39,40,40,37,39,39,40,37,39,39,40,40,37,37,39,39,39,40,30,40,40,37,39,39,40,40,40,40,40,40,40,40,40,42,30,30,0,32,43,46,47,42,43,30,30,0,30,0,46,35,36,30,43,31,32,33,34,35,36,44,46,46,43,46,45,33,46,30,47,42,30,41,30,30,0,0,30,46,46,42,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,30,30,30,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,53,53,54,54,55,56,57,55,58,57,56,58],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[4,[[3,[2]]]]]],[1,5],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,6],[2,2],[7,7],[8,8],[9,9],[10,10],[11,11],[1,1],[12,12],[13,13],[14,14],[15,15],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[],1],[[],12],[[],13],[[],14],[12,6],[[6,6],17],[[2,2],17],[[7,7],17],[[8,8],17],[[9,9],17],[[10,10],17],[[11,11],17],[[1,1],17],[[12,12],17],[[13,13],17],[[14,14],17],0,[[6,18],19],[[2,18],19],[[7,18],19],[[8,18],19],[[9,18],19],[[10,18],19],[[11,18],19],[[11,18],19],[[1,18],19],[[12,18],19],[[13,18],19],[[14,18],19],[[15,18],19],[-1,-1,[]],[20,6],[5,6],[5,2],[-1,-1,[]],[20,2],[20,7],[5,7],[-1,-1,[]],[-1,-1,[]],[20,8],[5,8],[20,9],[-1,-1,[]],[5,9],[-1,-1,[]],[5,10],[5,11],[20,11],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[10,-1],16,21],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[12,[[4,[5]]]],[13,[[4,[5]]]],[12,5],[13,5],[14,7],[[[4,[[22,[2]]]],[4,[[22,[2]]]]],1],[[6,5,[4,[5]]],12],[[5,[4,[5]],17],[[23,[13]]]],[[2,7],14],[1,[[4,[[3,[2]]]]]],[1,5],[13,17],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,24,[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[14,2],[[[3,[27]]],[[25,[[28,[[3,[27]]]],29]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[30,30],[31,31],[32,32],[33,33],[34,34],[35,35],[36,36],[37,37],[38,38],[39,39],[40,40],[41,41],[42,42],[43,43],[44,44],[45,45],[46,46],[47,47],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[-1,-2],16,[],[]],[[30,30],17],[[31,31],17],[[32,32],17],[[33,33],17],[[34,34],17],[[35,35],17],[[36,36],17],[[37,37],17],[[38,38],17],[[39,39],17],[[40,40],17],[[41,41],17],[[42,42],17],[[43,43],17],[[44,44],17],[[45,45],17],[[46,46],17],[[47,47],17],[[30,18],19],[[30,18],19],[[31,18],19],[[31,18],19],[[32,18],19],[[32,18],19],[[33,18],19],[[33,18],19],[[34,18],19],[[34,18],19],[[35,18],19],[[35,18],19],[[36,18],19],[[36,18],19],[[37,18],19],[[37,18],19],[[38,18],19],[[38,18],19],[[39,18],19],[[39,18],19],[[40,18],19],[[40,18],19],[[41,18],19],[[41,18],19],[[42,18],19],[[42,18],19],[[43,18],19],[[43,18],19],[[44,18],19],[[44,18],19],[[45,18],19],[[45,18],19],[[46,18],19],[[46,18],19],[[47,18],19],[[47,18],19],[48,30],[49,30],[50,30],[-1,-1,[]],[51,30],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[30,[[4,[52]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,24,[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,[[25,[-2]]],[],[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],[-1,26,[]],0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"FuncType",0],[4,"ValType",0],[15,"slice"],[4,"Option",698],[15,"u32"],[4,"RefType",0],[4,"Mutability",0],[4,"CompilerOptimizationLevel",0],[4,"CompilerOutputFormat",0],[4,"HostRegistration",0],[4,"ExternalInstanceType",0],[3,"TableType",0],[3,"MemoryType",0],[3,"GlobalType",0],[4,"NeverType",0],[15,"tuple"],[15,"bool"],[3,"Formatter",699],[6,"Result",699],[15,"i32"],[8,"Hasher",700],[3,"Vec",701],[6,"WasmEdgeResult",0],[3,"String",702],[4,"Result",703],[3,"TypeId",704],[15,"u8"],[4,"Cow",705],[3,"Error",706],[4,"WasmEdgeError",227],[4,"FuncError",227],[4,"MemError",227],[4,"GlobalError",227],[4,"TableError",227],[4,"ImportError",227],[4,"ExportError",227],[4,"InstanceError",227],[4,"PluginError",227],[4,"StoreError",227],[4,"VmError",227],[4,"CoreError",227],[4,"CoreCommonError",227],[4,"CoreLoadError",227],[4,"CoreValidationError",227],[4,"CoreInstantiationError",227],[4,"CoreExecutionError",227],[4,"HostFuncError",227],[3,"FromUtf8Error",702],[3,"FromBytesWithNulError",707],[3,"Utf8Error",708],[3,"NulError",709],[8,"Error",710],[13,"Type",686],[13,"Type",688],[13,"NotFoundFuncRegistered",690],[13,"NotFoundGlobalRegistered",690],[13,"NotFoundMemRegistered",690],[13,"NotFoundTableRegistered",690]],"b":[[119,"impl-Display-for-ExternalInstanceType"],[120,"impl-Debug-for-ExternalInstanceType"],[127,"impl-From%3Ci32%3E-for-RefType"],[128,"impl-From%3Cu32%3E-for-RefType"],[129,"impl-From%3Cu32%3E-for-ValType"],[131,"impl-From%3Ci32%3E-for-ValType"],[132,"impl-From%3Ci32%3E-for-Mutability"],[133,"impl-From%3Cu32%3E-for-Mutability"],[136,"impl-From%3Ci32%3E-for-CompilerOptimizationLevel"],[137,"impl-From%3Cu32%3E-for-CompilerOptimizationLevel"],[138,"impl-From%3Ci32%3E-for-CompilerOutputFormat"],[140,"impl-From%3Cu32%3E-for-CompilerOutputFormat"],[143,"impl-From%3Cu32%3E-for-ExternalInstanceType"],[144,"impl-From%3Ci32%3E-for-ExternalInstanceType"],[519,"impl-Debug-for-WasmEdgeError"],[520,"impl-Display-for-WasmEdgeError"],[521,"impl-Debug-for-FuncError"],[522,"impl-Display-for-FuncError"],[523,"impl-Display-for-MemError"],[524,"impl-Debug-for-MemError"],[525,"impl-Debug-for-GlobalError"],[526,"impl-Display-for-GlobalError"],[527,"impl-Display-for-TableError"],[528,"impl-Debug-for-TableError"],[529,"impl-Display-for-ImportError"],[530,"impl-Debug-for-ImportError"],[531,"impl-Debug-for-ExportError"],[532,"impl-Display-for-ExportError"],[533,"impl-Display-for-InstanceError"],[534,"impl-Debug-for-InstanceError"],[535,"impl-Display-for-PluginError"],[536,"impl-Debug-for-PluginError"],[537,"impl-Display-for-StoreError"],[538,"impl-Debug-for-StoreError"],[539,"impl-Display-for-VmError"],[540,"impl-Debug-for-VmError"],[541,"impl-Display-for-CoreError"],[542,"impl-Debug-for-CoreError"],[543,"impl-Display-for-CoreCommonError"],[544,"impl-Debug-for-CoreCommonError"],[545,"impl-Debug-for-CoreLoadError"],[546,"impl-Display-for-CoreLoadError"],[547,"impl-Debug-for-CoreValidationError"],[548,"impl-Display-for-CoreValidationError"],[549,"impl-Debug-for-CoreInstantiationError"],[550,"impl-Display-for-CoreInstantiationError"],[551,"impl-Display-for-CoreExecutionError"],[552,"impl-Debug-for-CoreExecutionError"],[553,"impl-Debug-for-HostFuncError"],[554,"impl-Display-for-HostFuncError"],[555,"impl-From%3CFromUtf8Error%3E-for-WasmEdgeError"],[556,"impl-From%3CFromBytesWithNulError%3E-for-WasmEdgeError"],[557,"impl-From%3CUtf8Error%3E-for-WasmEdgeError"],[559,"impl-From%3CNulError%3E-for-WasmEdgeError"]]}\ +}'); +if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; +if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/settings.html b/settings.html new file mode 100644 index 000000000..8b8aa0efd --- /dev/null +++ b/settings.html @@ -0,0 +1 @@ +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src-files.js b/src-files.js new file mode 100644 index 000000000..8ac70dbde --- /dev/null +++ b/src-files.js @@ -0,0 +1,8 @@ +var srcIndex = JSON.parse('{\ +"async_wasi":["",[["snapshots",[["common",[["net",[],["async_tokio.rs","mod.rs"]],["vfs",[],["mod.rs","sync.rs"]]],["clock.rs","error.rs","memory.rs","mod.rs","types.rs"]],["preview_1",[],["async_poll.rs","async_socket.rs","mod.rs"]]],["env.rs","mod.rs"]]],["lib.rs","object_pool.rs"]],\ +"wasmedge_macro":["",[],["lib.rs"]],\ +"wasmedge_sdk":["",[["externals",[],["function.rs","global.rs","memory.rs","mod.rs","table.rs"]]],["caller.rs","compiler.rs","config.rs","dock.rs","executor.rs","import.rs","instance.rs","io.rs","lib.rs","log.rs","module.rs","plugin.rs","statistics.rs","store.rs","types.rs","utils.rs","vm.rs","wasi.rs"]],\ +"wasmedge_sys":["",[["instance",[],["function.rs","global.rs","memory.rs","mod.rs","module.rs","table.rs"]]],["ast_module.rs","compiler.rs","config.rs","executor.rs","frame.rs","io.rs","lib.rs","loader.rs","plugin.rs","statistics.rs","store.rs","types.rs","utils.rs","validator.rs"]],\ +"wasmedge_types":["",[],["error.rs","lib.rs"]]\ +}'); +createSrcSidebar(); diff --git a/src/async_wasi/lib.rs.html b/src/async_wasi/lib.rs.html new file mode 100644 index 000000000..73ed452e7 --- /dev/null +++ b/src/async_wasi/lib.rs.html @@ -0,0 +1,35 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
#![doc(
+    html_logo_url = "https://github.com/cncf/artwork/blob/master/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.png?raw=true",
+    html_favicon_url = "https://raw.githubusercontent.com/cncf/artwork/49169bdbc88a7ce3c4a722c641cc2d548bd5c340/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.svg"
+)]
+
+//! The [async-wasi](https://crates.io/crates/async-wasi) crate implements WASI spec for the asynchronous scenarios.
+//!
+//! See also
+//!
+//! * [WasmEdge Runtime](https://wasmedge.org/)
+//!
+
+pub mod object_pool;
+#[allow(clippy::too_many_arguments)]
+pub mod snapshots;
+
+pub use snapshots::WasiCtx;
+
\ No newline at end of file diff --git a/src/async_wasi/object_pool.rs.html b/src/async_wasi/object_pool.rs.html new file mode 100644 index 000000000..e426d6dcf --- /dev/null +++ b/src/async_wasi/object_pool.rs.html @@ -0,0 +1,1745 @@ +object_pool.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+
use serde::{Deserialize, Serialize};
+
+#[derive(Debug)]
+pub struct ObjectPool<T> {
+    stores: Vec<Vec<ObjectNode<T>>>,
+}
+impl<T> Default for ObjectPool<T> {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+impl<T> ObjectPool<T> {
+    const DEFAULT_CAPACITY: usize = 512;
+
+    pub fn new() -> Self {
+        let mut pool = ObjectPool {
+            stores: Vec::with_capacity(10),
+        };
+        pool.extend_stores();
+        pool
+    }
+
+    #[inline]
+    fn raw_index(index: usize) -> (usize, usize) {
+        (
+            index / Self::DEFAULT_CAPACITY,
+            index % Self::DEFAULT_CAPACITY,
+        )
+    }
+
+    fn extend_stores(&mut self) -> &mut [ObjectNode<T>] {
+        let mut new_vec = Vec::with_capacity(Self::DEFAULT_CAPACITY);
+        new_vec.resize_with(Self::DEFAULT_CAPACITY, ObjectNode::default);
+        new_vec[0].header.next_chunk_offset = Self::DEFAULT_CAPACITY;
+        self.stores.push(new_vec);
+        self.stores.last_mut().unwrap()
+    }
+
+    pub fn push(&mut self, value: T) -> (usize, Option<T>) {
+        if let Some(ObjectIndex {
+            store_index,
+            target_index,
+            chunk_index,
+        }) = self.first_none()
+        {
+            let v = self.stores[store_index][target_index].obj.replace(value);
+
+            //try merge chunk
+            {
+                let current_chunk = &mut self.stores[store_index][chunk_index].header;
+                current_chunk.next_none_offset += 1;
+                if current_chunk.next_none_offset == current_chunk.next_chunk_offset
+                    && current_chunk.next_chunk_offset < Self::DEFAULT_CAPACITY
+                {
+                    let next_chunk_offset = current_chunk.next_chunk_offset;
+                    let next_chunk = self.stores[store_index][next_chunk_offset].header;
+
+                    let current_chunk = &mut self.stores[store_index][chunk_index].header;
+                    *current_chunk = next_chunk;
+                }
+            }
+
+            (store_index * Self::DEFAULT_CAPACITY + target_index, v)
+        } else {
+            let store = self.extend_stores();
+            let node = &mut store[0];
+            node.header.next_none_offset += 1;
+            let v = node.obj.replace(value);
+            ((self.stores.len() - 1) * Self::DEFAULT_CAPACITY, v)
+        }
+    }
+
+    pub fn remove(&mut self, index: usize) -> Option<T> {
+        let (
+            ObjectIndex {
+                store_index,
+                target_index,
+                chunk_index,
+            },
+            last_chunk_index,
+        ) = self.value_and_chunk(index)?;
+
+        let v = self.stores[store_index][target_index].obj.take()?;
+        let current_chunk = &mut self.stores[store_index][chunk_index].header;
+
+        // try update chunk header
+        {
+            if target_index == current_chunk.next_none_offset - 1 {
+                current_chunk.next_none_offset = target_index;
+                if chunk_index == current_chunk.next_none_offset {
+                    let next_chunk = current_chunk.next_chunk_offset;
+                    let last_chunk = &mut self.stores[store_index][last_chunk_index].header;
+                    last_chunk.next_chunk_offset = next_chunk;
+                }
+            } else if target_index == chunk_index {
+                if index == 0 {
+                    let new_chunk = *current_chunk;
+                    current_chunk.next_none_offset = 0;
+                    current_chunk.next_chunk_offset = 1;
+                    let next_chunk = &mut self.stores[store_index][1].header;
+                    *next_chunk = new_chunk;
+                } else {
+                    let new_chunk = *current_chunk;
+                    let next_chunk = &mut self.stores[store_index][target_index + 1].header;
+                    *next_chunk = new_chunk;
+                    let last_chunk = &mut self.stores[store_index][last_chunk_index].header;
+                    last_chunk.next_chunk_offset += 1;
+                }
+            } else {
+                let new_chunk = *current_chunk;
+                current_chunk.next_chunk_offset = target_index + 1;
+                current_chunk.next_none_offset = target_index;
+                let next_chunk = &mut self.stores[store_index][target_index + 1].header;
+                *next_chunk = new_chunk;
+            }
+        }
+
+        Some(v)
+    }
+
+    fn empty_chunk(&self) -> Option<(usize, bool)> {
+        let chunk_headers = self.stores.iter().map(|s| s[0].header).rev();
+
+        if chunk_headers.len() <= 1 {
+            return None;
+        }
+
+        let empty_chunk = ChunkHead {
+            next_none_offset: 0,
+            next_chunk_offset: Self::DEFAULT_CAPACITY,
+        };
+
+        let mut empty_num = 0;
+        let mut res_chunk_is_full = false;
+
+        for chunk in chunk_headers {
+            if chunk == empty_chunk {
+                empty_num += 1;
+            } else {
+                if chunk.next_chunk_offset == chunk.next_none_offset {
+                    res_chunk_is_full = true;
+                }
+                break;
+            }
+        }
+        if empty_num == 0 {
+            None
+        } else {
+            Some((empty_num, res_chunk_is_full))
+        }
+    }
+
+    pub fn cleanup_stores(&mut self) {
+        if let Some((mut n, res_is_full)) = self.empty_chunk() {
+            if res_is_full {
+                n -= 1;
+            }
+            for _ in 0..n {
+                self.stores.pop();
+            }
+        }
+    }
+
+    #[allow(clippy::never_loop)]
+    fn first_none(&self) -> Option<ObjectIndex> {
+        for (store_index, store) in self.stores.iter().enumerate() {
+            'next_chunk: loop {
+                let node = &store[0];
+                let header = node.header;
+                if header.next_none_offset == Self::DEFAULT_CAPACITY {
+                    break 'next_chunk;
+                }
+                return Some(ObjectIndex {
+                    store_index,
+                    target_index: header.next_none_offset,
+                    chunk_index: 0,
+                });
+            }
+        }
+        None
+    }
+
+    fn value_and_chunk(&self, index: usize) -> Option<(ObjectIndex, usize)> {
+        let (store_index, value_index) = Self::raw_index(index);
+        let store = self.stores.get(store_index)?;
+        let mut last_chunk_index = 0;
+        let mut chunk_index = 0;
+        loop {
+            let node = &store[chunk_index];
+            debug_assert!(node.header.next_chunk_offset > chunk_index);
+            if value_index < node.header.next_chunk_offset {
+                return Some((
+                    ObjectIndex {
+                        store_index,
+                        target_index: value_index,
+                        chunk_index,
+                    },
+                    last_chunk_index,
+                ));
+            }
+            last_chunk_index = chunk_index;
+            chunk_index = node.header.next_chunk_offset;
+            debug_assert!(chunk_index < Self::DEFAULT_CAPACITY);
+            if chunk_index >= Self::DEFAULT_CAPACITY {
+                return None;
+            }
+        }
+    }
+
+    pub fn get(&self, index: usize) -> Option<&T> {
+        let (store_index, target_index) = Self::raw_index(index);
+        let store = self.stores.get(store_index)?;
+        let obj_node = &store[target_index];
+        obj_node.obj.as_ref()
+    }
+
+    pub fn get_mut(&mut self, index: usize) -> Option<&mut T> {
+        let (store_index, target_index) = Self::raw_index(index);
+        let store = self.stores.get_mut(store_index)?;
+        let obj_node = &mut store[target_index];
+        obj_node.obj.as_mut()
+    }
+}
+
+impl<T: Clone> Clone for ObjectPool<T> {
+    fn clone(&self) -> Self {
+        ObjectPool {
+            stores: self.stores.clone(),
+        }
+    }
+}
+
+impl<T> ObjectPool<T> {
+    pub fn iter(&self) -> impl Iterator<Item = Option<&T>> {
+        let skip_end = self.empty_chunk().map(|(n, _)| n).unwrap_or(0);
+        let stores_len = self.stores.len();
+        self.stores[0..(stores_len - skip_end)]
+            .iter()
+            .flat_map(|store| store.iter())
+            .map(|node| node.obj.as_ref())
+    }
+
+    pub fn iter_mut(&mut self) -> impl Iterator<Item = Option<&mut T>> {
+        let skip_end = self.empty_chunk().map(|(n, _)| n).unwrap_or(0);
+        let stores_len = self.stores.len();
+        self.stores[0..(stores_len - skip_end)]
+            .iter_mut()
+            .flat_map(|store| store.iter_mut())
+            .map(|node| node.obj.as_mut())
+    }
+}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub struct SerialObjectPool<T>(Vec<Vec<SerializeChunk<T>>>);
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+struct SerializeChunk<T> {
+    next_none: usize,
+    next_chunk: usize,
+    values: Vec<T>,
+}
+
+impl<T> SerialObjectPool<T> {
+    pub fn into<U, F: FnMut(T) -> U>(self, mut f: F) -> ObjectPool<U> {
+        let mut pool = ObjectPool {
+            stores: Vec::with_capacity(self.0.len()),
+        };
+
+        for serial_store in self.0 {
+            let stores = pool.extend_stores();
+            let mut chunk_id = 0;
+
+            for serial_chunk in serial_store {
+                let chunk = &mut stores[chunk_id];
+                chunk.header.next_chunk_offset = serial_chunk.next_chunk;
+                chunk.header.next_none_offset = serial_chunk.next_none;
+                for (i, v) in serial_chunk.values.into_iter().enumerate() {
+                    stores[chunk_id + i].obj = Some(f(v));
+                }
+
+                chunk_id = serial_chunk.next_chunk;
+            }
+            if chunk_id == ObjectPool::<U>::DEFAULT_CAPACITY {
+                continue;
+            }
+        }
+
+        pool
+    }
+
+    pub fn from_ref<U, F: FnMut(&U) -> T>(pool: &ObjectPool<U>, mut f: F) -> SerialObjectPool<T> {
+        let skip_end = pool.empty_chunk().map(|(n, _)| n).unwrap_or(0);
+        let stores_len = pool.stores.len();
+        let mut serial_stores = Vec::new();
+        for store in pool.stores[0..(stores_len - skip_end)].iter() {
+            let mut serial_chunks = Vec::new();
+            let mut chunk_index = 0;
+            loop {
+                let node = &store[chunk_index];
+
+                let mut serial_chunk = SerializeChunk {
+                    next_none: node.header.next_none_offset,
+                    next_chunk: node.header.next_chunk_offset,
+                    values: vec![],
+                };
+                for item in store
+                    .iter()
+                    .take(node.header.next_none_offset)
+                    .skip(chunk_index)
+                {
+                    serial_chunk.values.push(f(item.obj.as_ref().unwrap()));
+                }
+                chunk_index = node.header.next_chunk_offset;
+                serial_chunks.push(serial_chunk);
+                if chunk_index == ObjectPool::<U>::DEFAULT_CAPACITY {
+                    break;
+                }
+            }
+            serial_stores.push(serial_chunks);
+        }
+
+        SerialObjectPool(serial_stores)
+    }
+
+    pub fn from<U, F: FnMut(U) -> T>(mut pool: ObjectPool<U>, mut f: F) -> SerialObjectPool<T> {
+        let skip_end = pool.empty_chunk().map(|(n, _)| n).unwrap_or(0);
+        let stores_len = pool.stores.len();
+        let mut serial_stores = Vec::new();
+        for store in pool.stores[0..(stores_len - skip_end)].iter_mut() {
+            let mut serial_chunks = Vec::new();
+            let mut chunk_index = 0;
+            loop {
+                let chunk_header = store[chunk_index].header;
+
+                let mut serial_chunk = SerializeChunk {
+                    next_none: chunk_header.next_none_offset,
+                    next_chunk: chunk_header.next_chunk_offset,
+                    values: vec![],
+                };
+                for item in store
+                    .iter_mut()
+                    .take(chunk_header.next_none_offset)
+                    .skip(chunk_index)
+                {
+                    let v = &mut item.obj;
+                    serial_chunk.values.push(f(v.take().unwrap()));
+                }
+                serial_chunks.push(serial_chunk);
+                chunk_index = chunk_header.next_chunk_offset;
+                if chunk_index == ObjectPool::<U>::DEFAULT_CAPACITY {
+                    break;
+                }
+            }
+            serial_stores.push(serial_chunks);
+        }
+
+        SerialObjectPool(serial_stores)
+    }
+}
+
+struct ObjectIndex {
+    store_index: usize,
+    target_index: usize,
+    chunk_index: usize,
+}
+
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
+struct ChunkHead {
+    next_none_offset: usize,
+    next_chunk_offset: usize,
+}
+
+#[derive(Debug)]
+pub struct ObjectNode<T> {
+    obj: Option<T>,
+    header: ChunkHead,
+}
+
+impl<T> Default for ObjectNode<T> {
+    fn default() -> Self {
+        Self {
+            obj: None,
+            header: ChunkHead::default(),
+        }
+    }
+}
+
+impl<T: Clone> Clone for ObjectNode<T> {
+    fn clone(&self) -> Self {
+        ObjectNode {
+            obj: self.obj.clone(),
+            header: self.header,
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_iter() {
+        let mut pool = ObjectPool::new();
+        let _ = pool.push("hello");
+        let (id2, _) = pool.push("world");
+        pool.push("example");
+        pool.remove(id2);
+        pool.push("foo");
+
+        let r = pool
+            .iter()
+            .take(4)
+            .map(|s| s.map(|s| *s))
+            .collect::<Vec<Option<&str>>>();
+
+        assert_eq!(r, vec![Some("hello"), Some("foo"), Some("example"), None]);
+    }
+
+    #[test]
+    fn test_push() {
+        let mut pool = ObjectPool::new();
+        assert_eq!(pool.push("0"), (0, None));
+        assert_eq!(pool.push("1"), (1, None));
+        assert_eq!(pool.push("2"), (2, None));
+        assert_eq!(pool.push("3"), (3, None));
+        assert_eq!(pool.push("4"), (4, None));
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 5,
+                next_chunk_offset: ObjectPool::<&str>::DEFAULT_CAPACITY
+            }
+        );
+    }
+
+    #[test]
+    fn test_push_and_remove() {
+        let mut pool = ObjectPool::new();
+
+        assert_eq!(pool.push("0"), (0, None));
+        assert_eq!(pool.push("1"), (1, None));
+        assert_eq!(pool.push("2"), (2, None));
+        assert_eq!(pool.push("3"), (3, None));
+        assert_eq!(pool.push("4"), (4, None));
+        // |----------*
+        // |0|1|2|3|4|
+        // |----------DEFAULT_CAPACITY--*
+        assert_eq!(pool.remove(2), Some("2"));
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 2,
+                next_chunk_offset: 3
+            }
+        );
+        assert_eq!(
+            pool.stores[0][3].header,
+            ChunkHead {
+                next_none_offset: 5,
+                next_chunk_offset: ObjectPool::<&str>::DEFAULT_CAPACITY
+            }
+        );
+        // |----*|----*
+        // |0|1|_|3|4|
+        // |------|-----DEFAULT_CAPACITY--*
+
+        assert_eq!(pool.remove(1), Some("1"));
+        // |--*  |----*
+        // |0|_|_|3|4|
+        // |------|-----DEFAULT_CAPACITY--*
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 1,
+                next_chunk_offset: 3
+            }
+        );
+
+        assert_eq!(pool.remove(3), Some("3"));
+        // |--*    |--*
+        // |0|_|_|_|4|
+        // |--------|-----DEFAULT_CAPACITY--*
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 1,
+                next_chunk_offset: 4
+            }
+        );
+        assert_eq!(
+            pool.stores[0][4].header,
+            ChunkHead {
+                next_none_offset: 5,
+                next_chunk_offset: ObjectPool::<&str>::DEFAULT_CAPACITY
+            }
+        );
+
+        assert_eq!(pool.push("1"), (1, None));
+        // |----*  |--*
+        // |0|1|_|_|4|
+        // |--------|-----DEFAULT_CAPACITY--*
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 2,
+                next_chunk_offset: 4
+            }
+        );
+
+        assert_eq!(pool.remove(0), Some("0"));
+        // |*|--*  |--*
+        // |_|1|_|_|4|
+        // |--|-----|-----DEFAULT_CAPACITY--*
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 0,
+                next_chunk_offset: 1
+            }
+        );
+        assert_eq!(
+            pool.stores[0][1].header,
+            ChunkHead {
+                next_none_offset: 2,
+                next_chunk_offset: 4
+            }
+        );
+        let v = pool
+            .iter()
+            .take(5)
+            .map(|s| s.map(|s| *s))
+            .collect::<Vec<Option<&str>>>();
+        assert_eq!(v, vec![None, Some("1"), None, None, Some("4")]);
+
+        assert_eq!(pool.remove(1), Some("1"));
+        // |*      |--*
+        // |_|_|_|_|4|
+        // |--------|-----DEFAULT_CAPACITY--*
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 0,
+                next_chunk_offset: 4
+            }
+        );
+        assert_eq!(
+            pool.stores[0][4].header,
+            ChunkHead {
+                next_none_offset: 5,
+                next_chunk_offset: ObjectPool::<&str>::DEFAULT_CAPACITY
+            }
+        );
+        let v = pool
+            .iter()
+            .take(5)
+            .map(|s| s.map(|s| *s))
+            .collect::<Vec<Option<&str>>>();
+        assert_eq!(v, vec![None, None, None, None, Some("4")]);
+
+        assert_eq!(pool.push("0"), (0, None));
+        assert_eq!(pool.push("1"), (1, None));
+        assert_eq!(pool.push("2"), (2, None));
+        // |------*|--*
+        // |0|1|2|_|4|
+        // |--------|-----DEFAULT_CAPACITY--*
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 3,
+                next_chunk_offset: 4
+            }
+        );
+        assert_eq!(
+            pool.stores[0][4].header,
+            ChunkHead {
+                next_none_offset: 5,
+                next_chunk_offset: ObjectPool::<&str>::DEFAULT_CAPACITY
+            }
+        );
+
+        assert_eq!(pool.push("3"), (3, None));
+        // |----------*
+        // |0|1|2|3|4|
+        // |--------------DEFAULT_CAPACITY--*
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 5,
+                next_chunk_offset: ObjectPool::<&str>::DEFAULT_CAPACITY
+            }
+        );
+    }
+
+    #[test]
+    fn test_store_extends() {
+        let mut pool = ObjectPool::new();
+        let cap = ObjectPool::<&str>::DEFAULT_CAPACITY;
+        for i in 0..cap {
+            assert_eq!(pool.push(format!("{i}")), (i, None));
+        }
+
+        assert_eq!(pool.push("example".to_string()), (cap, None));
+        assert_eq!(pool.push("foo".to_string()), (cap + 1, None));
+        assert_eq!(pool.push("bar".to_string()), (cap + 2, None));
+
+        assert_eq!(
+            pool.stores[1][0].header,
+            ChunkHead {
+                next_none_offset: 3,
+                next_chunk_offset: ObjectPool::<&str>::DEFAULT_CAPACITY
+            }
+        );
+    }
+
+    #[test]
+    fn test_cleanup() {
+        let mut pool = ObjectPool::new();
+        let cap = ObjectPool::<()>::DEFAULT_CAPACITY;
+        for i in 0..cap {
+            pool.push(i);
+        }
+        pool.extend_stores();
+        pool.extend_stores();
+
+        assert_eq!(pool.stores.len(), 3);
+
+        assert_eq!(
+            pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: cap,
+                next_chunk_offset: cap
+            }
+        );
+
+        pool.cleanup_stores();
+        assert_eq!(pool.stores.len(), 2);
+
+        pool.remove(2);
+        pool.cleanup_stores();
+        assert_eq!(pool.stores.len(), 1);
+    }
+
+    #[test]
+    fn test_serde() {
+        let mut pool = ObjectPool::new();
+        let cap = ObjectPool::<&str>::DEFAULT_CAPACITY;
+        for i in 0..cap {
+            assert_eq!(pool.push(format!("{i}")), (i, None));
+        }
+        assert_eq!(pool.push("example".to_string()), (cap, None));
+        assert_eq!(pool.push("foo".to_string()), (cap + 1, None));
+        assert_eq!(pool.push("bar".to_string()), (cap + 2, None));
+
+        // fake data
+        {
+            let s = pool.extend_stores();
+            s[0].header.next_none_offset += 1;
+            s[0].obj = Some("fake".to_string());
+        }
+
+        for i in 64..128 {
+            pool.remove(i);
+        }
+
+        for i in 64 + 128..512 {
+            pool.remove(i);
+        }
+
+        let serde_pool = SerialObjectPool::from(pool, |f| f);
+        let s = serde_json::to_string_pretty(&serde_pool).unwrap();
+        let expect = {
+            r#"
+[
+  [
+    {
+      "next_none": 64,
+      "next_chunk": 128,
+      "values": [
+        "0",
+        "1",
+        "2",
+        "3",
+        "4",
+        "5",
+        "6",
+        "7",
+        "8",
+        "9",
+        "10",
+        "11",
+        "12",
+        "13",
+        "14",
+        "15",
+        "16",
+        "17",
+        "18",
+        "19",
+        "20",
+        "21",
+        "22",
+        "23",
+        "24",
+        "25",
+        "26",
+        "27",
+        "28",
+        "29",
+        "30",
+        "31",
+        "32",
+        "33",
+        "34",
+        "35",
+        "36",
+        "37",
+        "38",
+        "39",
+        "40",
+        "41",
+        "42",
+        "43",
+        "44",
+        "45",
+        "46",
+        "47",
+        "48",
+        "49",
+        "50",
+        "51",
+        "52",
+        "53",
+        "54",
+        "55",
+        "56",
+        "57",
+        "58",
+        "59",
+        "60",
+        "61",
+        "62",
+        "63"
+      ]
+    },
+    {
+      "next_none": 192,
+      "next_chunk": 512,
+      "values": [
+        "128",
+        "129",
+        "130",
+        "131",
+        "132",
+        "133",
+        "134",
+        "135",
+        "136",
+        "137",
+        "138",
+        "139",
+        "140",
+        "141",
+        "142",
+        "143",
+        "144",
+        "145",
+        "146",
+        "147",
+        "148",
+        "149",
+        "150",
+        "151",
+        "152",
+        "153",
+        "154",
+        "155",
+        "156",
+        "157",
+        "158",
+        "159",
+        "160",
+        "161",
+        "162",
+        "163",
+        "164",
+        "165",
+        "166",
+        "167",
+        "168",
+        "169",
+        "170",
+        "171",
+        "172",
+        "173",
+        "174",
+        "175",
+        "176",
+        "177",
+        "178",
+        "179",
+        "180",
+        "181",
+        "182",
+        "183",
+        "184",
+        "185",
+        "186",
+        "187",
+        "188",
+        "189",
+        "190",
+        "191"
+      ]
+    }
+  ],
+  [
+    {
+      "next_none": 3,
+      "next_chunk": 512,
+      "values": [
+        "example",
+        "foo",
+        "bar"
+      ]
+    }
+  ],
+  [
+    {
+      "next_none": 1,
+      "next_chunk": 512,
+      "values": [
+        "fake"
+      ]
+    }
+  ]
+]"#
+        };
+        assert_eq!(s, expect.trim());
+
+        let new_pool = serde_pool.into(|s| s);
+        assert_eq!(new_pool.stores.len(), 3);
+
+        assert_eq!(
+            new_pool.stores[0][0].header,
+            ChunkHead {
+                next_none_offset: 64,
+                next_chunk_offset: 128
+            }
+        );
+        assert_eq!(
+            new_pool.stores[0][128].header,
+            ChunkHead {
+                next_none_offset: 192,
+                next_chunk_offset: 512
+            }
+        );
+        assert_eq!(
+            new_pool.stores[1][0].header,
+            ChunkHead {
+                next_none_offset: 3,
+                next_chunk_offset: 512
+            }
+        );
+        assert_eq!(
+            new_pool.stores[2][0].header,
+            ChunkHead {
+                next_none_offset: 1,
+                next_chunk_offset: 512
+            }
+        );
+    }
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/clock.rs.html b/src/async_wasi/snapshots/common/clock.rs.html new file mode 100644 index 000000000..b2a3cdda4 --- /dev/null +++ b/src/async_wasi/snapshots/common/clock.rs.html @@ -0,0 +1,65 @@ +clock.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
use crate::snapshots::{
+    common::{
+        error::Errno,
+        types::{__wasi_clockid_t, __wasi_errno_t, __wasi_timestamp_t},
+    },
+    WasiCtx,
+};
+
+pub fn wasi_clock_res_get(clock_id: __wasi_clockid_t::Type) -> Result<u64, Errno> {
+    match clock_id {
+        __wasi_clockid_t::__WASI_CLOCKID_MONOTONIC => Ok(1),
+        __wasi_clockid_t::__WASI_CLOCKID_REALTIME => Ok(1),
+        _ => Err(Errno(__wasi_errno_t::__WASI_ERRNO_BADF)),
+    }
+}
+
+pub fn wasi_clock_time_get(
+    ctx: &WasiCtx,
+    clock_id: __wasi_clockid_t::Type,
+    _precision: __wasi_timestamp_t,
+) -> Result<u64, Errno> {
+    use std::time::SystemTime;
+    match clock_id {
+        __wasi_clockid_t::__WASI_CLOCKID_REALTIME | __wasi_clockid_t::__WASI_CLOCKID_MONOTONIC => {
+            let d = SystemTime::now()
+                .duration_since(SystemTime::UNIX_EPOCH)
+                .unwrap();
+            Ok(d.as_nanos() as u64)
+        }
+        _ => Err(Errno(__wasi_errno_t::__WASI_ERRNO_NODEV)),
+    }
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/error.rs.html b/src/async_wasi/snapshots/common/error.rs.html new file mode 100644 index 000000000..c0821a691 --- /dev/null +++ b/src/async_wasi/snapshots/common/error.rs.html @@ -0,0 +1,469 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+
use std::{fmt::Debug, io::ErrorKind};
+
+pub use super::types::__wasi_errno_t as wasi_errno;
+
+#[derive(Debug, Eq, PartialEq, Clone, Copy)]
+pub struct Errno(pub wasi_errno::Type);
+
+impl Default for Errno {
+    fn default() -> Self {
+        Errno::__WASI_ERRNO_SUCCESS
+    }
+}
+
+impl Errno {
+    pub const __WASI_ERRNO_SUCCESS: Errno = Errno(0);
+    pub const __WASI_ERRNO_2BIG: Errno = Errno(1);
+    pub const __WASI_ERRNO_ACCES: Errno = Errno(2);
+    pub const __WASI_ERRNO_ADDRINUSE: Errno = Errno(3);
+    pub const __WASI_ERRNO_ADDRNOTAVAIL: Errno = Errno(4);
+    pub const __WASI_ERRNO_AFNOSUPPORT: Errno = Errno(5);
+    pub const __WASI_ERRNO_AGAIN: Errno = Errno(6);
+    pub const __WASI_ERRNO_ALREADY: Errno = Errno(7);
+    pub const __WASI_ERRNO_BADF: Errno = Errno(8);
+    pub const __WASI_ERRNO_BADMSG: Errno = Errno(9);
+    pub const __WASI_ERRNO_BUSY: Errno = Errno(10);
+    pub const __WASI_ERRNO_CANCELED: Errno = Errno(11);
+    pub const __WASI_ERRNO_CHILD: Errno = Errno(12);
+    pub const __WASI_ERRNO_CONNABORTED: Errno = Errno(13);
+    pub const __WASI_ERRNO_CONNREFUSED: Errno = Errno(14);
+    pub const __WASI_ERRNO_CONNRESET: Errno = Errno(15);
+    pub const __WASI_ERRNO_DEADLK: Errno = Errno(16);
+    pub const __WASI_ERRNO_DESTADDRREQ: Errno = Errno(17);
+    pub const __WASI_ERRNO_DOM: Errno = Errno(18);
+    pub const __WASI_ERRNO_DQUOT: Errno = Errno(19);
+    pub const __WASI_ERRNO_EXIST: Errno = Errno(20);
+    pub const __WASI_ERRNO_FAULT: Errno = Errno(21);
+    pub const __WASI_ERRNO_FBIG: Errno = Errno(22);
+    pub const __WASI_ERRNO_HOSTUNREACH: Errno = Errno(23);
+    pub const __WASI_ERRNO_IDRM: Errno = Errno(24);
+    pub const __WASI_ERRNO_ILSEQ: Errno = Errno(25);
+    pub const __WASI_ERRNO_INPROGRESS: Errno = Errno(26);
+    pub const __WASI_ERRNO_INTR: Errno = Errno(27);
+    pub const __WASI_ERRNO_INVAL: Errno = Errno(28);
+    pub const __WASI_ERRNO_IO: Errno = Errno(29);
+    pub const __WASI_ERRNO_ISCONN: Errno = Errno(30);
+    pub const __WASI_ERRNO_ISDIR: Errno = Errno(31);
+    pub const __WASI_ERRNO_LOOP: Errno = Errno(32);
+    pub const __WASI_ERRNO_MFILE: Errno = Errno(33);
+    pub const __WASI_ERRNO_MLINK: Errno = Errno(34);
+    pub const __WASI_ERRNO_MSGSIZE: Errno = Errno(35);
+    pub const __WASI_ERRNO_MULTIHOP: Errno = Errno(36);
+    pub const __WASI_ERRNO_NAMETOOLONG: Errno = Errno(37);
+    pub const __WASI_ERRNO_NETDOWN: Errno = Errno(38);
+    pub const __WASI_ERRNO_NETRESET: Errno = Errno(39);
+    pub const __WASI_ERRNO_NETUNREACH: Errno = Errno(40);
+    pub const __WASI_ERRNO_NFILE: Errno = Errno(41);
+    pub const __WASI_ERRNO_NOBUFS: Errno = Errno(42);
+    pub const __WASI_ERRNO_NODEV: Errno = Errno(43);
+    pub const __WASI_ERRNO_NOENT: Errno = Errno(44);
+    pub const __WASI_ERRNO_NOEXEC: Errno = Errno(45);
+    pub const __WASI_ERRNO_NOLCK: Errno = Errno(46);
+    pub const __WASI_ERRNO_NOLINK: Errno = Errno(47);
+    pub const __WASI_ERRNO_NOMEM: Errno = Errno(48);
+    pub const __WASI_ERRNO_NOMSG: Errno = Errno(49);
+    pub const __WASI_ERRNO_NOPROTOOPT: Errno = Errno(50);
+    pub const __WASI_ERRNO_NOSPC: Errno = Errno(51);
+    pub const __WASI_ERRNO_NOSYS: Errno = Errno(52);
+    pub const __WASI_ERRNO_NOTCONN: Errno = Errno(53);
+    pub const __WASI_ERRNO_NOTDIR: Errno = Errno(54);
+    pub const __WASI_ERRNO_NOTEMPTY: Errno = Errno(55);
+    pub const __WASI_ERRNO_NOTRECOVERABLE: Errno = Errno(56);
+    pub const __WASI_ERRNO_NOTSOCK: Errno = Errno(57);
+    pub const __WASI_ERRNO_NOTSUP: Errno = Errno(58);
+    pub const __WASI_ERRNO_NOTTY: Errno = Errno(59);
+    pub const __WASI_ERRNO_NXIO: Errno = Errno(60);
+    pub const __WASI_ERRNO_OVERFLOW: Errno = Errno(61);
+    pub const __WASI_ERRNO_OWNERDEAD: Errno = Errno(62);
+    pub const __WASI_ERRNO_PERM: Errno = Errno(63);
+    pub const __WASI_ERRNO_PIPE: Errno = Errno(64);
+    pub const __WASI_ERRNO_PROTO: Errno = Errno(65);
+    pub const __WASI_ERRNO_PROTONOSUPPORT: Errno = Errno(66);
+    pub const __WASI_ERRNO_PROTOTYPE: Errno = Errno(67);
+    pub const __WASI_ERRNO_RANGE: Errno = Errno(68);
+    pub const __WASI_ERRNO_ROFS: Errno = Errno(69);
+    pub const __WASI_ERRNO_SPIPE: Errno = Errno(70);
+    pub const __WASI_ERRNO_SRCH: Errno = Errno(71);
+    pub const __WASI_ERRNO_STALE: Errno = Errno(72);
+    pub const __WASI_ERRNO_TIMEDOUT: Errno = Errno(73);
+    pub const __WASI_ERRNO_TXTBSY: Errno = Errno(74);
+    pub const __WASI_ERRNO_XDEV: Errno = Errno(75);
+    pub const __WASI_ERRNO_NOTCAPABLE: Errno = Errno(76);
+    pub const __WASI_ERRNO_AIADDRFAMILY: Errno = Errno(77);
+    pub const __WASI_ERRNO_AIAGAIN: Errno = Errno(78);
+    pub const __WASI_ERRNO_AIBADFLAG: Errno = Errno(79);
+    pub const __WASI_ERRNO_AIFAIL: Errno = Errno(80);
+    pub const __WASI_ERRNO_AIFAMILY: Errno = Errno(81);
+    pub const __WASI_ERRNO_AIMEMORY: Errno = Errno(82);
+    pub const __WASI_ERRNO_AINODATA: Errno = Errno(83);
+    pub const __WASI_ERRNO_AINONAME: Errno = Errno(84);
+    pub const __WASI_ERRNO_AISERVICE: Errno = Errno(85);
+    pub const __WASI_ERRNO_AISOCKTYPE: Errno = Errno(86);
+    pub const __WASI_ERRNO_AISYSTEM: Errno = Errno(87);
+}
+
+impl From<wasi_errno::Type> for Errno {
+    fn from(e: wasi_errno::Type) -> Self {
+        Errno(e)
+    }
+}
+
+impl From<ErrorKind> for Errno {
+    fn from(e: ErrorKind) -> Self {
+        match e {
+            ErrorKind::NotFound => Errno::__WASI_ERRNO_NOENT,
+            ErrorKind::PermissionDenied => Errno::__WASI_ERRNO_PERM,
+            ErrorKind::ConnectionRefused => Errno::__WASI_ERRNO_CONNREFUSED,
+            ErrorKind::ConnectionReset => Errno::__WASI_ERRNO_CONNRESET,
+            ErrorKind::ConnectionAborted => Errno::__WASI_ERRNO_CONNABORTED,
+            ErrorKind::NotConnected => Errno::__WASI_ERRNO_NOTCONN,
+            ErrorKind::AddrInUse => Errno::__WASI_ERRNO_ADDRINUSE,
+            ErrorKind::AddrNotAvailable => Errno::__WASI_ERRNO_ADDRNOTAVAIL,
+            ErrorKind::BrokenPipe => Errno::__WASI_ERRNO_PIPE,
+            ErrorKind::AlreadyExists => Errno::__WASI_ERRNO_EXIST,
+            ErrorKind::WouldBlock => Errno::__WASI_ERRNO_AGAIN,
+            ErrorKind::InvalidInput => Errno::__WASI_ERRNO_INVAL,
+            ErrorKind::InvalidData => Errno::__WASI_ERRNO_IO,
+            ErrorKind::TimedOut => Errno::__WASI_ERRNO_TIMEDOUT,
+            ErrorKind::WriteZero => Errno::__WASI_ERRNO_IO,
+            ErrorKind::Interrupted => Errno::__WASI_ERRNO_INTR,
+            ErrorKind::UnexpectedEof => Errno::__WASI_ERRNO_IO,
+            ErrorKind::Unsupported => Errno::__WASI_ERRNO_NOTSUP,
+            ErrorKind::OutOfMemory => Errno::__WASI_ERRNO_NOMEM,
+            _ => Errno::__WASI_ERRNO_IO,
+        }
+    }
+}
+
+impl From<&std::io::Error> for Errno {
+    fn from(e: &std::io::Error) -> Self {
+        if let Some(error_code) = e.raw_os_error() {
+            match error_code {
+                0 => Errno::__WASI_ERRNO_SUCCESS,
+                libc::E2BIG => Errno::__WASI_ERRNO_2BIG,
+                libc::EACCES => Errno::__WASI_ERRNO_ACCES,
+                libc::EADDRINUSE => Errno::__WASI_ERRNO_ADDRINUSE,
+                libc::EADDRNOTAVAIL => Errno::__WASI_ERRNO_ADDRNOTAVAIL,
+                libc::EAFNOSUPPORT => Errno::__WASI_ERRNO_AFNOSUPPORT,
+                libc::EAGAIN => Errno::__WASI_ERRNO_AGAIN,
+                libc::EALREADY => Errno::__WASI_ERRNO_ALREADY,
+                libc::EBADF => Errno::__WASI_ERRNO_BADF,
+                libc::EBADMSG => Errno::__WASI_ERRNO_BADMSG,
+                libc::EBUSY => Errno::__WASI_ERRNO_BUSY,
+                libc::ECANCELED => Errno::__WASI_ERRNO_CANCELED,
+                libc::ECHILD => Errno::__WASI_ERRNO_CHILD,
+                libc::ECONNABORTED => Errno::__WASI_ERRNO_CONNABORTED,
+                libc::ECONNREFUSED => Errno::__WASI_ERRNO_CONNREFUSED,
+                libc::ECONNRESET => Errno::__WASI_ERRNO_CONNRESET,
+                libc::EDEADLK => Errno::__WASI_ERRNO_DEADLK,
+                libc::EDESTADDRREQ => Errno::__WASI_ERRNO_DESTADDRREQ,
+                libc::EDOM => Errno::__WASI_ERRNO_DOM,
+                #[cfg(unix)]
+                libc::EDQUOT => Errno::__WASI_ERRNO_DQUOT,
+                libc::EEXIST => Errno::__WASI_ERRNO_EXIST,
+                libc::EFAULT => Errno::__WASI_ERRNO_FAULT,
+                libc::EFBIG => Errno::__WASI_ERRNO_FBIG,
+                libc::EHOSTUNREACH => Errno::__WASI_ERRNO_HOSTUNREACH,
+                libc::EIDRM => Errno::__WASI_ERRNO_IDRM,
+                libc::EILSEQ => Errno::__WASI_ERRNO_ILSEQ,
+                libc::EINPROGRESS => Errno::__WASI_ERRNO_INPROGRESS,
+                libc::EINTR => Errno::__WASI_ERRNO_INTR,
+                libc::EINVAL => Errno::__WASI_ERRNO_INVAL,
+                libc::EIO => Errno::__WASI_ERRNO_IO,
+                libc::EISCONN => Errno::__WASI_ERRNO_ISCONN,
+                libc::EISDIR => Errno::__WASI_ERRNO_ISDIR,
+                libc::ELOOP => Errno::__WASI_ERRNO_LOOP,
+                libc::EMFILE => Errno::__WASI_ERRNO_MFILE,
+                libc::EMLINK => Errno::__WASI_ERRNO_MLINK,
+                libc::EMSGSIZE => Errno::__WASI_ERRNO_MSGSIZE,
+                #[cfg(unix)]
+                libc::EMULTIHOP => Errno::__WASI_ERRNO_MULTIHOP,
+                libc::ENAMETOOLONG => Errno::__WASI_ERRNO_NAMETOOLONG,
+                libc::ENETDOWN => Errno::__WASI_ERRNO_NETDOWN,
+                libc::ENETRESET => Errno::__WASI_ERRNO_NETRESET,
+                libc::ENETUNREACH => Errno::__WASI_ERRNO_NETUNREACH,
+                libc::ENFILE => Errno::__WASI_ERRNO_NFILE,
+                libc::ENOBUFS => Errno::__WASI_ERRNO_NOBUFS,
+                libc::ENODEV => Errno::__WASI_ERRNO_NODEV,
+                libc::ENOENT => Errno::__WASI_ERRNO_NOENT,
+                libc::ENOEXEC => Errno::__WASI_ERRNO_NOEXEC,
+                libc::ENOLCK => Errno::__WASI_ERRNO_NOLCK,
+                libc::ENOLINK => Errno::__WASI_ERRNO_NOLINK,
+                libc::ENOMEM => Errno::__WASI_ERRNO_NOMEM,
+                libc::ENOMSG => Errno::__WASI_ERRNO_NOMSG,
+                libc::ENOPROTOOPT => Errno::__WASI_ERRNO_NOPROTOOPT,
+                libc::ENOSPC => Errno::__WASI_ERRNO_NOSPC,
+                libc::ENOSYS => Errno::__WASI_ERRNO_NOSYS,
+                libc::ENOTCONN => Errno::__WASI_ERRNO_NOTCONN,
+                libc::ENOTDIR => Errno::__WASI_ERRNO_NOTDIR,
+                libc::ENOTEMPTY => Errno::__WASI_ERRNO_NOTEMPTY,
+                libc::ENOTRECOVERABLE => Errno::__WASI_ERRNO_NOTRECOVERABLE,
+                libc::ENOTSOCK => Errno::__WASI_ERRNO_NOTSOCK,
+                libc::ENOTSUP => Errno::__WASI_ERRNO_NOTSUP,
+                libc::ENOTTY => Errno::__WASI_ERRNO_NOTTY,
+                libc::ENXIO => Errno::__WASI_ERRNO_NXIO,
+                libc::EOVERFLOW => Errno::__WASI_ERRNO_OVERFLOW,
+                libc::EOWNERDEAD => Errno::__WASI_ERRNO_OWNERDEAD,
+                libc::EPERM => Errno::__WASI_ERRNO_PERM,
+                libc::EPIPE => Errno::__WASI_ERRNO_PIPE,
+                libc::EPROTO => Errno::__WASI_ERRNO_PROTO,
+                libc::EPROTONOSUPPORT => Errno::__WASI_ERRNO_PROTONOSUPPORT,
+                libc::EPROTOTYPE => Errno::__WASI_ERRNO_PROTOTYPE,
+                libc::ERANGE => Errno::__WASI_ERRNO_RANGE,
+                libc::EROFS => Errno::__WASI_ERRNO_ROFS,
+                libc::ESPIPE => Errno::__WASI_ERRNO_SPIPE,
+                libc::ESRCH => Errno::__WASI_ERRNO_SRCH,
+                #[cfg(unix)]
+                libc::ESTALE => Errno::__WASI_ERRNO_STALE,
+                libc::ETIMEDOUT => Errno::__WASI_ERRNO_TIMEDOUT,
+                libc::ETXTBSY => Errno::__WASI_ERRNO_TXTBSY,
+                libc::EXDEV => Errno::__WASI_ERRNO_XDEV,
+                _ => Errno::__WASI_ERRNO_IO,
+            }
+        } else {
+            let kind = e.kind();
+            Errno::from(kind)
+        }
+    }
+}
+
+impl From<std::io::Error> for Errno {
+    fn from(e: std::io::Error) -> Self {
+        Errno::from(&e)
+    }
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/memory.rs.html b/src/async_wasi/snapshots/common/memory.rs.html new file mode 100644 index 000000000..6097893e7 --- /dev/null +++ b/src/async_wasi/snapshots/common/memory.rs.html @@ -0,0 +1,129 @@ +memory.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
use super::{
+    error::Errno,
+    types::{__wasi_ciovec_t, __wasi_iovec_t, __wasi_size_t},
+};
+use std::{
+    io::{IoSlice, IoSliceMut},
+    ops::{Add, Deref, DerefMut, Sub},
+};
+
+pub trait Memory {
+    fn get_data<T: Sized>(&self, offset: WasmPtr<T>) -> Result<&T, Errno>;
+
+    fn get_slice<T: Sized>(&self, offset: WasmPtr<T>, len: usize) -> Result<&[T], Errno>;
+
+    fn get_iovec<'a>(
+        &self,
+        iovec_ptr: WasmPtr<__wasi_ciovec_t>,
+        iovec_len: __wasi_size_t,
+    ) -> Result<Vec<IoSlice<'a>>, Errno>;
+
+    fn mut_data<T: Sized>(&mut self, offset: WasmPtr<T>) -> Result<&mut T, Errno>;
+
+    fn mut_slice<T: Sized>(&mut self, offset: WasmPtr<T>, len: usize) -> Result<&mut [T], Errno>;
+
+    fn mut_iovec(
+        &mut self,
+        iovec_ptr: WasmPtr<__wasi_iovec_t>,
+        iovec_len: __wasi_size_t,
+    ) -> Result<Vec<IoSliceMut<'_>>, Errno>;
+
+    fn write_data<T: Sized>(&mut self, offset: WasmPtr<T>, data: T) -> Result<(), Errno>;
+}
+
+#[derive(Debug, Clone, Copy)]
+pub struct WasmPtr<T: Sized>(pub usize, std::marker::PhantomData<T>);
+impl<T: Sized> WasmPtr<T> {
+    pub fn is_null(&self) -> bool {
+        self.0 == 0
+    }
+}
+impl<T: Sized> From<usize> for WasmPtr<T> {
+    fn from(i: usize) -> Self {
+        WasmPtr(i, Default::default())
+    }
+}
+impl<T: Sized> From<WasmPtr<T>> for usize {
+    fn from(val: WasmPtr<T>) -> Self {
+        val.0
+    }
+}
+impl<T: Sized> Add<usize> for WasmPtr<T> {
+    type Output = Self;
+    fn add(mut self, rhs: usize) -> Self::Output {
+        self.0 += rhs * std::mem::size_of::<T>();
+        self
+    }
+}
+impl<T: Sized> Sub<usize> for WasmPtr<T> {
+    type Output = Self;
+    fn sub(mut self, rhs: usize) -> Self::Output {
+        self.0 -= rhs * std::mem::size_of::<T>();
+        self
+    }
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/mod.rs.html b/src/async_wasi/snapshots/common/mod.rs.html new file mode 100644 index 000000000..af9172bf2 --- /dev/null +++ b/src/async_wasi/snapshots/common/mod.rs.html @@ -0,0 +1,17 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+
#![allow(non_camel_case_types, non_upper_case_globals, unused)]
+pub mod types;
+
+pub mod clock;
+pub mod error;
+pub mod memory;
+pub mod net;
+pub mod vfs;
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/net/async_tokio.rs.html b/src/async_wasi/snapshots/common/net/async_tokio.rs.html new file mode 100644 index 000000000..95d073c16 --- /dev/null +++ b/src/async_wasi/snapshots/common/net/async_tokio.rs.html @@ -0,0 +1,1313 @@ +async_tokio.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+
use super::*;
+use crate::snapshots::{
+    common::{types as wasi_types, vfs},
+    env::Errno,
+};
+use socket2::{SockAddr, Socket};
+use std::{
+    ops::DerefMut,
+    os::unix::prelude::{AsRawFd, FromRawFd, RawFd},
+};
+use tokio::io::{
+    unix::{AsyncFd, AsyncFdReadyGuard, TryIoError},
+    AsyncReadExt, AsyncWriteExt,
+};
+
+#[derive(Debug)]
+pub(crate) enum AsyncWasiSocketInner {
+    PreOpen(Socket),
+    AsyncFd(AsyncFd<Socket>),
+}
+
+impl AsyncWasiSocketInner {
+    fn register(&mut self) -> io::Result<()> {
+        unsafe {
+            let inner = match self {
+                AsyncWasiSocketInner::PreOpen(s) => {
+                    let mut inner_socket = std::mem::zeroed();
+                    std::mem::swap(s, &mut inner_socket);
+                    inner_socket
+                }
+                AsyncWasiSocketInner::AsyncFd(_) => return Ok(()),
+            };
+            let mut new_self = Self::AsyncFd(AsyncFd::new(inner)?);
+            std::mem::swap(self, &mut new_self);
+            std::mem::forget(new_self);
+            Ok(())
+        }
+    }
+
+    fn bind(&mut self, addr: &SockAddr) -> io::Result<()> {
+        match self {
+            AsyncWasiSocketInner::PreOpen(s) => {
+                s.set_reuse_address(true)?;
+                s.bind(addr)
+            }
+            AsyncWasiSocketInner::AsyncFd(_) => Err(io::Error::from_raw_os_error(libc::EINVAL)),
+        }
+    }
+
+    fn bind_device(&mut self, interface: Option<&[u8]>) -> io::Result<()> {
+        match self {
+            AsyncWasiSocketInner::PreOpen(s) => s.bind_device(interface),
+            AsyncWasiSocketInner::AsyncFd(s) => s.get_ref().bind_device(interface),
+        }
+    }
+
+    fn device(&self) -> io::Result<Option<Vec<u8>>> {
+        match self {
+            AsyncWasiSocketInner::PreOpen(s) => s.device(),
+            AsyncWasiSocketInner::AsyncFd(s) => s.get_ref().device(),
+        }
+    }
+
+    fn listen(&mut self, backlog: i32) -> io::Result<()> {
+        match self {
+            AsyncWasiSocketInner::PreOpen(s) => {
+                s.listen(backlog)?;
+            }
+            AsyncWasiSocketInner::AsyncFd(_) => {
+                return Err(io::Error::from_raw_os_error(libc::EINVAL))
+            }
+        }
+        self.register()
+    }
+
+    fn accept(&mut self) -> io::Result<(Socket, SockAddr)> {
+        match self {
+            AsyncWasiSocketInner::PreOpen(s) => Err(io::Error::from_raw_os_error(libc::EINVAL)),
+            AsyncWasiSocketInner::AsyncFd(s) => s.get_ref().accept(),
+        }
+    }
+
+    fn connect(&mut self, addr: &SockAddr) -> io::Result<()> {
+        let r = match self {
+            AsyncWasiSocketInner::PreOpen(s) => s.connect(addr),
+            AsyncWasiSocketInner::AsyncFd(_) => {
+                return Err(io::Error::from_raw_os_error(libc::EINVAL))
+            }
+        };
+
+        if let Err(e) = r {
+            let errno = Errno::from(&e);
+            if errno != Errno::__WASI_ERRNO_INPROGRESS {
+                Err(e)
+            } else {
+                self.register()?;
+                Err(io::Error::from_raw_os_error(libc::EINPROGRESS))
+            }
+        } else {
+            self.register()?;
+            Ok(())
+        }
+    }
+
+    fn get_ref(&self) -> io::Result<&Socket> {
+        match self {
+            AsyncWasiSocketInner::PreOpen(_) => Err(io::Error::from_raw_os_error(libc::ENOTCONN)),
+            AsyncWasiSocketInner::AsyncFd(s) => Ok(s.get_ref()),
+        }
+    }
+
+    pub(crate) async fn readable(&self) -> io::Result<AsyncFdReadyGuard<Socket>> {
+        match self {
+            AsyncWasiSocketInner::PreOpen(_) => Err(io::Error::from_raw_os_error(libc::ENOTCONN)),
+            AsyncWasiSocketInner::AsyncFd(s) => Ok(s.readable().await?),
+        }
+    }
+
+    pub(crate) async fn writable(&self) -> io::Result<AsyncFdReadyGuard<Socket>> {
+        match self {
+            AsyncWasiSocketInner::PreOpen(_) => Err(io::Error::from_raw_os_error(libc::ENOTCONN)),
+            AsyncWasiSocketInner::AsyncFd(s) => Ok(s.writable().await?),
+        }
+    }
+}
+
+#[derive(Debug)]
+pub struct AsyncWasiSocket {
+    pub(crate) inner: AsyncWasiSocketInner,
+    pub state: WasiSocketState,
+}
+
+#[inline]
+fn handle_timeout_result<T>(
+    result: Result<io::Result<T>, tokio::time::error::Elapsed>,
+) -> io::Result<T> {
+    if let Ok(r) = result {
+        r
+    } else {
+        Err(io::Error::from_raw_os_error(libc::EWOULDBLOCK))
+    }
+}
+
+impl AsyncWasiSocket {
+    pub fn fd_fdstat_get(&self) -> Result<FdStat, Errno> {
+        let mut filetype = match self.state.sock_type.1 {
+            SocketType::Datagram => FileType::SOCKET_DGRAM,
+            SocketType::Stream => FileType::SOCKET_STREAM,
+        };
+        let flags = if self.state.nonblocking {
+            FdFlags::NONBLOCK
+        } else {
+            FdFlags::empty()
+        };
+
+        Ok(FdStat {
+            filetype,
+            fs_rights_base: self.state.fs_rights.clone(),
+            fs_rights_inheriting: WASIRights::empty(),
+            flags,
+        })
+    }
+}
+
+impl AsyncWasiSocket {
+    pub fn from_tcplistener(
+        listener: std::net::TcpListener,
+        state: WasiSocketState,
+    ) -> io::Result<Self> {
+        let socket = Socket::from(listener);
+        socket.set_nonblocking(true)?;
+        Ok(Self {
+            inner: AsyncWasiSocketInner::AsyncFd(AsyncFd::new(socket)?),
+            state,
+        })
+    }
+
+    pub fn from_udpsocket(socket: std::net::UdpSocket, state: WasiSocketState) -> io::Result<Self> {
+        let socket = Socket::from(socket);
+        socket.set_nonblocking(true)?;
+        Ok(Self {
+            inner: AsyncWasiSocketInner::AsyncFd(AsyncFd::new(socket)?),
+            state,
+        })
+    }
+}
+
+impl AsyncWasiSocket {
+    pub fn open(mut state: WasiSocketState) -> io::Result<Self> {
+        use socket2::{Domain, Protocol, Type};
+        match state.sock_type.1 {
+            SocketType::Stream => {
+                state.fs_rights = WASIRights::SOCK_BIND
+                    | WASIRights::SOCK_CLOSE
+                    | WASIRights::SOCK_RECV
+                    | WASIRights::SOCK_SEND
+                    | WASIRights::SOCK_SHUTDOWN
+                    | WASIRights::POLL_FD_READWRITE;
+            }
+            SocketType::Datagram => {
+                state.fs_rights = WASIRights::SOCK_BIND
+                    | WASIRights::SOCK_CLOSE
+                    | WASIRights::SOCK_RECV_FROM
+                    | WASIRights::SOCK_SEND_TO
+                    | WASIRights::SOCK_SHUTDOWN
+                    | WASIRights::POLL_FD_READWRITE;
+            }
+        }
+        let inner = match state.sock_type {
+            (AddressFamily::Inet4, SocketType::Datagram) => {
+                Socket::new(Domain::IPV4, Type::DGRAM, Some(Protocol::UDP))?
+            }
+            (AddressFamily::Inet4, SocketType::Stream) => {
+                Socket::new(Domain::IPV4, Type::STREAM, Some(Protocol::TCP))?
+            }
+            (AddressFamily::Inet6, SocketType::Datagram) => {
+                Socket::new(Domain::IPV6, Type::DGRAM, Some(Protocol::UDP))?
+            }
+            (AddressFamily::Inet6, SocketType::Stream) => {
+                Socket::new(Domain::IPV6, Type::STREAM, Some(Protocol::TCP))?
+            }
+        };
+        inner.set_nonblocking(true)?;
+        if !state.bind_device.is_empty() {
+            inner.bind_device(Some(&state.bind_device))?;
+        }
+        Ok(AsyncWasiSocket {
+            inner: AsyncWasiSocketInner::PreOpen(inner),
+            state,
+        })
+    }
+
+    pub fn bind(&mut self, addr: net::SocketAddr) -> io::Result<()> {
+        use socket2::SockAddr;
+        let sock_addr = SockAddr::from(addr);
+        self.inner.bind(&sock_addr)?;
+        if let SocketType::Datagram = self.state.sock_type.1 {
+            self.inner.register()?;
+        }
+        self.state.local_addr = Some(addr);
+        Ok(())
+    }
+
+    pub fn device(&self) -> io::Result<Option<Vec<u8>>> {
+        if self.state.bind_device.is_empty() {
+            self.inner.device()
+        } else {
+            Ok(Some(self.state.bind_device.clone()))
+        }
+    }
+
+    pub fn bind_device(&mut self, interface: Option<&[u8]>) -> io::Result<()> {
+        self.inner.bind_device(interface)?;
+        self.state.bind_device = match interface {
+            Some(interface) => interface.to_vec(),
+            None => vec![],
+        };
+        Ok(())
+    }
+
+    pub fn listen(&mut self, backlog: u32) -> io::Result<()> {
+        self.inner.listen(backlog as i32)?;
+        self.state.backlog = backlog;
+        self.state.so_conn_state = ConnectState::Listening;
+        Ok(())
+    }
+
+    pub async fn accept(&mut self) -> io::Result<Self> {
+        let mut new_state = WasiSocketState {
+            nonblocking: self.state.nonblocking,
+            so_conn_state: ConnectState::Connected,
+            ..Default::default()
+        };
+
+        if self.state.nonblocking {
+            let (cs, _) = self.inner.accept()?;
+            cs.set_nonblocking(true)?;
+            new_state.peer_addr = cs.peer_addr().ok().and_then(|addr| addr.as_socket());
+            new_state.local_addr = cs.local_addr().ok().and_then(|addr| addr.as_socket());
+
+            Ok(AsyncWasiSocket {
+                inner: AsyncWasiSocketInner::AsyncFd(AsyncFd::new(cs)?),
+                state: new_state,
+            })
+        } else {
+            loop {
+                let mut guard = self.inner.readable().await?;
+                if let Ok(r) = guard.try_io(|s| {
+                    let (cs, _) = s.get_ref().accept()?;
+                    cs.set_nonblocking(true)?;
+                    new_state.peer_addr = cs.peer_addr().ok().and_then(|addr| addr.as_socket());
+                    new_state.local_addr = cs.local_addr().ok().and_then(|addr| addr.as_socket());
+
+                    Ok(AsyncWasiSocket {
+                        inner: AsyncWasiSocketInner::AsyncFd(AsyncFd::new(cs)?),
+                        state: new_state.clone(),
+                    })
+                }) {
+                    return r;
+                } else {
+                    continue;
+                }
+            }
+        }
+    }
+
+    pub async fn connect(&mut self, addr: net::SocketAddr) -> io::Result<()> {
+        let address = SockAddr::from(addr);
+        self.state.so_conn_state = ConnectState::Connected;
+        self.state.peer_addr = Some(addr);
+
+        match (self.state.nonblocking, self.state.so_send_timeout) {
+            (true, None) => {
+                let r = self.inner.connect(&address);
+                if r.is_err() {
+                    self.state.so_conn_state = ConnectState::Connecting;
+                }
+                r?;
+                Ok(())
+            }
+            (false, None) => {
+                if let Err(e) = self.inner.connect(&address) {
+                    match e.raw_os_error() {
+                        Some(libc::EINPROGRESS) => {}
+                        _ => return Err(e),
+                    }
+                    let s = self.inner.writable().await?;
+                    let e = s.get_inner().take_error()?;
+                    if let Some(e) = e {
+                        return Err(e);
+                    }
+                }
+                Ok(())
+            }
+            (_, Some(timeout)) => {
+                if let Err(e) = self.inner.connect(&address) {
+                    match e.raw_os_error() {
+                        Some(libc::EINPROGRESS) => {}
+                        _ => return Err(e),
+                    }
+                    match tokio::time::timeout(timeout, self.inner.writable()).await {
+                        Ok(r) => {
+                            let s = r?;
+                            let e = s.get_inner().take_error()?;
+                            if let Some(e) = e {
+                                return Err(e);
+                            }
+                            Ok(())
+                        }
+                        Err(e) => Err(io::Error::from_raw_os_error(libc::EWOULDBLOCK)),
+                    }
+                } else {
+                    Ok(())
+                }
+            }
+        }
+    }
+
+    pub async fn recv<'a>(
+        &self,
+        bufs: &mut [io::IoSliceMut<'a>],
+        flags: libc::c_int,
+    ) -> io::Result<(usize, bool)> {
+        use socket2::MaybeUninitSlice;
+
+        match (self.state.nonblocking, self.state.so_recv_timeout) {
+            (true, None) => {
+                // Safety: reference Socket::read_vectored
+                let bufs = unsafe {
+                    &mut *(bufs as *mut [io::IoSliceMut<'_>] as *mut [MaybeUninitSlice<'_>])
+                };
+
+                let (n, f) = self
+                    .inner
+                    .get_ref()?
+                    .recv_vectored_with_flags(bufs, flags)?;
+                Ok((n, f.is_truncated()))
+            }
+            (false, None) => loop {
+                let mut guard = self.inner.readable().await?;
+                if let Ok(r) = guard.try_io(|s| {
+                    // Safety: reference Socket::read_vectored
+                    let bufs = unsafe {
+                        &mut *(bufs as *mut [io::IoSliceMut<'_>] as *mut [MaybeUninitSlice<'_>])
+                    };
+                    let (n, f) = s.get_ref().recv_vectored_with_flags(bufs, flags)?;
+                    Ok((n, f.is_truncated()))
+                }) {
+                    break r;
+                } else {
+                    continue;
+                }
+            },
+            (_, Some(timeout)) => handle_timeout_result(
+                tokio::time::timeout(timeout, async {
+                    loop {
+                        let mut guard = self.inner.readable().await?;
+                        if let Ok(r) = guard.try_io(|s| {
+                            // Safety: reference Socket::read_vectored
+                            let bufs = unsafe {
+                                &mut *(bufs as *mut [io::IoSliceMut<'_>]
+                                    as *mut [MaybeUninitSlice<'_>])
+                            };
+                            let (n, f) = s.get_ref().recv_vectored_with_flags(bufs, flags)?;
+                            Ok((n, f.is_truncated()))
+                        }) {
+                            break r;
+                        } else {
+                            continue;
+                        }
+                    }
+                })
+                .await,
+            ),
+        }
+    }
+
+    pub async fn recv_from<'a>(
+        &self,
+        bufs: &mut [io::IoSliceMut<'a>],
+        flags: libc::c_int,
+    ) -> io::Result<(usize, bool, Option<net::SocketAddr>)> {
+        use socket2::MaybeUninitSlice;
+
+        match (self.state.nonblocking, self.state.so_recv_timeout) {
+            (true, None) => {
+                // Safety: reference Socket::read_vectored
+                let bufs = unsafe {
+                    &mut *(bufs as *mut [io::IoSliceMut<'_>] as *mut [MaybeUninitSlice<'_>])
+                };
+
+                let (n, f, addr) = self
+                    .inner
+                    .get_ref()?
+                    .recv_from_vectored_with_flags(bufs, flags)?;
+                Ok((n, f.is_truncated(), addr.as_socket()))
+            }
+            (false, None) => loop {
+                let mut guard = self.inner.readable().await?;
+                if let Ok(r) = guard.try_io(|s| {
+                    // Safety: reference Socket::read_vectored
+                    let bufs = unsafe {
+                        &mut *(bufs as *mut [io::IoSliceMut<'_>] as *mut [MaybeUninitSlice<'_>])
+                    };
+
+                    let (n, f, addr) = s.get_ref().recv_from_vectored_with_flags(bufs, flags)?;
+                    Ok((n, f.is_truncated(), addr.as_socket()))
+                }) {
+                    break r;
+                } else {
+                    continue;
+                }
+            },
+            (_, Some(timeout)) => handle_timeout_result(
+                tokio::time::timeout(timeout, async {
+                    loop {
+                        let mut guard = self.inner.readable().await?;
+                        if let Ok(r) = guard.try_io(|s| {
+                            // Safety: reference Socket::read_vectored
+                            let bufs = unsafe {
+                                &mut *(bufs as *mut [io::IoSliceMut<'_>]
+                                    as *mut [MaybeUninitSlice<'_>])
+                            };
+
+                            let (n, f, addr) =
+                                s.get_ref().recv_from_vectored_with_flags(bufs, flags)?;
+                            Ok((n, f.is_truncated(), addr.as_socket()))
+                        }) {
+                            break r;
+                        } else {
+                            continue;
+                        }
+                    }
+                })
+                .await,
+            ),
+        }
+    }
+
+    pub async fn send<'a>(
+        &self,
+        bufs: &[io::IoSlice<'a>],
+        flags: libc::c_int,
+    ) -> io::Result<usize> {
+        match (self.state.nonblocking, self.state.so_send_timeout) {
+            (true, None) => self.inner.get_ref()?.send_vectored_with_flags(bufs, flags),
+            (false, None) => loop {
+                let mut guard = self.inner.writable().await?;
+                if let Ok(r) = guard.try_io(|s| s.get_ref().send_vectored_with_flags(bufs, flags)) {
+                    break r;
+                } else {
+                    continue;
+                }
+            },
+            (_, Some(timeout)) => handle_timeout_result(
+                tokio::time::timeout(timeout, async {
+                    loop {
+                        let mut guard = self.inner.writable().await?;
+                        if let Ok(r) =
+                            guard.try_io(|s| s.get_ref().send_vectored_with_flags(bufs, flags))
+                        {
+                            break r;
+                        } else {
+                            continue;
+                        }
+                    }
+                })
+                .await,
+            ),
+        }
+    }
+
+    pub async fn send_to<'a>(
+        &self,
+        bufs: &[io::IoSlice<'a>],
+        addr: net::SocketAddr,
+        flags: libc::c_int,
+    ) -> io::Result<usize> {
+        use socket2::{MaybeUninitSlice, SockAddr};
+        let address = SockAddr::from(addr);
+
+        match (self.state.nonblocking, self.state.so_send_timeout) {
+            (true, None) => self
+                .inner
+                .get_ref()?
+                .send_to_vectored_with_flags(bufs, &address, flags),
+            (false, None) => loop {
+                let mut guard = self.inner.writable().await?;
+                if let Ok(r) = guard.try_io(|s| {
+                    s.get_ref()
+                        .send_to_vectored_with_flags(bufs, &address, flags)
+                }) {
+                    break r;
+                } else {
+                    continue;
+                }
+            },
+            (_, Some(timeout)) => handle_timeout_result(
+                tokio::time::timeout(timeout, async {
+                    loop {
+                        let mut guard = self.inner.writable().await?;
+                        if let Ok(r) = guard.try_io(|s| {
+                            s.get_ref()
+                                .send_to_vectored_with_flags(bufs, &address, flags)
+                        }) {
+                            break r;
+                        } else {
+                            continue;
+                        }
+                    }
+                })
+                .await,
+            ),
+        }
+    }
+
+    pub fn shutdown(&mut self, how: net::Shutdown) -> io::Result<()> {
+        self.inner.get_ref()?.shutdown(how)?;
+        self.state.shutdown.insert(how);
+        Ok(())
+    }
+
+    pub fn get_peer(&mut self) -> io::Result<net::SocketAddr> {
+        if let Some(addr) = self.state.peer_addr {
+            Ok(addr)
+        } else {
+            let addr = self.inner.get_ref()?.peer_addr()?.as_socket().unwrap();
+            self.state.peer_addr = Some(addr);
+            Ok(addr)
+        }
+    }
+
+    pub fn get_local(&mut self) -> io::Result<net::SocketAddr> {
+        if let Some(addr) = self.state.local_addr {
+            Ok(addr)
+        } else {
+            let addr = self.inner.get_ref()?.local_addr()?.as_socket().unwrap();
+            self.state.local_addr = Some(addr);
+            Ok(addr)
+        }
+    }
+
+    pub fn set_nonblocking(&mut self, nonblocking: bool) -> io::Result<()> {
+        self.state.nonblocking = nonblocking;
+        Ok(())
+    }
+
+    pub fn get_nonblocking(&self) -> bool {
+        self.state.nonblocking
+    }
+
+    pub fn get_so_type(&self) -> (AddressFamily, SocketType) {
+        self.state.sock_type
+    }
+
+    pub fn get_so_accept_conn(&self) -> io::Result<bool> {
+        self.inner.get_ref()?.is_listener()
+    }
+
+    pub fn sync_conn_state(&mut self) {
+        if self.state.so_conn_state == ConnectState::Connecting {
+            self.state.so_conn_state = ConnectState::Connected;
+        }
+    }
+
+    pub fn set_so_reuseaddr(&mut self, reuseaddr: bool) -> io::Result<()> {
+        self.state.so_reuseaddr = reuseaddr;
+        Ok(())
+    }
+
+    pub fn get_so_reuseaddr(&self) -> bool {
+        self.state.so_reuseaddr
+    }
+
+    pub fn set_so_recv_buf_size(&mut self, buf_size: usize) -> io::Result<()> {
+        self.state.so_recv_buf_size = buf_size;
+        Ok(())
+    }
+
+    pub fn get_so_recv_buf_size(&self) -> usize {
+        self.state.so_recv_buf_size
+    }
+
+    pub fn set_so_send_buf_size(&mut self, buf_size: usize) -> io::Result<()> {
+        self.state.so_send_buf_size = buf_size;
+        Ok(())
+    }
+
+    pub fn get_so_send_buf_size(&mut self) -> usize {
+        self.state.so_send_buf_size
+    }
+
+    pub fn set_so_recv_timeout(&mut self, timeout: Option<Duration>) -> io::Result<()> {
+        self.state.so_recv_timeout = timeout;
+        self.state.nonblocking = true;
+        Ok(())
+    }
+
+    pub fn get_so_recv_timeout(&mut self) -> Option<Duration> {
+        self.state.so_recv_timeout
+    }
+
+    pub fn set_so_send_timeout(&mut self, timeout: Option<Duration>) -> io::Result<()> {
+        self.state.so_send_timeout = timeout;
+        self.state.nonblocking = true;
+        Ok(())
+    }
+
+    pub fn get_so_send_timeout(&mut self) -> Option<Duration> {
+        self.state.so_send_timeout
+    }
+
+    pub fn get_so_error(&mut self) -> io::Result<Option<io::Error>> {
+        self.inner.get_ref()?.take_error()
+    }
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/net/mod.rs.html b/src/async_wasi/snapshots/common/net/mod.rs.html new file mode 100644 index 000000000..31b391b30 --- /dev/null +++ b/src/async_wasi/snapshots/common/net/mod.rs.html @@ -0,0 +1,545 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+
#[cfg(all(unix, feature = "async_tokio"))]
+pub mod async_tokio;
+
+pub use super::vfs::*;
+
+use super::{
+    error::Errno,
+    types::{self as wasi_types, __wasi_subscription_t},
+};
+use std::{
+    future::Future,
+    io::{self, Read, Write},
+    net,
+    time::{Duration, SystemTime},
+};
+use wasi_types::{
+    __wasi_clockid_t::{
+        __WASI_CLOCKID_MONOTONIC as CLOCKID_MONOTONIC, __WASI_CLOCKID_REALTIME as CLOCKID_REALTIME,
+    },
+    __wasi_eventtype_t::{
+        __WASI_EVENTTYPE_CLOCK as CLOCK, __WASI_EVENTTYPE_FD_READ as RD,
+        __WASI_EVENTTYPE_FD_WRITE as WR,
+    },
+};
+
+#[derive(Debug, Clone, Copy, Default)]
+pub enum AddressFamily {
+    #[default]
+    Inet4,
+    Inet6,
+}
+
+#[derive(Debug, Clone, Copy, Default)]
+pub enum SocketType {
+    Datagram,
+    #[default]
+    Stream,
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum ConnectState {
+    Empty,
+    Listening,
+    Connected,
+    Connecting,
+}
+
+impl Default for ConnectState {
+    fn default() -> Self {
+        Self::Empty
+    }
+}
+
+#[derive(Debug, Clone, Default)]
+pub struct WasiSocketState {
+    pub sock_type: (AddressFamily, SocketType),
+    pub local_addr: Option<net::SocketAddr>,
+    pub peer_addr: Option<net::SocketAddr>,
+    pub bind_device: Vec<u8>,
+    pub backlog: u32,
+    pub shutdown: Option<net::Shutdown>,
+    pub nonblocking: bool,
+    pub so_reuseaddr: bool,
+    pub so_conn_state: ConnectState,
+    pub so_recv_buf_size: usize,
+    pub so_send_buf_size: usize,
+    pub so_recv_timeout: Option<Duration>,
+    pub so_send_timeout: Option<Duration>,
+    pub fs_rights: WASIRights,
+}
+
+#[derive(Debug, Clone, Copy)]
+pub enum SubscriptionFdType {
+    Read(wasi_types::__wasi_userdata_t),
+    Write(wasi_types::__wasi_userdata_t),
+    Both {
+        read: wasi_types::__wasi_userdata_t,
+        write: wasi_types::__wasi_userdata_t,
+    },
+}
+
+#[derive(Debug, Clone, Copy)]
+pub struct SubscriptionFd {
+    pub fd: wasi_types::__wasi_fd_t,
+    pub type_: SubscriptionFdType,
+}
+
+impl SubscriptionFd {
+    pub fn set_write(&mut self, userdata: wasi_types::__wasi_userdata_t) {
+        let read_userdata = match &mut self.type_ {
+            SubscriptionFdType::Read(v) => *v,
+            SubscriptionFdType::Write(v) => {
+                *v = userdata;
+                return;
+            }
+            SubscriptionFdType::Both { read, write } => {
+                *write = userdata;
+                return;
+            }
+        };
+        self.type_ = SubscriptionFdType::Both {
+            read: read_userdata,
+            write: userdata,
+        };
+    }
+
+    pub fn set_read(&mut self, userdata: wasi_types::__wasi_userdata_t) {
+        let write_userdata = match &mut self.type_ {
+            SubscriptionFdType::Write(v) => *v,
+            SubscriptionFdType::Read(v) => {
+                *v = userdata;
+                return;
+            }
+            SubscriptionFdType::Both { read, write } => {
+                *read = userdata;
+                return;
+            }
+        };
+        self.type_ = SubscriptionFdType::Both {
+            read: userdata,
+            write: write_userdata,
+        };
+    }
+}
+
+#[derive(Debug, Clone, Copy)]
+pub struct SubscriptionClock {
+    pub timeout: Option<SystemTime>,
+    pub userdata: wasi_types::__wasi_userdata_t,
+    pub err: Option<Errno>,
+}
+
+#[derive(Debug, Clone, Copy)]
+pub enum Subscription {
+    FD(SubscriptionFd),
+    RealClock(SubscriptionClock),
+}
+
+impl Subscription {
+    pub fn from(s: &__wasi_subscription_t) -> Result<Subscription, Errno> {
+        let userdata = s.userdata;
+        match s.u.tag {
+            CLOCK => {
+                let clock = unsafe { s.u.u.clock };
+                match clock.id {
+                    CLOCKID_REALTIME | CLOCKID_MONOTONIC => {
+                        if clock.flags == 1 {
+                            if let Some(ddl) = std::time::UNIX_EPOCH
+                                .checked_add(Duration::from_nanos(clock.timeout + clock.precision))
+                            {
+                                Ok(Subscription::RealClock(SubscriptionClock {
+                                    timeout: Some(ddl),
+                                    userdata,
+                                    err: None,
+                                }))
+                            } else {
+                                Ok(Subscription::RealClock(SubscriptionClock {
+                                    timeout: None,
+                                    userdata,
+                                    err: Some(Errno::__WASI_ERRNO_INVAL),
+                                }))
+                            }
+                        } else if clock.timeout == 0 {
+                            Ok(Subscription::RealClock(SubscriptionClock {
+                                timeout: None,
+                                userdata,
+                                err: None,
+                            }))
+                        } else {
+                            let duration = Duration::from_nanos(clock.timeout + clock.precision);
+
+                            let timeout = std::time::SystemTime::now().checked_add(duration);
+
+                            Ok(Subscription::RealClock(SubscriptionClock {
+                                timeout,
+                                userdata,
+                                err: None,
+                            }))
+                        }
+                    }
+
+                    _ => Ok(Subscription::RealClock(SubscriptionClock {
+                        timeout: None,
+                        userdata,
+                        err: Some(Errno::__WASI_ERRNO_NODEV),
+                    })),
+                }
+            }
+            RD => {
+                let fd_read = unsafe { s.u.u.fd_read };
+                Ok(Subscription::FD(SubscriptionFd {
+                    fd: fd_read.file_descriptor,
+                    type_: SubscriptionFdType::Read(userdata),
+                }))
+            }
+            WR => {
+                let fd_read = unsafe { s.u.u.fd_read };
+                Ok(Subscription::FD(SubscriptionFd {
+                    fd: fd_read.file_descriptor,
+                    type_: SubscriptionFdType::Write(userdata),
+                }))
+            }
+            _ => Err(Errno::__WASI_ERRNO_INVAL),
+        }
+    }
+}
+
+pub enum PrePoll {
+    OnlyFd(Vec<SubscriptionFd>),
+    OnlyClock(SubscriptionClock),
+    ClockAndFd(SubscriptionClock, Vec<SubscriptionFd>),
+}
+
+impl PrePoll {
+    pub fn from_wasi_subscription(
+        subs: &[wasi_types::__wasi_subscription_t],
+    ) -> Result<Self, Errno> {
+        use std::collections::HashMap;
+        let mut fds = HashMap::with_capacity(subs.len());
+
+        let mut timeout: Option<SubscriptionClock> = None;
+        for s in subs {
+            let s = Subscription::from(s)?;
+            match s {
+                Subscription::FD(fd) => {
+                    let type_ = fd.type_;
+
+                    fds.entry(fd.fd)
+                        .and_modify(|e: &mut SubscriptionFd| match type_ {
+                            SubscriptionFdType::Read(data) => e.set_read(data),
+                            SubscriptionFdType::Write(data) => e.set_write(data),
+                            SubscriptionFdType::Both { read, write } => {
+                                e.type_ = SubscriptionFdType::Both { read, write };
+                            }
+                        })
+                        .or_insert(fd);
+                }
+                Subscription::RealClock(clock) => {
+                    if clock.err.is_some() {
+                        return Ok(PrePoll::OnlyClock(clock));
+                    }
+                    if clock.timeout.is_none() {
+                        return Ok(PrePoll::OnlyClock(clock));
+                    }
+
+                    if let Some(old_clock) = &mut timeout {
+                        let new_timeout = clock.timeout.unwrap();
+                        let old_timeout = old_clock.timeout.unwrap();
+
+                        if new_timeout < old_timeout {
+                            *old_clock = clock
+                        }
+                    } else {
+                        timeout = Some(clock)
+                    }
+                }
+            }
+        }
+
+        let fd_vec: Vec<SubscriptionFd> = fds.into_values().collect();
+
+        if let Some(clock) = timeout {
+            if fd_vec.is_empty() {
+                Ok(PrePoll::OnlyClock(clock))
+            } else {
+                Ok(PrePoll::ClockAndFd(clock, fd_vec))
+            }
+        } else {
+            Ok(PrePoll::OnlyFd(fd_vec))
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/types.rs.html b/src/async_wasi/snapshots/common/types.rs.html new file mode 100644 index 000000000..77479bc3b --- /dev/null +++ b/src/async_wasi/snapshots/common/types.rs.html @@ -0,0 +1,1025 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+
// bindgen --impl-debug --size_t-is-usize --no-layout-tests --no-doc-comments  --allowlist-type="__wasi.*" --default-enum-style moduleconsts WasmEdge/thirdparty/wasi/api.hpp -o wasi_types.rs
+
+/* automatically generated by rust-bindgen 0.60.1 */
+
+pub type __uint8_t = ::std::os::raw::c_uchar;
+pub type __uint16_t = ::std::os::raw::c_ushort;
+pub type __int32_t = ::std::os::raw::c_int;
+pub type __uint32_t = ::std::os::raw::c_uint;
+pub type __int64_t = ::std::os::raw::c_long;
+pub type __uint64_t = ::std::os::raw::c_ulong;
+pub type const_uint8_t_ptr = u32;
+pub type uint8_t_ptr = u32;
+pub type __wasi_size_t = u32;
+pub type __wasi_filesize_t = u64;
+pub type __wasi_timestamp_t = u64;
+pub mod __wasi_clockid_t {
+    pub type Type = u32;
+    pub const __WASI_CLOCKID_REALTIME: Type = 0;
+    pub const __WASI_CLOCKID_MONOTONIC: Type = 1;
+    pub const __WASI_CLOCKID_PROCESS_CPUTIME_ID: Type = 2;
+    pub const __WASI_CLOCKID_THREAD_CPUTIME_ID: Type = 3;
+}
+pub mod __wasi_errno_t {
+    pub type Type = u16;
+    pub const __WASI_ERRNO_SUCCESS: Type = 0;
+    pub const __WASI_ERRNO_2BIG: Type = 1;
+    pub const __WASI_ERRNO_ACCES: Type = 2;
+    pub const __WASI_ERRNO_ADDRINUSE: Type = 3;
+    pub const __WASI_ERRNO_ADDRNOTAVAIL: Type = 4;
+    pub const __WASI_ERRNO_AFNOSUPPORT: Type = 5;
+    pub const __WASI_ERRNO_AGAIN: Type = 6;
+    pub const __WASI_ERRNO_ALREADY: Type = 7;
+    pub const __WASI_ERRNO_BADF: Type = 8;
+    pub const __WASI_ERRNO_BADMSG: Type = 9;
+    pub const __WASI_ERRNO_BUSY: Type = 10;
+    pub const __WASI_ERRNO_CANCELED: Type = 11;
+    pub const __WASI_ERRNO_CHILD: Type = 12;
+    pub const __WASI_ERRNO_CONNABORTED: Type = 13;
+    pub const __WASI_ERRNO_CONNREFUSED: Type = 14;
+    pub const __WASI_ERRNO_CONNRESET: Type = 15;
+    pub const __WASI_ERRNO_DEADLK: Type = 16;
+    pub const __WASI_ERRNO_DESTADDRREQ: Type = 17;
+    pub const __WASI_ERRNO_DOM: Type = 18;
+    pub const __WASI_ERRNO_DQUOT: Type = 19;
+    pub const __WASI_ERRNO_EXIST: Type = 20;
+    pub const __WASI_ERRNO_FAULT: Type = 21;
+    pub const __WASI_ERRNO_FBIG: Type = 22;
+    pub const __WASI_ERRNO_HOSTUNREACH: Type = 23;
+    pub const __WASI_ERRNO_IDRM: Type = 24;
+    pub const __WASI_ERRNO_ILSEQ: Type = 25;
+    pub const __WASI_ERRNO_INPROGRESS: Type = 26;
+    pub const __WASI_ERRNO_INTR: Type = 27;
+    pub const __WASI_ERRNO_INVAL: Type = 28;
+    pub const __WASI_ERRNO_IO: Type = 29;
+    pub const __WASI_ERRNO_ISCONN: Type = 30;
+    pub const __WASI_ERRNO_ISDIR: Type = 31;
+    pub const __WASI_ERRNO_LOOP: Type = 32;
+    pub const __WASI_ERRNO_MFILE: Type = 33;
+    pub const __WASI_ERRNO_MLINK: Type = 34;
+    pub const __WASI_ERRNO_MSGSIZE: Type = 35;
+    pub const __WASI_ERRNO_MULTIHOP: Type = 36;
+    pub const __WASI_ERRNO_NAMETOOLONG: Type = 37;
+    pub const __WASI_ERRNO_NETDOWN: Type = 38;
+    pub const __WASI_ERRNO_NETRESET: Type = 39;
+    pub const __WASI_ERRNO_NETUNREACH: Type = 40;
+    pub const __WASI_ERRNO_NFILE: Type = 41;
+    pub const __WASI_ERRNO_NOBUFS: Type = 42;
+    pub const __WASI_ERRNO_NODEV: Type = 43;
+    pub const __WASI_ERRNO_NOENT: Type = 44;
+    pub const __WASI_ERRNO_NOEXEC: Type = 45;
+    pub const __WASI_ERRNO_NOLCK: Type = 46;
+    pub const __WASI_ERRNO_NOLINK: Type = 47;
+    pub const __WASI_ERRNO_NOMEM: Type = 48;
+    pub const __WASI_ERRNO_NOMSG: Type = 49;
+    pub const __WASI_ERRNO_NOPROTOOPT: Type = 50;
+    pub const __WASI_ERRNO_NOSPC: Type = 51;
+    pub const __WASI_ERRNO_NOSYS: Type = 52;
+    pub const __WASI_ERRNO_NOTCONN: Type = 53;
+    pub const __WASI_ERRNO_NOTDIR: Type = 54;
+    pub const __WASI_ERRNO_NOTEMPTY: Type = 55;
+    pub const __WASI_ERRNO_NOTRECOVERABLE: Type = 56;
+    pub const __WASI_ERRNO_NOTSOCK: Type = 57;
+    pub const __WASI_ERRNO_NOTSUP: Type = 58;
+    pub const __WASI_ERRNO_NOTTY: Type = 59;
+    pub const __WASI_ERRNO_NXIO: Type = 60;
+    pub const __WASI_ERRNO_OVERFLOW: Type = 61;
+    pub const __WASI_ERRNO_OWNERDEAD: Type = 62;
+    pub const __WASI_ERRNO_PERM: Type = 63;
+    pub const __WASI_ERRNO_PIPE: Type = 64;
+    pub const __WASI_ERRNO_PROTO: Type = 65;
+    pub const __WASI_ERRNO_PROTONOSUPPORT: Type = 66;
+    pub const __WASI_ERRNO_PROTOTYPE: Type = 67;
+    pub const __WASI_ERRNO_RANGE: Type = 68;
+    pub const __WASI_ERRNO_ROFS: Type = 69;
+    pub const __WASI_ERRNO_SPIPE: Type = 70;
+    pub const __WASI_ERRNO_SRCH: Type = 71;
+    pub const __WASI_ERRNO_STALE: Type = 72;
+    pub const __WASI_ERRNO_TIMEDOUT: Type = 73;
+    pub const __WASI_ERRNO_TXTBSY: Type = 74;
+    pub const __WASI_ERRNO_XDEV: Type = 75;
+    pub const __WASI_ERRNO_NOTCAPABLE: Type = 76;
+    pub const __WASI_ERRNO_AIADDRFAMILY: Type = 77;
+    pub const __WASI_ERRNO_AIAGAIN: Type = 78;
+    pub const __WASI_ERRNO_AIBADFLAG: Type = 79;
+    pub const __WASI_ERRNO_AIFAIL: Type = 80;
+    pub const __WASI_ERRNO_AIFAMILY: Type = 81;
+    pub const __WASI_ERRNO_AIMEMORY: Type = 82;
+    pub const __WASI_ERRNO_AINODATA: Type = 83;
+    pub const __WASI_ERRNO_AINONAME: Type = 84;
+    pub const __WASI_ERRNO_AISERVICE: Type = 85;
+    pub const __WASI_ERRNO_AISOCKTYPE: Type = 86;
+    pub const __WASI_ERRNO_AISYSTEM: Type = 87;
+}
+pub mod __wasi_rights_t {
+    pub type Type = u64;
+    pub const __WASI_RIGHTS_FD_DATASYNC: Type = 1;
+    pub const __WASI_RIGHTS_FD_READ: Type = 2;
+    pub const __WASI_RIGHTS_FD_SEEK: Type = 4;
+    pub const __WASI_RIGHTS_FD_FDSTAT_SET_FLAGS: Type = 8;
+    pub const __WASI_RIGHTS_FD_SYNC: Type = 16;
+    pub const __WASI_RIGHTS_FD_TELL: Type = 32;
+    pub const __WASI_RIGHTS_FD_WRITE: Type = 64;
+    pub const __WASI_RIGHTS_FD_ADVISE: Type = 128;
+    pub const __WASI_RIGHTS_FD_ALLOCATE: Type = 256;
+    pub const __WASI_RIGHTS_PATH_CREATE_DIRECTORY: Type = 512;
+    pub const __WASI_RIGHTS_PATH_CREATE_FILE: Type = 1024;
+    pub const __WASI_RIGHTS_PATH_LINK_SOURCE: Type = 2048;
+    pub const __WASI_RIGHTS_PATH_LINK_TARGET: Type = 4096;
+    pub const __WASI_RIGHTS_PATH_OPEN: Type = 8192;
+    pub const __WASI_RIGHTS_FD_READDIR: Type = 16384;
+    pub const __WASI_RIGHTS_PATH_READLINK: Type = 32768;
+    pub const __WASI_RIGHTS_PATH_RENAME_SOURCE: Type = 65536;
+    pub const __WASI_RIGHTS_PATH_RENAME_TARGET: Type = 131072;
+    pub const __WASI_RIGHTS_PATH_FILESTAT_GET: Type = 262144;
+    pub const __WASI_RIGHTS_PATH_FILESTAT_SET_SIZE: Type = 524288;
+    pub const __WASI_RIGHTS_PATH_FILESTAT_SET_TIMES: Type = 1048576;
+    pub const __WASI_RIGHTS_FD_FILESTAT_GET: Type = 2097152;
+    pub const __WASI_RIGHTS_FD_FILESTAT_SET_SIZE: Type = 4194304;
+    pub const __WASI_RIGHTS_FD_FILESTAT_SET_TIMES: Type = 8388608;
+    pub const __WASI_RIGHTS_PATH_SYMLINK: Type = 16777216;
+    pub const __WASI_RIGHTS_PATH_REMOVE_DIRECTORY: Type = 33554432;
+    pub const __WASI_RIGHTS_PATH_UNLINK_FILE: Type = 67108864;
+    pub const __WASI_RIGHTS_POLL_FD_READWRITE: Type = 134217728;
+    pub const __WASI_RIGHTS_SOCK_SHUTDOWN: Type = 268435456;
+    pub const __WASI_RIGHTS_SOCK_OPEN: Type = 536870912;
+    pub const __WASI_RIGHTS_SOCK_CLOSE: Type = 1073741824;
+    pub const __WASI_RIGHTS_SOCK_BIND: Type = 2147483648;
+    pub const __WASI_RIGHTS_SOCK_RECV: Type = 4294967296;
+    pub const __WASI_RIGHTS_SOCK_RECV_FROM: Type = 8589934592;
+    pub const __WASI_RIGHTS_SOCK_SEND: Type = 17179869184;
+    pub const __WASI_RIGHTS_SOCK_SEND_TO: Type = 34359738368;
+}
+pub type __wasi_fd_t = i32;
+pub type __wasi_sock_d_t = __wasi_fd_t;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_iovec_t {
+    pub buf: uint8_t_ptr,
+    pub buf_len: __wasi_size_t,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_ciovec_t {
+    pub buf: const_uint8_t_ptr,
+    pub buf_len: __wasi_size_t,
+}
+pub type __wasi_filedelta_t = i64;
+pub mod __wasi_whence_t {
+    pub type Type = u8;
+    pub const __WASI_WHENCE_SET: Type = 0;
+    pub const __WASI_WHENCE_CUR: Type = 1;
+    pub const __WASI_WHENCE_END: Type = 2;
+}
+pub type __wasi_dircookie_t = u64;
+pub type __wasi_dirnamlen_t = u32;
+pub type __wasi_inode_t = u64;
+pub mod __wasi_filetype_t {
+    pub type Type = u8;
+    pub const __WASI_FILETYPE_UNKNOWN: Type = 0;
+    pub const __WASI_FILETYPE_BLOCK_DEVICE: Type = 1;
+    pub const __WASI_FILETYPE_CHARACTER_DEVICE: Type = 2;
+    pub const __WASI_FILETYPE_DIRECTORY: Type = 3;
+    pub const __WASI_FILETYPE_REGULAR_FILE: Type = 4;
+    pub const __WASI_FILETYPE_SOCKET_DGRAM: Type = 5;
+    pub const __WASI_FILETYPE_SOCKET_STREAM: Type = 6;
+    pub const __WASI_FILETYPE_SYMBOLIC_LINK: Type = 7;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_dirent_t {
+    pub d_next: __wasi_dircookie_t,
+    pub d_ino: __wasi_inode_t,
+    pub d_namlen: __wasi_dirnamlen_t,
+    pub d_type: __wasi_filetype_t::Type,
+}
+pub mod __wasi_advice_t {
+    pub type Type = u8;
+    pub const __WASI_ADVICE_NORMAL: Type = 0;
+    pub const __WASI_ADVICE_SEQUENTIAL: Type = 1;
+    pub const __WASI_ADVICE_RANDOM: Type = 2;
+    pub const __WASI_ADVICE_WILLNEED: Type = 3;
+    pub const __WASI_ADVICE_DONTNEED: Type = 4;
+    pub const __WASI_ADVICE_NOREUSE: Type = 5;
+}
+pub mod __wasi_fdflags_t {
+    pub type Type = u16;
+    pub const __WASI_FDFLAGS_APPEND: Type = 1;
+    pub const __WASI_FDFLAGS_DSYNC: Type = 2;
+    pub const __WASI_FDFLAGS_NONBLOCK: Type = 4;
+    pub const __WASI_FDFLAGS_RSYNC: Type = 8;
+    pub const __WASI_FDFLAGS_SYNC: Type = 16;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_fdstat_t {
+    pub fs_filetype: __wasi_filetype_t::Type,
+    pub fs_flags: __wasi_fdflags_t::Type,
+    pub fs_rights_base: __wasi_rights_t::Type,
+    pub fs_rights_inheriting: __wasi_rights_t::Type,
+}
+pub type __wasi_device_t = u64;
+pub mod __wasi_fstflags_t {
+    pub type Type = u16;
+    pub const __WASI_FSTFLAGS_ATIM: Type = 1;
+    pub const __WASI_FSTFLAGS_ATIM_NOW: Type = 2;
+    pub const __WASI_FSTFLAGS_MTIM: Type = 4;
+    pub const __WASI_FSTFLAGS_MTIM_NOW: Type = 8;
+}
+pub mod __wasi_lookupflags_t {
+    pub type Type = u32;
+    pub const __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW: Type = 1;
+}
+pub mod __wasi_oflags_t {
+    pub type Type = u16;
+    pub const __WASI_OFLAGS_CREAT: Type = 1;
+    pub const __WASI_OFLAGS_DIRECTORY: Type = 2;
+    pub const __WASI_OFLAGS_EXCL: Type = 4;
+    pub const __WASI_OFLAGS_TRUNC: Type = 8;
+}
+pub type __wasi_linkcount_t = u64;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_filestat_t {
+    pub dev: __wasi_device_t,
+    pub ino: __wasi_inode_t,
+    pub filetype: __wasi_filetype_t::Type,
+    pub nlink: __wasi_linkcount_t,
+    pub size: __wasi_filesize_t,
+    pub atim: __wasi_timestamp_t,
+    pub mtim: __wasi_timestamp_t,
+    pub ctim: __wasi_timestamp_t,
+}
+pub type __wasi_userdata_t = u64;
+pub mod __wasi_eventtype_t {
+    pub type Type = u8;
+    pub const __WASI_EVENTTYPE_CLOCK: Type = 0;
+    pub const __WASI_EVENTTYPE_FD_READ: Type = 1;
+    pub const __WASI_EVENTTYPE_FD_WRITE: Type = 2;
+}
+pub mod __wasi_eventrwflags_t {
+    pub type Type = u16;
+    pub const __WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP: Type = 1;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_event_fd_readwrite_t {
+    pub nbytes: __wasi_filesize_t,
+    pub flags: __wasi_eventrwflags_t::Type,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_event_t {
+    pub userdata: __wasi_userdata_t,
+    pub error: __wasi_errno_t::Type,
+    pub type_: __wasi_eventtype_t::Type,
+    pub fd_readwrite: __wasi_event_fd_readwrite_t,
+}
+pub mod __wasi_subclockflags_t {
+    pub type Type = u16;
+    pub const __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME: Type = 1;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_subscription_clock_t {
+    pub id: __wasi_clockid_t::Type,
+    pub timeout: __wasi_timestamp_t,
+    pub precision: __wasi_timestamp_t,
+    pub flags: __wasi_subclockflags_t::Type,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_subscription_fd_readwrite_t {
+    pub file_descriptor: __wasi_fd_t,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union __wasi_subscription_u_u_t {
+    pub clock: __wasi_subscription_clock_t,
+    pub fd_read: __wasi_subscription_fd_readwrite_t,
+    pub fd_write: __wasi_subscription_fd_readwrite_t,
+}
+impl ::std::fmt::Debug for __wasi_subscription_u_u_t {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+        write!(f, "__wasi_subscription_u_u_t {{ union }}")
+    }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct __wasi_subscription_u_t {
+    pub tag: __wasi_eventtype_t::Type,
+    pub u: __wasi_subscription_u_u_t,
+}
+impl ::std::fmt::Debug for __wasi_subscription_u_t {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+        write!(
+            f,
+            "__wasi_subscription_u_t {{ tag: {:?}, u: {:?} }}",
+            self.tag, self.u
+        )
+    }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct __wasi_subscription_t {
+    pub userdata: __wasi_userdata_t,
+    pub u: __wasi_subscription_u_t,
+}
+impl ::std::fmt::Debug for __wasi_subscription_t {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+        write!(
+            f,
+            "__wasi_subscription_t {{ userdata: {:?}, u: {:?} }}",
+            self.userdata, self.u
+        )
+    }
+}
+pub type __wasi_exitcode_t = u32;
+pub mod __wasi_signal_t {
+    pub type Type = u8;
+    pub const __WASI_SIGNAL_NONE: Type = 0;
+    pub const __WASI_SIGNAL_HUP: Type = 1;
+    pub const __WASI_SIGNAL_INT: Type = 2;
+    pub const __WASI_SIGNAL_QUIT: Type = 3;
+    pub const __WASI_SIGNAL_ILL: Type = 4;
+    pub const __WASI_SIGNAL_TRAP: Type = 5;
+    pub const __WASI_SIGNAL_ABRT: Type = 6;
+    pub const __WASI_SIGNAL_BUS: Type = 7;
+    pub const __WASI_SIGNAL_FPE: Type = 8;
+    pub const __WASI_SIGNAL_KILL: Type = 9;
+    pub const __WASI_SIGNAL_USR1: Type = 10;
+    pub const __WASI_SIGNAL_SEGV: Type = 11;
+    pub const __WASI_SIGNAL_USR2: Type = 12;
+    pub const __WASI_SIGNAL_PIPE: Type = 13;
+    pub const __WASI_SIGNAL_ALRM: Type = 14;
+    pub const __WASI_SIGNAL_TERM: Type = 15;
+    pub const __WASI_SIGNAL_CHLD: Type = 16;
+    pub const __WASI_SIGNAL_CONT: Type = 17;
+    pub const __WASI_SIGNAL_STOP: Type = 18;
+    pub const __WASI_SIGNAL_TSTP: Type = 19;
+    pub const __WASI_SIGNAL_TTIN: Type = 20;
+    pub const __WASI_SIGNAL_TTOU: Type = 21;
+    pub const __WASI_SIGNAL_URG: Type = 22;
+    pub const __WASI_SIGNAL_XCPU: Type = 23;
+    pub const __WASI_SIGNAL_XFSZ: Type = 24;
+    pub const __WASI_SIGNAL_VTALRM: Type = 25;
+    pub const __WASI_SIGNAL_PROF: Type = 26;
+    pub const __WASI_SIGNAL_WINCH: Type = 27;
+    pub const __WASI_SIGNAL_POLL: Type = 28;
+    pub const __WASI_SIGNAL_PWR: Type = 29;
+    pub const __WASI_SIGNAL_SYS: Type = 30;
+}
+pub mod __wasi_address_family_t {
+    pub type Type = u8;
+    pub const __WASI_ADDRESS_FAMILY_UNSPEC: Type = 0;
+    pub const __WASI_ADDRESS_FAMILY_INET4: Type = 1;
+    pub const __WASI_ADDRESS_FAMILY_INET6: Type = 2;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_address_t {
+    pub buf: uint8_t_ptr,
+    pub buf_len: __wasi_size_t,
+}
+pub mod __wasi_sock_opt_level_t {
+    pub type Type = u32;
+    pub const __WASI_SOCK_OPT_LEVEL_SOL_SOCKET: Type = 0;
+}
+pub mod __wasi_sock_opt_so_t {
+    pub type Type = u32;
+    pub const __WASI_SOCK_OPT_SO_REUSEADDR: Type = 0;
+    pub const __WASI_SOCK_OPT_SO_TYPE: Type = 1;
+    pub const __WASI_SOCK_OPT_SO_ERROR: Type = 2;
+    pub const __WASI_SOCK_OPT_SO_DONTROUTE: Type = 3;
+    pub const __WASI_SOCK_OPT_SO_BROADCAST: Type = 4;
+    pub const __WASI_SOCK_OPT_SO_SNDBUF: Type = 5;
+    pub const __WASI_SOCK_OPT_SO_RCVBUF: Type = 6;
+    pub const __WASI_SOCK_OPT_SO_KEEPALIVE: Type = 7;
+    pub const __WASI_SOCK_OPT_SO_OOBINLINE: Type = 8;
+    pub const __WASI_SOCK_OPT_SO_LINGER: Type = 9;
+    pub const __WASI_SOCK_OPT_SO_RCVLOWAT: Type = 10;
+    pub const __WASI_SOCK_OPT_SO_RCVTIMEO: Type = 11;
+    pub const __WASI_SOCK_OPT_SO_SNDTIMEO: Type = 12;
+    pub const __WASI_SOCK_OPT_SO_ACCEPTCONN: Type = 13;
+    pub const __WASI_SOCK_OPT_SO_BINDTODEVICE: Type = 14;
+}
+pub mod __wasi_aiflags_t {
+    pub type Type = u16;
+    pub const __WASI_AIFLAGS_AI_PASSIVE: Type = 1;
+    pub const __WASI_AIFLAGS_AI_CANONNAME: Type = 2;
+    pub const __WASI_AIFLAGS_AI_NUMERICHOST: Type = 4;
+    pub const __WASI_AIFLAGS_AI_NUMERICSERV: Type = 8;
+    pub const __WASI_AIFLAGS_AI_V4MAPPED: Type = 16;
+    pub const __WASI_AIFLAGS_AI_ALL: Type = 32;
+    pub const __WASI_AIFLAGS_AI_ADDRCONFIG: Type = 64;
+}
+pub mod __wasi_sock_type_t {
+    pub type Type = u8;
+    pub const __WASI_SOCK_TYPE_SOCK_ANY: Type = 0;
+    pub const __WASI_SOCK_TYPE_SOCK_DGRAM: Type = 1;
+    pub const __WASI_SOCK_TYPE_SOCK_STREAM: Type = 2;
+}
+pub mod __wasi_protocol_t {
+    pub type Type = u8;
+    pub const __WASI_PROTOCOL_IPPROTO_IP: Type = 0;
+    pub const __WASI_PROTOCOL_IPPROTO_TCP: Type = 1;
+    pub const __WASI_PROTOCOL_IPPROTO_UDP: Type = 2;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_sockaddr_in_t {
+    pub sin_family: __wasi_address_family_t::Type,
+    pub sin_port: u16,
+    pub sin_addr: __wasi_address_t,
+    pub sin_zero_len: __wasi_size_t,
+    pub sin_zero: uint8_t_ptr,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_sockaddr_t {
+    pub sa_family: __wasi_address_family_t::Type,
+    pub sa_data_len: __wasi_size_t,
+    pub sa_data: uint8_t_ptr,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_addrinfo_t {
+    pub ai_flags: __wasi_aiflags_t::Type,
+    pub ai_family: __wasi_address_family_t::Type,
+    pub ai_socktype: __wasi_sock_type_t::Type,
+    pub ai_protocol: __wasi_protocol_t::Type,
+    pub ai_addrlen: __wasi_size_t,
+    pub ai_addr: uint8_t_ptr,
+    pub ai_canonname: uint8_t_ptr,
+    pub ai_canonname_len: __wasi_size_t,
+    pub ai_next: uint8_t_ptr,
+}
+pub mod __wasi_riflags_t {
+    pub type Type = u16;
+    pub const __WASI_RIFLAGS_RECV_PEEK: Type = 1;
+    pub const __WASI_RIFLAGS_RECV_WAITALL: Type = 2;
+}
+pub mod __wasi_roflags_t {
+    pub type Type = u16;
+    pub const __WASI_ROFLAGS_RECV_DATA_TRUNCATED: Type = 1;
+}
+pub type __wasi_siflags_t = u16;
+pub mod __wasi_sdflags_t {
+    pub type Type = u8;
+    pub const __WASI_SDFLAGS_RD: Type = 1;
+    pub const __WASI_SDFLAGS_WR: Type = 2;
+}
+pub mod __wasi_preopentype_t {
+    pub type Type = u8;
+    pub const __WASI_PREOPENTYPE_DIR: Type = 0;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __wasi_prestat_dir_t {
+    pub pr_name_len: __wasi_size_t,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union __wasi_prestat_u_t {
+    pub dir: __wasi_prestat_dir_t,
+}
+impl ::std::fmt::Debug for __wasi_prestat_u_t {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+        write!(f, "__wasi_prestat_u_t {{ union }}")
+    }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct __wasi_prestat_t {
+    pub tag: __wasi_preopentype_t::Type,
+    pub u: __wasi_prestat_u_t,
+}
+impl ::std::fmt::Debug for __wasi_prestat_t {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+        write!(
+            f,
+            "__wasi_prestat_t {{ tag: {:?}, u: {:?} }}",
+            self.tag, self.u
+        )
+    }
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct __wasi_timeval {
+    pub tv_sec: i64,
+    pub tv_usec: i64,
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/vfs/mod.rs.html b/src/async_wasi/snapshots/common/vfs/mod.rs.html new file mode 100644 index 000000000..0cd300198 --- /dev/null +++ b/src/async_wasi/snapshots/common/vfs/mod.rs.html @@ -0,0 +1,549 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+
use super::{error::Errno, types as wasi_types};
+use bitflags::bitflags;
+use std::{future::Future, time::Duration};
+
+pub mod sync;
+
+pub use sync::*;
+
+pub enum SystemTimeSpec {
+    SymbolicNow,
+    Absolute(Duration),
+}
+
+pub struct ReaddirEntity {
+    pub next: u64,
+    pub inode: u64,
+    pub name: String,
+    pub filetype: FileType,
+}
+
+impl From<&ReaddirEntity> for wasi_types::__wasi_dirent_t {
+    fn from(ent: &ReaddirEntity) -> Self {
+        wasi_types::__wasi_dirent_t {
+            d_next: ent.next.to_le(),
+            d_ino: ent.inode.to_le(),
+            d_namlen: (ent.name.len() as u32).to_le(),
+            d_type: ent.filetype.0,
+        }
+    }
+}
+
+#[derive(Debug, Clone)]
+pub struct FdStat {
+    pub filetype: FileType,
+    pub fs_rights_base: WASIRights,
+    pub fs_rights_inheriting: WASIRights,
+    pub flags: FdFlags,
+}
+
+impl From<&FdStat> for wasi_types::__wasi_fdstat_t {
+    fn from(fdstat: &FdStat) -> wasi_types::__wasi_fdstat_t {
+        use wasi_types::__wasi_fdstat_t;
+        __wasi_fdstat_t {
+            fs_filetype: fdstat.filetype.0,
+            fs_rights_base: fdstat.fs_rights_base.bits(),
+            fs_rights_inheriting: fdstat.fs_rights_inheriting.bits(),
+            fs_flags: fdstat.flags.bits(),
+        }
+    }
+}
+
+impl From<FdStat> for wasi_types::__wasi_fdstat_t {
+    fn from(fdstat: FdStat) -> wasi_types::__wasi_fdstat_t {
+        use wasi_types::__wasi_fdstat_t;
+        __wasi_fdstat_t::from(&fdstat)
+    }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct Filestat {
+    pub filetype: FileType,
+    pub inode: u64,
+    pub nlink: u64,
+    pub size: u64, // this is a read field, the rest are file fields
+    pub atim: Option<std::time::SystemTime>,
+    pub mtim: Option<std::time::SystemTime>,
+    pub ctim: Option<std::time::SystemTime>,
+}
+
+impl From<Filestat> for wasi_types::__wasi_filestat_t {
+    fn from(stat: Filestat) -> wasi_types::__wasi_filestat_t {
+        wasi_types::__wasi_filestat_t {
+            dev: 3,
+            ino: stat.inode,
+            filetype: stat.filetype.0,
+            nlink: stat.nlink,
+            size: stat.size,
+            atim: stat
+                .atim
+                .map(|t| t.duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos() as u64)
+                .unwrap_or(0),
+            mtim: stat
+                .mtim
+                .map(|t| t.duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos() as u64)
+                .unwrap_or(0),
+            ctim: stat
+                .ctim
+                .map(|t| t.duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos() as u64)
+                .unwrap_or(0),
+        }
+    }
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct FileType(pub wasi_types::__wasi_filetype_t::Type);
+impl FileType {
+    pub const UNKNOWN: FileType = FileType(0);
+    pub const BLOCK_DEVICE: FileType = FileType(1);
+    pub const CHARACTER_DEVICE: FileType = FileType(2);
+    pub const DIRECTORY: FileType = FileType(3);
+    pub const REGULAR_FILE: FileType = FileType(4);
+    pub const SOCKET_DGRAM: FileType = FileType(5);
+    pub const SOCKET_STREAM: FileType = FileType(6);
+    pub const SYMBOLIC_LINK: FileType = FileType(7);
+}
+
+bitflags! {
+    #[derive(Debug, Clone)]
+    pub struct FdFlags: wasi_types::__wasi_fdflags_t::Type {
+        const APPEND   = wasi_types::__wasi_fdflags_t::__WASI_FDFLAGS_APPEND; // 0b1
+        const DSYNC    = wasi_types::__wasi_fdflags_t::__WASI_FDFLAGS_DSYNC; // 0b10
+        const NONBLOCK = wasi_types::__wasi_fdflags_t::__WASI_FDFLAGS_NONBLOCK; // 0b100
+        const RSYNC    = wasi_types::__wasi_fdflags_t::__WASI_FDFLAGS_RSYNC; // 0b1000
+        const SYNC     = wasi_types::__wasi_fdflags_t::__WASI_FDFLAGS_SYNC; // 0b10000
+    }
+}
+
+bitflags! {
+    #[derive(PartialEq)]
+    pub struct SdFlags: wasi_types::__wasi_sdflags_t::Type {
+        const RD = wasi_types::__wasi_sdflags_t::__WASI_SDFLAGS_RD;
+        const WR = wasi_types::__wasi_sdflags_t::__WASI_SDFLAGS_WR;
+    }
+}
+
+impl From<SdFlags> for std::net::Shutdown {
+    fn from(val: SdFlags) -> Self {
+        use std::net::Shutdown;
+        if val == SdFlags::RD {
+            Shutdown::Read
+        } else if val == SdFlags::WR {
+            Shutdown::Write
+        } else {
+            Shutdown::Both
+        }
+    }
+}
+
+bitflags! {
+    pub struct SiFlags: wasi_types::__wasi_siflags_t {
+    }
+}
+
+bitflags! {
+    pub struct RiFlags: wasi_types::__wasi_riflags_t::Type {
+        const RECV_PEEK    = wasi_types::__wasi_riflags_t::__WASI_RIFLAGS_RECV_PEEK;
+        const RECV_WAITALL = wasi_types::__wasi_riflags_t::__WASI_RIFLAGS_RECV_WAITALL;
+    }
+}
+
+bitflags! {
+    pub struct RoFlags: wasi_types::__wasi_roflags_t::Type {
+        const RECV_DATA_TRUNCATED = wasi_types::__wasi_roflags_t::__WASI_ROFLAGS_RECV_DATA_TRUNCATED;
+    }
+}
+
+bitflags! {
+    pub struct OFlags: wasi_types::__wasi_oflags_t::Type {
+        const CREATE    = wasi_types::__wasi_oflags_t::__WASI_OFLAGS_CREAT;
+        const DIRECTORY = wasi_types::__wasi_oflags_t::__WASI_OFLAGS_DIRECTORY;
+        const EXCLUSIVE = wasi_types::__wasi_oflags_t::__WASI_OFLAGS_EXCL;
+        const TRUNCATE  = wasi_types::__wasi_oflags_t::__WASI_OFLAGS_TRUNC;
+    }
+}
+
+bitflags! {
+    #[derive(Debug, Clone)]
+    pub struct WASIRights : wasi_types::__wasi_rights_t::Type {
+        const  FD_DATASYNC= 1;
+        const  FD_READ  = 2;
+        const  FD_SEEK  = 4;
+        const  FD_FDSTAT_SET_FLAGS  = 8;
+        const  FD_SYNC  = 16;
+        const  FD_TELL  = 32;
+        const  FD_WRITE  = 64;
+        const  FD_ADVISE  = 128;
+        const  FD_ALLOCATE  = 256;
+        const  PATH_CREATE_DIRECTORY  = 512;
+        const  PATH_CREATE_FILE  = 1024;
+        const  PATH_LINK_SOURCE  = 2048;
+        const  PATH_LINK_TARGET  = 4096;
+        const  PATH_OPEN  = 8192;
+        const  FD_READDIR  = 16384;
+        const  PATH_READLINK  = 32768;
+        const  PATH_RENAME_SOURCE  = 65536;
+        const  PATH_RENAME_TARGET  = 131072;
+        const  PATH_FILESTAT_GET  = 262144;
+        const  PATH_FILESTAT_SET_SIZE  = 524288;
+        const  PATH_FILESTAT_SET_TIMES  = 1048576;
+        const  FD_FILESTAT_GET  = 2097152;
+        const  FD_FILESTAT_SET_SIZE  = 4194304;
+        const  FD_FILESTAT_SET_TIMES  = 8388608;
+        const  PATH_SYMLINK  = 16777216;
+        const  PATH_REMOVE_DIRECTORY  = 33554432;
+        const  PATH_UNLINK_FILE  = 67108864;
+        const  POLL_FD_READWRITE  = 134217728;
+        const  SOCK_SHUTDOWN  = 268435456;
+        const  SOCK_OPEN  = 536870912;
+        const  SOCK_CLOSE  = 1073741824;
+        const  SOCK_BIND  = 2147483648;
+        const  SOCK_RECV  = 4294967296;
+        const  SOCK_RECV_FROM  = 8589934592;
+        const  SOCK_SEND  = 17179869184;
+        const  SOCK_SEND_TO  = 34359738368;
+    }
+}
+
+impl Default for WASIRights {
+    fn default() -> Self {
+        Self::empty()
+    }
+}
+
+impl WASIRights {
+    #[inline]
+    pub fn fd_all() -> Self {
+        WASIRights::FD_ADVISE
+            | WASIRights::FD_ALLOCATE
+            | WASIRights::FD_DATASYNC
+            | WASIRights::FD_SYNC
+            | WASIRights::FD_TELL
+            | WASIRights::FD_SEEK
+            | WASIRights::FD_READ
+            | WASIRights::FD_WRITE
+            | WASIRights::FD_FDSTAT_SET_FLAGS
+            | WASIRights::FD_FILESTAT_GET
+            | WASIRights::FD_FILESTAT_SET_SIZE
+            | WASIRights::FD_FILESTAT_SET_TIMES
+    }
+
+    #[inline]
+    pub fn dir_all() -> Self {
+        WASIRights::PATH_CREATE_DIRECTORY
+            | WASIRights::PATH_CREATE_FILE
+            | WASIRights::PATH_LINK_SOURCE
+            | WASIRights::PATH_LINK_TARGET
+            | WASIRights::PATH_OPEN
+            | WASIRights::FD_READDIR
+            | WASIRights::PATH_READLINK
+            | WASIRights::PATH_RENAME_SOURCE
+            | WASIRights::PATH_RENAME_TARGET
+            | WASIRights::PATH_SYMLINK
+            | WASIRights::PATH_REMOVE_DIRECTORY
+            | WASIRights::PATH_UNLINK_FILE
+            | WASIRights::PATH_FILESTAT_GET
+            | WASIRights::PATH_FILESTAT_SET_TIMES
+            | WASIRights::FD_FILESTAT_GET
+            | WASIRights::FD_FILESTAT_SET_TIMES
+    }
+
+    pub fn can(&self, other: Self) -> Result<(), Errno> {
+        if self.contains(other) {
+            Ok(())
+        } else {
+            Err(Errno::__WASI_ERRNO_NOTCAPABLE)
+        }
+    }
+}
+
+bitflags! {
+    pub struct Lookupflags: wasi_types::__wasi_lookupflags_t::Type {
+        const SYMLINK_FOLLOW = wasi_types::__wasi_lookupflags_t::__WASI_LOOKUPFLAGS_SYMLINK_FOLLOW;
+    }
+}
+
+#[derive(Debug, Clone)]
+pub enum Advice {
+    Normal,
+    Sequential,
+    Random,
+    WillNeed,
+    DontNeed,
+    NoReuse,
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/common/vfs/sync.rs.html b/src/async_wasi/snapshots/common/vfs/sync.rs.html new file mode 100644 index 000000000..25d0c64eb --- /dev/null +++ b/src/async_wasi/snapshots/common/vfs/sync.rs.html @@ -0,0 +1,2071 @@ +sync.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+
use super::*;
+use std::{
+    fs, io,
+    io::{Read, Seek, Write},
+    ops::{Deref, DerefMut},
+    path::{Path, PathBuf},
+    time::{Duration, SystemTime},
+};
+
+fn systimespec(
+    set: bool,
+    ts: wasi_types::__wasi_timestamp_t,
+    now: bool,
+) -> Result<Option<SystemTimeSpec>, Errno> {
+    if set && now {
+        Err(Errno::__WASI_ERRNO_INVAL)
+    } else if set {
+        Ok(Some(SystemTimeSpec::Absolute(Duration::from_nanos(ts))))
+    } else if now {
+        Ok(Some(SystemTimeSpec::SymbolicNow))
+    } else {
+        Ok(None)
+    }
+}
+
+#[derive(Debug)]
+pub struct WasiStdin;
+impl WasiStdin {
+    #[inline]
+    fn fd_rights() -> WASIRights {
+        WASIRights::FD_READ | WASIRights::POLL_FD_READWRITE
+    }
+
+    pub fn fd_advise(
+        &mut self,
+        offset: wasi_types::__wasi_filesize_t,
+        len: wasi_types::__wasi_filesize_t,
+        advice: Advice,
+    ) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_allocate(
+        &mut self,
+        offset: wasi_types::__wasi_filesize_t,
+        len: wasi_types::__wasi_filesize_t,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_datasync(&mut self) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_sync(&mut self) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_fdstat_get(&mut self) -> Result<FdStat, Errno> {
+        Ok(FdStat {
+            filetype: FileType::CHARACTER_DEVICE,
+            fs_rights_base: Self::fd_rights(),
+            fs_rights_inheriting: WASIRights::empty(),
+            flags: FdFlags::empty(),
+        })
+    }
+
+    pub fn fd_fdstat_set_flags(&mut self, flags: FdFlags) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_fdstat_set_rights(
+        &mut self,
+        fs_rights_base: WASIRights,
+        _fs_rights_inheriting: WASIRights,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno> {
+        Ok(Filestat {
+            filetype: FileType::CHARACTER_DEVICE,
+            nlink: 0,
+            inode: 0,
+            size: 0,
+            atim: None,
+            mtim: None,
+            ctim: None,
+        })
+    }
+
+    pub fn fd_filestat_set_size(
+        &mut self,
+        size: wasi_types::__wasi_filesize_t,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_filestat_set_times(
+        &mut self,
+        atim: wasi_types::__wasi_timestamp_t,
+        mtim: wasi_types::__wasi_timestamp_t,
+        fst_flags: wasi_types::__wasi_fstflags_t::Type,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_read(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> Result<usize, Errno> {
+        Ok(std::io::stdin().read_vectored(bufs)?)
+    }
+
+    pub fn fd_pread(
+        &mut self,
+        bufs: &[io::IoSliceMut<'_>],
+        offset: wasi_types::__wasi_filesize_t,
+    ) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+
+    pub fn fd_write(&mut self, bufs: &[io::IoSlice<'_>]) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_pwrite(
+        &mut self,
+        bufs: &[io::IoSlice<'_>],
+        offset: wasi_types::__wasi_filesize_t,
+    ) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_seek(
+        &mut self,
+        offset: wasi_types::__wasi_filedelta_t,
+        whence: wasi_types::__wasi_whence_t::Type,
+    ) -> Result<wasi_types::__wasi_filesize_t, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+
+    pub fn fd_tell(&mut self) -> Result<wasi_types::__wasi_filesize_t, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+}
+
+#[derive(Debug)]
+pub struct WasiStdout;
+impl WasiStdout {
+    #[inline]
+    fn fd_rights() -> WASIRights {
+        WASIRights::FD_WRITE | WASIRights::POLL_FD_READWRITE
+    }
+
+    pub fn fd_advise(
+        &mut self,
+        offset: wasi_types::__wasi_filesize_t,
+        len: wasi_types::__wasi_filesize_t,
+        advice: Advice,
+    ) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_allocate(
+        &mut self,
+        offset: wasi_types::__wasi_filesize_t,
+        len: wasi_types::__wasi_filesize_t,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_datasync(&mut self) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_sync(&mut self) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_fdstat_get(&mut self) -> Result<FdStat, Errno> {
+        Ok(FdStat {
+            filetype: FileType::CHARACTER_DEVICE,
+            fs_rights_base: Self::fd_rights(),
+            fs_rights_inheriting: WASIRights::empty(),
+            flags: FdFlags::APPEND,
+        })
+    }
+
+    pub fn fd_fdstat_set_flags(&mut self, flags: FdFlags) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_fdstat_set_rights(
+        &mut self,
+        fs_rights_base: WASIRights,
+        _fs_rights_inheriting: WASIRights,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno> {
+        Ok(Filestat {
+            filetype: FileType::CHARACTER_DEVICE,
+            nlink: 0,
+            inode: 0,
+            size: 0,
+            atim: None,
+            mtim: None,
+            ctim: None,
+        })
+    }
+
+    pub fn fd_filestat_set_size(
+        &mut self,
+        size: wasi_types::__wasi_filesize_t,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_filestat_set_times(
+        &mut self,
+        atim: wasi_types::__wasi_timestamp_t,
+        mtim: wasi_types::__wasi_timestamp_t,
+        fst_flags: wasi_types::__wasi_fstflags_t::Type,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_read(&mut self, bufs: &[io::IoSliceMut<'_>]) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_pread(
+        &mut self,
+        bufs: &[io::IoSliceMut<'_>],
+        offset: wasi_types::__wasi_filesize_t,
+    ) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_write(&mut self, bufs: &[io::IoSlice<'_>]) -> Result<usize, Errno> {
+        Ok(std::io::stdout().write_vectored(bufs)?)
+    }
+
+    pub fn fd_pwrite(
+        &mut self,
+        bufs: &[io::IoSlice<'_>],
+        offset: wasi_types::__wasi_filesize_t,
+    ) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+
+    pub fn fd_seek(
+        &mut self,
+        offset: wasi_types::__wasi_filedelta_t,
+        whence: wasi_types::__wasi_whence_t::Type,
+    ) -> Result<wasi_types::__wasi_filesize_t, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+
+    pub fn fd_tell(&mut self) -> Result<wasi_types::__wasi_filesize_t, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+}
+
+#[derive(Debug)]
+pub struct WasiStderr;
+impl WasiStderr {
+    #[inline]
+    fn fd_rights() -> WASIRights {
+        WASIRights::FD_WRITE | WASIRights::POLL_FD_READWRITE
+    }
+
+    pub fn fd_advise(
+        &mut self,
+        offset: wasi_types::__wasi_filesize_t,
+        len: wasi_types::__wasi_filesize_t,
+        advice: Advice,
+    ) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_allocate(
+        &mut self,
+        offset: wasi_types::__wasi_filesize_t,
+        len: wasi_types::__wasi_filesize_t,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_datasync(&mut self) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_sync(&mut self) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_fdstat_get(&mut self) -> Result<FdStat, Errno> {
+        Ok(FdStat {
+            filetype: FileType::CHARACTER_DEVICE,
+            fs_rights_base: Self::fd_rights(),
+            fs_rights_inheriting: WASIRights::empty(),
+            flags: FdFlags::APPEND,
+        })
+    }
+
+    pub fn fd_fdstat_set_flags(&mut self, flags: FdFlags) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_fdstat_set_rights(
+        &mut self,
+        fs_rights_base: WASIRights,
+        _fs_rights_inheriting: WASIRights,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno> {
+        Ok(Filestat {
+            filetype: FileType::CHARACTER_DEVICE,
+            nlink: 0,
+            inode: 0,
+            size: 0,
+            atim: None,
+            mtim: None,
+            ctim: None,
+        })
+    }
+
+    pub fn fd_filestat_set_size(
+        &mut self,
+        size: wasi_types::__wasi_filesize_t,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_filestat_set_times(
+        &mut self,
+        atim: wasi_types::__wasi_timestamp_t,
+        mtim: wasi_types::__wasi_timestamp_t,
+        fst_flags: wasi_types::__wasi_fstflags_t::Type,
+    ) -> Result<(), Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_read(&mut self, bufs: &[io::IoSliceMut<'_>]) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_pread(
+        &mut self,
+        bufs: &[io::IoSliceMut<'_>],
+        offset: wasi_types::__wasi_filesize_t,
+    ) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+
+    pub fn fd_write(&mut self, bufs: &[io::IoSlice<'_>]) -> Result<usize, Errno> {
+        Ok(std::io::stderr().write_vectored(bufs)?)
+    }
+
+    pub fn fd_pwrite(
+        &mut self,
+        bufs: &[io::IoSlice<'_>],
+        offset: wasi_types::__wasi_filesize_t,
+    ) -> Result<usize, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+
+    pub fn fd_seek(
+        &mut self,
+        offset: wasi_types::__wasi_filedelta_t,
+        whence: wasi_types::__wasi_whence_t::Type,
+    ) -> Result<wasi_types::__wasi_filesize_t, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+
+    pub fn fd_tell(&mut self) -> Result<wasi_types::__wasi_filesize_t, Errno> {
+        Err(Errno::__WASI_ERRNO_SPIPE)
+    }
+}
+
+#[derive(Debug)]
+pub struct WasiFile {
+    pub fd: fs::File,
+    pub flags: FdFlags,
+    pub right: WASIRights,
+}
+
+impl WasiFile {
+    pub fn fd_advise(
+        &mut self,
+        offset: wasi_types::__wasi_filesize_t,
+        len: wasi_types::__wasi_filesize_t,
+        advice: Advice,
+    ) -> Result<(), Errno> {
+        Ok(())
+    }
+
+    pub fn fd_allocate(
+        &mut self,
+        offset: wasi_types::__wasi_filesize_t,
+        len: wasi_types::__wasi_filesize_t,
+    ) -> Result<(), Errno> {
+        self.right.can(WASIRights::FD_ALLOCATE)?;
+        let f = &mut self.fd;
+        let metadata = f.metadata()?;
+        let file_len = metadata.len();
+        let new_len = offset + len;
+        if new_len > file_len {
+            let old_seek = f.stream_position()?;
+            f.set_len(new_len)?;
+            f.seek(io::SeekFrom::Start(old_seek))?;
+        }
+        Ok(())
+    }
+
+    pub fn fd_datasync(&mut self) -> Result<(), Errno> {
+        self.right.can(WASIRights::FD_DATASYNC)?;
+        self.fd.sync_data()?;
+        Ok(())
+    }
+
+    pub fn fd_sync(&mut self) -> Result<(), Errno> {
+        self.right.can(WASIRights::FD_SYNC)?;
+        self.fd.sync_all()?;
+        Ok(())
+    }
+
+    pub fn fd_fdstat_get(&mut self) -> Result<FdStat, Errno> {
+        let meta = self.fd.metadata()?;
+        let fd_flags = FdStat {
+            filetype: if meta.is_symlink() {
+                FileType::SYMBOLIC_LINK
+            } else {
+                FileType::REGULAR_FILE
+            },
+            fs_rights_base: self.right.clone(),
+            fs_rights_inheriting: WASIRights::empty(),
+            flags: self.flags.clone(),
+        };
+        Ok(fd_flags)
+    }
+
+    pub fn fd_fdstat_set_flags(&mut self, flags: FdFlags) -> Result<(), Errno> {
+        self.right.can(WASIRights::FD_FDSTAT_SET_FLAGS)?;
+        if flags.contains(FdFlags::NONBLOCK)
+            && flags.intersects(FdFlags::DSYNC | FdFlags::SYNC | FdFlags::RSYNC)
+        {
+            return Err(Errno::__WASI_ERRNO_INVAL);
+        }
+        if flags.contains(FdFlags::APPEND) {
+            return Err(Errno::__WASI_ERRNO_NOSYS);
+        }
+        self.flags = flags;
+        Ok(())
+    }
+
+    pub fn fd_fdstat_set_rights(
+        &mut self,
+        fs_rights_base: WASIRights,
+        _fs_rights_inheriting: WASIRights,
+    ) -> Result<(), Errno> {
+        self.right.can(fs_rights_base.clone())?;
+        self.right = fs_rights_base;
+        Ok(())
+    }
+
+    pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno> {
+        self.right.can(WASIRights::FD_FILESTAT_GET)?;
+        let meta = self.fd.metadata()?;
+        let filetype = if meta.is_symlink() {
+            FileType::SYMBOLIC_LINK
+        } else {
+            FileType::REGULAR_FILE
+        };
+
+        let nlink = get_file_nlink(&meta);
+        let inode = get_file_ino(&meta);
+
+        Ok(Filestat {
+            filetype,
+            nlink,
+            inode,
+            size: meta.len(),
+            atim: meta.accessed().ok(),
+            mtim: meta.modified().ok(),
+            ctim: meta.created().ok(),
+        })
+    }
+
+    pub fn fd_filestat_set_size(
+        &mut self,
+        size: wasi_types::__wasi_filesize_t,
+    ) -> Result<(), Errno> {
+        self.right.can(WASIRights::FD_FILESTAT_SET_SIZE)?;
+        self.fd.set_len(size)?;
+        Ok(())
+    }
+
+    pub fn fd_filestat_set_times(
+        &mut self,
+        atim: wasi_types::__wasi_timestamp_t,
+        mtim: wasi_types::__wasi_timestamp_t,
+        fst_flags: wasi_types::__wasi_fstflags_t::Type,
+    ) -> Result<(), Errno> {
+        use wasi_types::__wasi_fstflags_t;
+
+        self.right.can(WASIRights::FD_FILESTAT_SET_TIMES)?;
+
+        let set_atim = (fst_flags & __wasi_fstflags_t::__WASI_FSTFLAGS_ATIM) > 0;
+        let set_atim_now = (fst_flags & __wasi_fstflags_t::__WASI_FSTFLAGS_ATIM_NOW) > 0;
+        let set_mtim = (fst_flags & __wasi_fstflags_t::__WASI_FSTFLAGS_MTIM) > 0;
+        let set_mtim_now = (fst_flags & __wasi_fstflags_t::__WASI_FSTFLAGS_MTIM_NOW) > 0;
+
+        let atim = systimespec(set_atim, atim, set_atim_now)?;
+        let mtim = systimespec(set_mtim, mtim, set_mtim_now)?;
+
+        #[cfg(unix)]
+        {
+            use std::os::unix::prelude::AsRawFd;
+            let fd = self.fd.as_raw_fd();
+            let times = [
+                {
+                    match atim {
+                        Some(SystemTimeSpec::Absolute(atim)) => libc::timespec {
+                            tv_sec: atim.as_secs() as i64,
+                            tv_nsec: atim.subsec_nanos() as i64,
+                        },
+                        Some(SystemTimeSpec::SymbolicNow) => libc::timespec {
+                            tv_sec: 0,
+                            tv_nsec: libc::UTIME_NOW,
+                        },
+                        None => libc::timespec {
+                            tv_sec: 0,
+                            tv_nsec: libc::UTIME_OMIT,
+                        },
+                    }
+                },
+                {
+                    match mtim {
+                        Some(SystemTimeSpec::Absolute(mtim)) => libc::timespec {
+                            tv_sec: mtim.as_secs() as i64,
+                            tv_nsec: mtim.subsec_nanos() as i64,
+                        },
+                        Some(SystemTimeSpec::SymbolicNow) => libc::timespec {
+                            tv_sec: 0,
+                            tv_nsec: libc::UTIME_NOW,
+                        },
+                        None => libc::timespec {
+                            tv_sec: 0,
+                            tv_nsec: libc::UTIME_OMIT,
+                        },
+                    }
+                },
+            ];
+            if unsafe { libc::futimens(fd, times.as_ptr()) } < 0 {
+                Err(std::io::Error::last_os_error())?;
+            }
+            Ok(())
+        }
+        #[cfg(not(unix))]
+        {
+            Err(Errno::__WASI_ERRNO_NOSYS)
+        }
+    }
+
+    pub fn fd_read(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> Result<usize, Errno> {
+        self.right.can(WASIRights::FD_READ)?;
+        Ok(self.fd.read_vectored(bufs)?)
+    }
+
+    pub fn fd_pread(
+        &mut self,
+        bufs: &mut [io::IoSliceMut<'_>],
+        offset: wasi_types::__wasi_filesize_t,
+    ) -> Result<usize, Errno> {
+        use std::io::SeekFrom;
+
+        self.right.can(WASIRights::FD_READ | WASIRights::FD_SEEK)?;
+
+        let old_seek = self.fd.stream_position()?;
+        let r = self.fd.read_vectored(bufs);
+        self.fd.seek(SeekFrom::Start(old_seek))?;
+        Ok(r?)
+    }
+
+    pub fn fd_write(&mut self, bufs: &[io::IoSlice<'_>]) -> Result<usize, Errno> {
+        self.right.can(WASIRights::FD_WRITE)?;
+        Ok(self.fd.write_vectored(bufs)?)
+    }
+
+    pub fn fd_pwrite(
+        &mut self,
+        bufs: &[io::IoSlice<'_>],
+        offset: wasi_types::__wasi_filesize_t,
+    ) -> Result<usize, Errno> {
+        use std::io::SeekFrom;
+
+        self.right.can(WASIRights::FD_WRITE | WASIRights::FD_SEEK)?;
+
+        let old_seek = self.fd.stream_position()?;
+        let r = self.fd.write_vectored(bufs);
+        self.fd.seek(SeekFrom::Start(old_seek))?;
+        Ok(r?)
+    }
+
+    pub fn fd_seek(
+        &mut self,
+        offset: wasi_types::__wasi_filedelta_t,
+        whence: wasi_types::__wasi_whence_t::Type,
+    ) -> Result<wasi_types::__wasi_filesize_t, Errno> {
+        use std::io::SeekFrom;
+
+        let required_rigth =
+            if offset == 0 && whence == wasi_types::__wasi_whence_t::__WASI_WHENCE_CUR {
+                WASIRights::FD_TELL
+            } else {
+                WASIRights::FD_TELL | WASIRights::FD_SEEK
+            };
+
+        self.right.can(required_rigth)?;
+
+        let pos = match whence {
+            wasi_types::__wasi_whence_t::__WASI_WHENCE_CUR => SeekFrom::Current(offset),
+            wasi_types::__wasi_whence_t::__WASI_WHENCE_END => SeekFrom::End(offset),
+            wasi_types::__wasi_whence_t::__WASI_WHENCE_SET => SeekFrom::Start(offset as u64),
+            _ => return Err(Errno::__WASI_ERRNO_INVAL),
+        };
+
+        Ok(self.fd.seek(pos)?)
+    }
+
+    pub fn fd_tell(&mut self) -> Result<wasi_types::__wasi_filesize_t, Errno> {
+        use std::io::SeekFrom;
+        self.right.can(WASIRights::FD_TELL)?;
+        Ok(self.fd.stream_position()?)
+    }
+}
+
+#[derive(Debug)]
+pub struct WasiPreOpenDir {
+    pub guest_path: PathBuf,
+    wasidir: WasiDir,
+}
+
+impl Deref for WasiPreOpenDir {
+    type Target = WasiDir;
+    fn deref(&self) -> &Self::Target {
+        &self.wasidir
+    }
+}
+
+impl DerefMut for WasiPreOpenDir {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut self.wasidir
+    }
+}
+
+impl WasiPreOpenDir {
+    pub fn new(host_path: PathBuf, guest_path: PathBuf) -> Self {
+        WasiPreOpenDir {
+            guest_path,
+            wasidir: WasiDir {
+                real_path: host_path,
+                dir_rights: WASIRights::dir_all(),
+                file_rights: WASIRights::fd_all(),
+            },
+        }
+    }
+
+    pub fn get_absolutize_path<P: AsRef<Path>>(&self, sub_path: &P) -> Result<PathBuf, Errno> {
+        use path_absolutize::*;
+        let new_path = self.real_path.join(sub_path);
+        let absolutize = new_path
+            .absolutize_virtually(&self.real_path)
+            .or(Err(Errno::__WASI_ERRNO_NOENT))?;
+        Ok(absolutize.to_path_buf())
+    }
+
+    pub fn path_open_file<P: AsRef<Path>>(
+        &mut self,
+        path: &P,
+        oflags: OFlags,
+        fs_rights_base: WASIRights,
+        fdflags: FdFlags,
+    ) -> Result<WasiFile, Errno> {
+        let mut required_rights = WASIRights::PATH_OPEN;
+        if oflags.contains(OFlags::CREATE) {
+            required_rights |= WASIRights::PATH_CREATE_FILE;
+        }
+        self.dir_rights.can(required_rights)?;
+
+        let path = self.get_absolutize_path(path)?;
+
+        let read = fs_rights_base.contains(WASIRights::FD_READ);
+        let write = fs_rights_base.contains(WASIRights::FD_WRITE)
+            || fs_rights_base.contains(WASIRights::FD_ALLOCATE)
+            || fs_rights_base.contains(WASIRights::FD_FILESTAT_SET_SIZE);
+
+        let mut opts = fs::OpenOptions::new();
+        if oflags.contains(OFlags::CREATE | OFlags::EXCLUSIVE) {
+            opts.create_new(true);
+            opts.write(true);
+        } else if oflags.contains(OFlags::CREATE) {
+            opts.create(true);
+            opts.write(true);
+        }
+
+        if oflags.contains(OFlags::TRUNCATE) {
+            opts.truncate(true);
+        }
+        if read {
+            opts.read(true);
+        }
+
+        if write {
+            opts.write(true);
+        } else {
+            opts.read(true);
+        }
+
+        if fdflags.contains(FdFlags::APPEND) {
+            opts.append(true);
+        }
+
+        if fdflags.intersects(FdFlags::DSYNC | FdFlags::SYNC | FdFlags::RSYNC) {
+            return Err(Errno::__WASI_ERRNO_NOSYS);
+        }
+
+        let fd = opts.open(path)?;
+
+        Ok(WasiFile {
+            fd,
+            flags: fdflags,
+            right: fs_rights_base,
+        })
+    }
+
+    pub fn path_open_dir<P: AsRef<Path>>(
+        &mut self,
+        path: &P,
+        oflags: OFlags,
+        fs_rights_base: WASIRights,
+        fs_rights_inheriting: WASIRights,
+        fdflags: FdFlags,
+    ) -> Result<WasiDir, Errno> {
+        let path = self.get_absolutize_path(path)?;
+
+        if oflags.contains(OFlags::CREATE)
+            || oflags.contains(OFlags::EXCLUSIVE)
+            || oflags.contains(OFlags::TRUNCATE)
+        {
+            return Err(Errno::__WASI_ERRNO_INVAL);
+        }
+
+        let dir_rights = self.dir_rights.clone() & fs_rights_base;
+        let file_rights = self.file_rights.clone() & fs_rights_inheriting;
+        let meta = fs::metadata(&path)?;
+        if !meta.is_dir() {
+            return Err(Errno::__WASI_ERRNO_NOTDIR);
+        }
+
+        Ok(WasiDir {
+            real_path: path,
+            dir_rights,
+            file_rights,
+        })
+    }
+
+    pub fn path_create_directory(&self, path: &str) -> Result<(), Errno> {
+        self.dir_rights.can(WASIRights::PATH_CREATE_DIRECTORY)?;
+        let new_path = self.get_absolutize_path(&path)?;
+        fs::DirBuilder::new().recursive(true).create(new_path)?;
+        Ok(())
+    }
+
+    pub fn path_remove_directory(&self, path: &str) -> Result<(), Errno> {
+        self.dir_rights.can(WASIRights::PATH_REMOVE_DIRECTORY)?;
+        let new_path = self.get_absolutize_path(&path)?;
+        fs::remove_dir(path)?;
+        Ok(())
+    }
+
+    pub fn path_unlink_file(&self, path: &str) -> Result<(), Errno> {
+        self.dir_rights.can(WASIRights::PATH_REMOVE_DIRECTORY)?;
+        let new_path = self.get_absolutize_path(&path)?;
+        fs::remove_file(new_path)?;
+        Ok(())
+    }
+
+    pub fn path_filestat_get(&self, path: &str, follow_symlinks: bool) -> Result<Filestat, Errno> {
+        self.dir_rights.can(WASIRights::PATH_FILESTAT_GET)?;
+        let new_path = self.get_absolutize_path(&path)?;
+
+        let meta = if follow_symlinks {
+            fs::metadata(new_path)?
+        } else {
+            fs::symlink_metadata(new_path)?
+        };
+
+        let filetype = if meta.is_symlink() {
+            FileType::SYMBOLIC_LINK
+        } else if meta.is_dir() {
+            FileType::DIRECTORY
+        } else {
+            FileType::REGULAR_FILE
+        };
+
+        let nlink = get_file_nlink(&meta);
+        let inode = get_file_ino(&meta);
+
+        Ok(Filestat {
+            filetype,
+            inode,
+            nlink,
+            size: meta.len(),
+            atim: meta.accessed().ok(),
+            mtim: meta.modified().ok(),
+            ctim: meta.created().ok(),
+        })
+    }
+}
+
+#[derive(Debug)]
+pub struct WasiDir {
+    // absolutize
+    pub real_path: PathBuf,
+    pub dir_rights: WASIRights,
+    pub file_rights: WASIRights,
+}
+
+fn get_file_ino(metadata: &fs::Metadata) -> u64 {
+    #[cfg(unix)]
+    {
+        use std::os::unix::prelude::MetadataExt;
+        metadata.ino()
+    }
+    #[cfg(not(unix))]
+    {
+        0
+    }
+}
+
+fn get_file_nlink(metadata: &fs::Metadata) -> u64 {
+    #[cfg(unix)]
+    {
+        use std::os::unix::prelude::MetadataExt;
+        metadata.nlink()
+    }
+    #[cfg(not(unix))]
+    {
+        1
+    }
+}
+
+fn write_dirent(entity: &ReaddirEntity, write_buf: &mut [u8]) -> usize {
+    unsafe {
+        use wasi_types::__wasi_dirent_t;
+        const __wasi_dirent_t_size: usize = std::mem::size_of::<__wasi_dirent_t>();
+        let ent = __wasi_dirent_t::from(entity);
+        let ent_bytes_ptr = (&ent) as *const __wasi_dirent_t;
+        let ent_bytes =
+            std::slice::from_raw_parts(ent_bytes_ptr as *const u8, __wasi_dirent_t_size);
+        let dirent_copy_len = write_buf.len().min(__wasi_dirent_t_size);
+        write_buf[..dirent_copy_len].copy_from_slice(&ent_bytes[..dirent_copy_len]);
+        if dirent_copy_len < __wasi_dirent_t_size {
+            return dirent_copy_len;
+        }
+
+        let name_bytes = entity.name.as_bytes();
+        let name_len = name_bytes.len();
+        let name_copy_len = (write_buf.len() - dirent_copy_len).min(name_len);
+        write_buf[dirent_copy_len..dirent_copy_len + name_copy_len]
+            .copy_from_slice(&name_bytes[..name_copy_len]);
+
+        dirent_copy_len + name_copy_len
+    }
+}
+
+impl WasiDir {
+    fn metadata(&self) -> io::Result<fs::Metadata> {
+        fs::metadata(&self.real_path)
+    }
+
+    pub fn fd_readdir(&self, mut cursor: usize, write_buf: &mut [u8]) -> Result<usize, Errno> {
+        self.dir_rights.can(WASIRights::FD_READDIR)?;
+        let dir_meta = self.metadata()?;
+        let dir_ino = get_file_ino(&dir_meta);
+
+        let buflen = write_buf.len();
+
+        let mut bufused = 0;
+        let mut next = cursor as u64;
+
+        if cursor == 0 {
+            next += 1;
+            let entity = ReaddirEntity {
+                next,
+                inode: dir_ino,
+                name: ".".to_string(),
+                filetype: FileType::DIRECTORY,
+            };
+
+            let n = write_dirent(&entity, &mut write_buf[bufused..]);
+            bufused += n;
+            if bufused == buflen {
+                return Ok(bufused);
+            }
+        }
+        if cursor <= 1 {
+            next += 1;
+            let entity = ReaddirEntity {
+                next,
+                inode: dir_ino,
+                name: "..".to_string(),
+                filetype: FileType::DIRECTORY,
+            };
+            let n = write_dirent(&entity, &mut write_buf[bufused..]);
+            bufused += n;
+            if bufused == buflen {
+                return Ok(bufused);
+            }
+        }
+
+        if cursor >= 2 {
+            cursor -= 2;
+        } else {
+            cursor = 0;
+        }
+
+        let read_dir = self.real_path.read_dir()?;
+        for dir_entity in read_dir.into_iter().skip(cursor) {
+            next += 1;
+
+            let dir_entity = dir_entity?;
+            let name = dir_entity
+                .file_name()
+                .into_string()
+                .map_err(|_| Errno::__WASI_ERRNO_ILSEQ)?;
+            let metadata = dir_entity.metadata()?;
+            let inode = get_file_ino(&metadata);
+
+            let filetype = if metadata.is_dir() {
+                FileType::DIRECTORY
+            } else if metadata.is_symlink() {
+                FileType::SYMBOLIC_LINK
+            } else {
+                FileType::REGULAR_FILE
+            };
+
+            let entity = ReaddirEntity {
+                next,
+                inode,
+                name,
+                filetype,
+            };
+
+            let n = write_dirent(&entity, &mut write_buf[bufused..]);
+            bufused += n;
+            if bufused == buflen {
+                return Ok(bufused);
+            }
+        }
+
+        Ok(bufused)
+    }
+
+    pub fn fd_fdstat_get(&self) -> Result<FdStat, Errno> {
+        Ok(FdStat {
+            filetype: FileType::DIRECTORY,
+            fs_rights_base: self.dir_rights.clone(),
+            fs_rights_inheriting: self.file_rights.clone(),
+            flags: FdFlags::empty(),
+        })
+    }
+
+    pub fn fd_fdstat_set_rights(
+        &mut self,
+        fs_rights_base: WASIRights,
+        fs_rights_inheriting: WASIRights,
+    ) -> Result<(), Errno> {
+        self.dir_rights.can(fs_rights_base.clone())?;
+        self.file_rights.can(fs_rights_inheriting.clone())?;
+
+        self.dir_rights = fs_rights_base;
+        self.file_rights = fs_rights_inheriting;
+
+        Ok(())
+    }
+
+    pub fn fd_filestat_get(&mut self) -> Result<Filestat, Errno> {
+        self.dir_rights.can(WASIRights::FD_FILESTAT_GET)?;
+        let meta = self.metadata()?;
+        let filetype = if meta.is_symlink() {
+            FileType::SYMBOLIC_LINK
+        } else {
+            FileType::DIRECTORY
+        };
+
+        let nlink = get_file_nlink(&meta);
+        let inode = get_file_ino(&meta);
+
+        Ok(Filestat {
+            filetype,
+            nlink,
+            inode,
+            size: meta.len(),
+            atim: meta.accessed().ok(),
+            mtim: meta.modified().ok(),
+            ctim: meta.created().ok(),
+        })
+    }
+
+    pub fn fd_filestat_set_times(
+        &mut self,
+        atim: wasi_types::__wasi_timestamp_t,
+        mtim: wasi_types::__wasi_timestamp_t,
+        fst_flags: wasi_types::__wasi_fstflags_t::Type,
+    ) -> Result<(), Errno> {
+        use wasi_types::__wasi_fstflags_t;
+        self.dir_rights.can(WASIRights::FD_FILESTAT_SET_TIMES)?;
+        Err(Errno::__WASI_ERRNO_NOSYS)
+    }
+}
+
+#[derive(Debug)]
+pub enum INode {
+    PreOpenDir(WasiPreOpenDir),
+    Dir(WasiDir),
+    File(WasiFile),
+    Stdin(WasiStdin),
+    Stdout(WasiStdout),
+    Stderr(WasiStderr),
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/env.rs.html b/src/async_wasi/snapshots/env.rs.html new file mode 100644 index 000000000..c45ec4fe9 --- /dev/null +++ b/src/async_wasi/snapshots/env.rs.html @@ -0,0 +1,55 @@ +env.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
pub use super::common::{error::Errno, types as wasi_types, vfs};
+
+#[cfg(all(unix, feature = "async_tokio"))]
+pub use super::common::net::async_tokio::AsyncWasiSocket;
+
+#[derive(Debug)]
+pub enum VFD {
+    Closed,
+    Inode(vfs::INode),
+    #[cfg(all(unix, feature = "async_tokio"))]
+    AsyncSocket(AsyncWasiSocket),
+}
+
+impl VFD {
+    #[cfg(all(unix, feature = "async_tokio"))]
+    pub fn is_socket(&self) -> bool {
+        matches!(self, VFD::AsyncSocket(_))
+    }
+
+    pub fn is_inode(&self) -> bool {
+        matches!(self, VFD::Inode(_))
+    }
+}
+
+pub trait AsyncVM: Send + Sync {
+    fn yield_now(&mut self) -> Result<(), Errno>;
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/mod.rs.html b/src/async_wasi/snapshots/mod.rs.html new file mode 100644 index 000000000..76a394389 --- /dev/null +++ b/src/async_wasi/snapshots/mod.rs.html @@ -0,0 +1,1475 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+
pub mod common;
+pub mod env;
+pub mod preview_1;
+
+use crate::object_pool::ObjectPool;
+use common::error::Errno;
+use env::{wasi_types::__wasi_fd_t, VFD};
+use std::path::PathBuf;
+
+use parking_lot::RwLock;
+use std::sync::Arc;
+
+#[derive(Debug, Clone)]
+pub struct WasiCtx {
+    pub args: Vec<String>,
+    envs: Vec<String>,
+    vfs: Arc<RwLock<ObjectPool<VFD>>>,
+    closed: Option<__wasi_fd_t>,
+    vfs_preopen_limit: usize,
+    #[cfg(feature = "serialize")]
+    pub io_state: serialize::IoState,
+    pub exit_code: u32,
+}
+impl Default for WasiCtx {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+impl WasiCtx {
+    pub fn new() -> Self {
+        let wasi_stdin = VFD::Inode(env::vfs::INode::Stdin(env::vfs::WasiStdin));
+        let wasi_stdout = VFD::Inode(env::vfs::INode::Stdout(env::vfs::WasiStdout));
+        let wasi_stderr = VFD::Inode(env::vfs::INode::Stderr(env::vfs::WasiStderr));
+        let mut vfs = ObjectPool::new();
+        vfs.push(wasi_stdin);
+        vfs.push(wasi_stdout);
+        vfs.push(wasi_stderr);
+
+        WasiCtx {
+            args: vec![],
+            envs: vec![],
+            vfs: Arc::new(RwLock::new(vfs)),
+            vfs_preopen_limit: 2,
+            closed: None,
+            #[cfg(feature = "serialize")]
+            io_state: serialize::IoState::Empty,
+            exit_code: 0,
+        }
+    }
+
+    pub fn push_preopen(&mut self, host_path: PathBuf, guest_path: PathBuf) {
+        let preopen = env::vfs::WasiPreOpenDir::new(host_path, guest_path);
+        self.vfs
+            .write()
+            .push(VFD::Inode(env::vfs::INode::PreOpenDir(preopen)));
+        self.vfs_preopen_limit += 1;
+    }
+
+    pub fn push_arg(&mut self, arg: String) {
+        self.args.push(arg);
+    }
+
+    pub fn push_args(&mut self, args: Vec<String>) {
+        self.args.extend(args);
+    }
+
+    /// The format of the `env` argument should be "KEY=VALUE"
+    pub fn push_env(&mut self, env: String) {
+        self.envs.push(env);
+    }
+
+    pub fn push_envs(&mut self, envs: Vec<String>) {
+        self.envs.extend(envs);
+    }
+
+    fn remove_closed(&mut self) {
+        if let Some(closed) = self.closed.take() {
+            let _ = self.remove_vfd(closed);
+        };
+    }
+
+    pub fn get_mut_vfd(&mut self, fd: __wasi_fd_t) -> Result<&mut env::VFD, Errno> {
+        if fd < 0 {
+            Err(Errno::__WASI_ERRNO_BADF)
+        } else {
+            self.remove_closed();
+
+            let vfd = unsafe {
+                (*self.vfs.data_ptr())
+                    .get_mut(fd as usize)
+                    .ok_or(Errno::__WASI_ERRNO_BADF)?
+            };
+            if let VFD::Closed = vfd {
+                let _ = self.closed.insert(fd);
+                return Err(Errno::__WASI_ERRNO_BADF);
+            }
+            Ok(vfd)
+        }
+    }
+
+    pub fn get_vfd(&self, fd: __wasi_fd_t) -> Result<&env::VFD, Errno> {
+        if fd < 0 {
+            Err(Errno::__WASI_ERRNO_BADF)
+        } else {
+            let vfd = unsafe {
+                (*self.vfs.data_ptr())
+                    .get(fd as usize)
+                    .ok_or(Errno::__WASI_ERRNO_BADF)?
+            };
+            if let VFD::Closed = vfd {
+                return Err(Errno::__WASI_ERRNO_BADF);
+            }
+            Ok(vfd)
+        }
+    }
+
+    pub fn insert_vfd(&mut self, vfd: VFD) -> Result<__wasi_fd_t, Errno> {
+        let i = self.vfs.write().push(vfd);
+
+        Ok(i.0 as __wasi_fd_t)
+    }
+
+    pub fn remove_vfd(&mut self, fd: __wasi_fd_t) -> Result<(), Errno> {
+        if fd <= self.vfs_preopen_limit as i32 {
+            return Err(Errno::__WASI_ERRNO_NOTSUP);
+        }
+
+        self.vfs.write().remove(fd as usize);
+
+        Ok(())
+    }
+
+    pub fn renumber_vfd(&mut self, from: __wasi_fd_t, to: __wasi_fd_t) -> Result<(), Errno> {
+        if from < 0 || to < 0 {
+            return Err(Errno::__WASI_ERRNO_BADF);
+        }
+
+        let to = to as usize;
+        let from = from as usize;
+
+        if from <= self.vfs_preopen_limit || to <= self.vfs_preopen_limit {
+            return Err(Errno::__WASI_ERRNO_NOTSUP);
+        };
+
+        let _ = self.vfs.read().get(to).ok_or(Errno::__WASI_ERRNO_BADF)?;
+
+        let from_entry = self
+            .vfs
+            .write()
+            .remove(from)
+            .ok_or(Errno::__WASI_ERRNO_BADF)?;
+
+        let mut vfs = self.vfs.write();
+        let to_entry = vfs.get_mut(to).ok_or(Errno::__WASI_ERRNO_BADF)?;
+
+        *to_entry = from_entry;
+
+        Ok(())
+    }
+}
+
+unsafe impl Send for WasiCtx {}
+unsafe impl Sync for WasiCtx {}
+
+#[cfg(test)]
+mod vfs_test {
+    use super::{env::*, *};
+    use std::path::PathBuf;
+
+    #[test]
+    fn vfd_opt() {
+        // [0,1,2]
+        let mut ctx = WasiCtx::new();
+        // [0,1,2,3(*)]
+        ctx.push_preopen(PathBuf::from("."), PathBuf::from("."));
+
+        assert_eq!(ctx.vfs_preopen_limit, 3, "vfs_preopen_limit");
+
+        fn vfd_stub() -> VFD {
+            VFD::Inode(vfs::INode::Stdin(vfs::WasiStdin))
+        }
+
+        // [0,1,2,3,4]
+        let fd = ctx.insert_vfd(vfd_stub()).unwrap();
+        assert_eq!(fd, 4);
+
+        // [0,1,2,3,4,5]
+        let fd = ctx.insert_vfd(vfd_stub()).unwrap();
+        assert_eq!(fd, 5);
+
+        // [0,1,2,3,none,5]
+        ctx.remove_vfd(4).unwrap();
+
+        // [0,1,2,3,4,5]
+        let fd = ctx.insert_vfd(vfd_stub()).unwrap();
+        assert_eq!(fd, 4);
+
+        // [0,1,2,3,none,5]
+        ctx.remove_vfd(4).unwrap();
+
+        // [0,1,2,3,none,none]
+        ctx.remove_vfd(5).unwrap();
+
+        // [0,1,2,3,4,none]
+        let fd = ctx.insert_vfd(vfd_stub()).unwrap();
+        assert_eq!(fd, 4);
+
+        // [0,1,2,3,4,5]
+        let fd = ctx.insert_vfd(vfd_stub()).unwrap();
+        assert_eq!(fd, 5);
+
+        // [0,1,2,3,4,5,6]
+        let fd = ctx.insert_vfd(vfd_stub()).unwrap();
+        assert_eq!(fd, 6);
+
+        // [0,1,2,3,4,none,6]
+        ctx.remove_vfd(5).unwrap();
+        // [0,1,2,3,none,none,6]
+        ctx.remove_vfd(4).unwrap();
+
+        // [0,1,2,3,4,none,6]
+        let fd = ctx.insert_vfd(vfd_stub()).unwrap();
+        assert_eq!(fd, 4);
+
+        // [0,1,2,3,4,5,6]
+        let fd = ctx.insert_vfd(vfd_stub()).unwrap();
+        assert_eq!(fd, 5);
+
+        // [0,1,2,3,none,5,6]
+        ctx.remove_vfd(4).unwrap();
+
+        // [0,1,2,3,none,none,6]
+        ctx.remove_vfd(5).unwrap();
+
+        // [0,1,2,3,none,none,none]
+        ctx.remove_vfd(6).unwrap();
+
+        let v = ctx
+            .vfs
+            .read()
+            .iter()
+            .take(7)
+            .map(|f| f.is_some())
+            .collect::<Vec<bool>>();
+
+        assert_eq!(&v, &[true, true, true, true, false, false, false])
+    }
+}
+
+#[cfg(feature = "serialize")]
+pub mod serialize {
+    use super::{
+        common::{
+            net::{
+                async_tokio::AsyncWasiSocket, AddressFamily, ConnectState, SocketType,
+                WasiSocketState,
+            },
+            vfs::{self, INode, WASIRights},
+        },
+        env::vfs::WasiPreOpenDir,
+        VFD,
+    };
+    use crate::object_pool::SerialObjectPool;
+    use parking_lot::RwLock;
+    use serde::{Deserialize, Serialize};
+    use std::{net::SocketAddr, path::PathBuf, sync::Arc, time::SystemTime};
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub enum PollFdState {
+        UdpSocket {
+            fd: i32,
+            socket_type: SerialSocketType,
+            local_addr: Option<SocketAddr>,
+            peer_addr: Option<SocketAddr>,
+            poll_read: bool,
+            poll_write: bool,
+        },
+        TcpListener {
+            fd: i32,
+            socket_type: SerialSocketType,
+            local_addr: Option<SocketAddr>,
+            peer_addr: Option<SocketAddr>,
+            poll_read: bool,
+            poll_write: bool,
+        },
+        TcpStream {
+            fd: i32,
+            socket_type: SerialSocketType,
+            local_addr: Option<SocketAddr>,
+            peer_addr: Option<SocketAddr>,
+            poll_read: bool,
+            poll_write: bool,
+        },
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub enum IoState {
+        Empty,
+        Accept {
+            bind: SocketAddr,
+        },
+        Sleep {
+            ddl: SystemTime,
+        },
+        Poll {
+            fds: Vec<PollFdState>,
+            ddl: Option<SystemTime>,
+        },
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialWasiCtx {
+        pub args: Vec<String>,
+        pub envs: Vec<String>,
+        pub vfs: SerialObjectPool<SerialVFD>,
+        pub vfs_preopen_limit: usize,
+        pub io_state: IoState,
+        pub exit_code: u32,
+    }
+
+    impl From<&super::WasiCtx> for SerialWasiCtx {
+        fn from(ctx: &super::WasiCtx) -> Self {
+            let vfs = SerialObjectPool::from_ref(&ctx.vfs.read(), |fd| SerialVFD::from(fd));
+            Self {
+                args: ctx.args.clone(),
+                envs: ctx.envs.clone(),
+                vfs,
+                vfs_preopen_limit: ctx.vfs_preopen_limit,
+                io_state: ctx.io_state.clone(),
+                exit_code: ctx.exit_code,
+            }
+        }
+    }
+
+    impl SerialWasiCtx {
+        pub fn resume(self, f: impl FnMut(SerialVFD) -> VFD) -> super::WasiCtx {
+            let Self {
+                args,
+                envs,
+                vfs_preopen_limit,
+                io_state,
+                exit_code,
+                vfs,
+            } = self;
+
+            let vfs = vfs.into(f);
+
+            super::WasiCtx {
+                args,
+                envs,
+                vfs: Arc::new(RwLock::new(vfs)),
+                vfs_preopen_limit,
+                closed: None,
+                io_state,
+                exit_code,
+            }
+        }
+    }
+
+    #[derive(Debug, Clone, Copy, Deserialize, Serialize)]
+    pub enum SerialSocketType {
+        TCP4,
+        TCP6,
+        UDP4,
+        UDP6,
+    }
+
+    impl From<(AddressFamily, SocketType)> for SerialSocketType {
+        fn from(sock_type: (AddressFamily, SocketType)) -> Self {
+            match sock_type {
+                (AddressFamily::Inet4, SocketType::Datagram) => SerialSocketType::UDP4,
+                (AddressFamily::Inet4, SocketType::Stream) => SerialSocketType::TCP4,
+                (AddressFamily::Inet6, SocketType::Datagram) => SerialSocketType::UDP6,
+                (AddressFamily::Inet6, SocketType::Stream) => SerialSocketType::TCP6,
+            }
+        }
+    }
+
+    impl From<SerialSocketType> for (AddressFamily, SocketType) {
+        fn from(val: SerialSocketType) -> Self {
+            match val {
+                SerialSocketType::TCP4 => (AddressFamily::Inet4, SocketType::Stream),
+                SerialSocketType::TCP6 => (AddressFamily::Inet6, SocketType::Stream),
+                SerialSocketType::UDP4 => (AddressFamily::Inet4, SocketType::Datagram),
+                SerialSocketType::UDP6 => (AddressFamily::Inet6, SocketType::Datagram),
+            }
+        }
+    }
+
+    #[derive(Debug, Clone, Copy, Deserialize, Serialize)]
+    pub enum SerialConnectState {
+        Empty,
+        Listening,
+        Connected,
+        Connecting,
+    }
+
+    impl From<ConnectState> for SerialConnectState {
+        fn from(s: ConnectState) -> Self {
+            match s {
+                ConnectState::Empty => Self::Empty,
+                ConnectState::Listening => Self::Listening,
+                ConnectState::Connected => Self::Connected,
+                ConnectState::Connecting => Self::Connecting,
+            }
+        }
+    }
+
+    impl From<SerialConnectState> for ConnectState {
+        fn from(val: SerialConnectState) -> Self {
+            match val {
+                SerialConnectState::Empty => ConnectState::Empty,
+                SerialConnectState::Listening => ConnectState::Listening,
+                SerialConnectState::Connected => ConnectState::Connected,
+                SerialConnectState::Connecting => ConnectState::Connecting,
+            }
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialWasiSocketState {
+        pub sock_type: SerialSocketType,
+        pub local_addr: Option<SocketAddr>,
+        pub peer_addr: Option<SocketAddr>,
+        pub bind_device: Vec<u8>,
+        pub backlog: u32,
+        pub nonblocking: bool,
+        pub so_reuseaddr: bool,
+        pub so_conn_state: SerialConnectState,
+        pub so_recv_buf_size: usize,
+        pub so_send_buf_size: usize,
+        pub so_recv_timeout: Option<u64>, // nano_sec
+        pub so_send_timeout: Option<u64>, // nano_sec,
+        pub fs_rights: u64,
+    }
+
+    impl From<&WasiSocketState> for SerialWasiSocketState {
+        fn from(state: &WasiSocketState) -> Self {
+            SerialWasiSocketState {
+                sock_type: state.sock_type.into(),
+                local_addr: state.local_addr,
+                peer_addr: state.peer_addr,
+                bind_device: state.bind_device.clone(),
+                backlog: state.backlog,
+                nonblocking: state.nonblocking,
+                so_reuseaddr: state.so_reuseaddr,
+                so_conn_state: state.so_conn_state.into(),
+                so_recv_buf_size: state.so_recv_buf_size,
+                so_send_buf_size: state.so_send_buf_size,
+                so_recv_timeout: state.so_recv_timeout.map(|d| d.as_nanos() as u64),
+                so_send_timeout: state.so_send_timeout.map(|d| d.as_nanos() as u64),
+                fs_rights: state.fs_rights.bits(),
+            }
+        }
+    }
+
+    impl From<SerialWasiSocketState> for WasiSocketState {
+        fn from(val: SerialWasiSocketState) -> Self {
+            WasiSocketState {
+                sock_type: val.sock_type.into(),
+                local_addr: val.local_addr,
+                peer_addr: val.peer_addr,
+                bind_device: val.bind_device,
+                backlog: val.backlog,
+                shutdown: None,
+                nonblocking: val.nonblocking,
+                so_reuseaddr: val.so_reuseaddr,
+                so_conn_state: val.so_conn_state.into(),
+                so_recv_buf_size: val.so_recv_buf_size,
+                so_send_buf_size: val.so_send_buf_size,
+                so_recv_timeout: val.so_recv_timeout.map(std::time::Duration::from_nanos),
+                so_send_timeout: val.so_send_timeout.map(std::time::Duration::from_nanos),
+                fs_rights: WASIRights::from_bits_truncate(val.fs_rights),
+            }
+        }
+    }
+
+    impl From<&SerialWasiSocketState> for WasiSocketState {
+        fn from(val: &SerialWasiSocketState) -> Self {
+            WasiSocketState {
+                sock_type: val.sock_type.into(),
+                local_addr: val.local_addr,
+                peer_addr: val.peer_addr,
+                bind_device: val.bind_device.clone(),
+                backlog: val.backlog,
+                shutdown: None,
+                nonblocking: val.nonblocking,
+                so_reuseaddr: val.so_reuseaddr,
+                so_conn_state: val.so_conn_state.into(),
+                so_recv_buf_size: val.so_recv_buf_size,
+                so_send_buf_size: val.so_send_buf_size,
+                so_recv_timeout: val.so_recv_timeout.map(std::time::Duration::from_nanos),
+                so_send_timeout: val.so_send_timeout.map(std::time::Duration::from_nanos),
+                fs_rights: WASIRights::from_bits_truncate(val.fs_rights),
+            }
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialStdin;
+    impl From<SerialStdin> for VFD {
+        fn from(_: SerialStdin) -> Self {
+            VFD::Inode(INode::Stdin(vfs::WasiStdin))
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialStdout;
+    impl From<SerialStdout> for VFD {
+        fn from(_: SerialStdout) -> Self {
+            VFD::Inode(INode::Stdout(vfs::WasiStdout))
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialStderr;
+    impl From<SerialStderr> for VFD {
+        fn from(_: SerialStderr) -> Self {
+            VFD::Inode(INode::Stderr(vfs::WasiStderr))
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialWasiDir;
+    impl From<SerialWasiDir> for VFD {
+        fn from(_: SerialWasiDir) -> Self {
+            VFD::Closed
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialWasiFile;
+    impl From<SerialWasiFile> for VFD {
+        fn from(_: SerialWasiFile) -> Self {
+            VFD::Closed
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialTcpServer {
+        pub state: SerialWasiSocketState,
+    }
+
+    impl SerialTcpServer {
+        pub fn default_to_async_socket(self) -> std::io::Result<VFD> {
+            let state: WasiSocketState = self.state.into();
+            let addr = state
+                .local_addr
+                .ok_or(std::io::Error::from(std::io::ErrorKind::AddrNotAvailable))?;
+            let backlog = state.backlog.clamp(128, state.backlog);
+            let mut s = AsyncWasiSocket::open(state)?;
+            s.bind(addr)?;
+            s.listen(backlog)?;
+            Ok(VFD::AsyncSocket(s))
+        }
+
+        pub fn to_async_socket_with_std(
+            self,
+            listener: std::net::TcpListener,
+        ) -> std::io::Result<VFD> {
+            let state: WasiSocketState = self.state.into();
+            Ok(VFD::AsyncSocket(AsyncWasiSocket::from_tcplistener(
+                listener, state,
+            )?))
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialUdpSocket {
+        pub state: SerialWasiSocketState,
+    }
+
+    impl SerialUdpSocket {
+        pub fn default_to_async_socket(self) -> std::io::Result<VFD> {
+            let state: WasiSocketState = self.state.into();
+            let addr = state
+                .local_addr
+                .ok_or(std::io::Error::from(std::io::ErrorKind::AddrNotAvailable))?;
+            let mut s = AsyncWasiSocket::open(state)?;
+            s.bind(addr)?;
+            Ok(VFD::AsyncSocket(s))
+        }
+
+        pub fn to_async_socket_with_std(self, socket: std::net::UdpSocket) -> std::io::Result<VFD> {
+            let state: WasiSocketState = self.state.into();
+            Ok(VFD::AsyncSocket(AsyncWasiSocket::from_udpsocket(
+                socket, state,
+            )?))
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    pub struct SerialPreOpen {
+        pub guest_path: String,
+        pub dir_rights: u64,
+        pub file_rights: u64,
+    }
+
+    impl SerialPreOpen {
+        pub fn to_vfd(self, host_path: PathBuf) -> VFD {
+            let mut preopen = WasiPreOpenDir::new(host_path, PathBuf::from(self.guest_path));
+            preopen.dir_rights = WASIRights::from_bits_truncate(self.dir_rights);
+            preopen.file_rights = WASIRights::from_bits_truncate(self.file_rights);
+            VFD::Inode(INode::PreOpenDir(preopen))
+        }
+    }
+
+    #[derive(Debug, Clone, Deserialize, Serialize)]
+    #[serde(tag = "type")]
+    pub enum SerialVFD {
+        Stdin(SerialStdin),
+        Stdout(SerialStdout),
+        Stderr(SerialStderr),
+        PreOpenDir(SerialPreOpen),
+        WasiDir(SerialWasiDir),
+        WasiFile(SerialWasiFile),
+        Closed,
+        TcpServer(SerialTcpServer),
+        UdpSocket(SerialUdpSocket),
+    }
+
+    impl From<&VFD> for SerialVFD {
+        fn from(vfd: &VFD) -> Self {
+            match vfd {
+                VFD::Closed => Self::Closed,
+                VFD::Inode(INode::Dir(_)) => Self::WasiDir(SerialWasiDir),
+                VFD::Inode(INode::File(_)) => Self::WasiFile(SerialWasiFile),
+                VFD::Inode(INode::PreOpenDir(pre_open)) => {
+                    let guest_path = format!("{}", pre_open.guest_path.display());
+                    Self::PreOpenDir(SerialPreOpen {
+                        guest_path,
+                        dir_rights: pre_open.dir_rights.bits(),
+                        file_rights: pre_open.file_rights.bits(),
+                    })
+                }
+                VFD::Inode(INode::Stdin(_)) => Self::Stdin(SerialStdin),
+                VFD::Inode(INode::Stdout(_)) => Self::Stdout(SerialStdout),
+                VFD::Inode(INode::Stderr(_)) => Self::Stderr(SerialStderr),
+                VFD::AsyncSocket(AsyncWasiSocket { inner, state }) => match inner {
+                    super::common::net::async_tokio::AsyncWasiSocketInner::PreOpen(_) => {
+                        Self::Closed
+                    }
+                    super::common::net::async_tokio::AsyncWasiSocketInner::AsyncFd(_) => {
+                        if state.shutdown.is_some() {
+                            Self::Closed
+                        } else {
+                            let state: SerialWasiSocketState = state.into();
+                            match state.sock_type {
+                                SerialSocketType::TCP4 | SerialSocketType::TCP6 => {
+                                    if matches!(state.so_conn_state, SerialConnectState::Listening)
+                                    {
+                                        Self::TcpServer(SerialTcpServer { state })
+                                    } else {
+                                        Self::Closed
+                                    }
+                                }
+                                SerialSocketType::UDP4 | SerialSocketType::UDP6 => {
+                                    Self::UdpSocket(SerialUdpSocket { state })
+                                }
+                            }
+                        }
+                    }
+                },
+            }
+        }
+    }
+
+    #[tokio::test]
+    async fn test_json_serial() {
+        use super::common::net;
+        let mut wasi_ctx = super::WasiCtx::new();
+        wasi_ctx.push_arg("abc".to_string());
+        wasi_ctx.push_env("a=1".to_string());
+        wasi_ctx.push_preopen(PathBuf::from("."), PathBuf::from("."));
+
+        // tcp4
+        let state = net::WasiSocketState::default();
+        let mut s = net::async_tokio::AsyncWasiSocket::open(state).unwrap();
+        s.bind("0.0.0.0:1234".parse().unwrap()).unwrap();
+        s.listen(128).unwrap();
+        wasi_ctx.insert_vfd(VFD::AsyncSocket(s)).unwrap();
+
+        let state = net::WasiSocketState::default();
+        let s = net::async_tokio::AsyncWasiSocket::open(state).unwrap();
+        wasi_ctx.insert_vfd(VFD::AsyncSocket(s)).unwrap();
+
+        let serial: SerialWasiCtx = (&wasi_ctx).into();
+
+        drop(wasi_ctx);
+
+        let s = serde_json::to_string_pretty(&serial).unwrap();
+
+        println!("{s}");
+
+        let new_wasi_ctx = serial.resume(|vfs| {
+            let fd = match vfs {
+                SerialVFD::Stdin(s) => s.into(),
+                SerialVFD::Stdout(s) => s.into(),
+                SerialVFD::Stderr(s) => s.into(),
+
+                SerialVFD::PreOpenDir(dir) => match dir.guest_path.as_str() {
+                    "." => dir.clone().to_vfd(PathBuf::from(".")),
+                    _ => unreachable!(),
+                },
+                SerialVFD::TcpServer(s) => s.default_to_async_socket().unwrap(),
+                SerialVFD::UdpSocket(s) => s.default_to_async_socket().unwrap(),
+                _ => VFD::Closed,
+            };
+            fd
+        });
+
+        assert!(matches!(
+            new_wasi_ctx.get_vfd(0),
+            Ok(VFD::Inode(INode::Stdin(..)))
+        ));
+        assert!(matches!(
+            new_wasi_ctx.get_vfd(1),
+            Ok(VFD::Inode(INode::Stdout(..)))
+        ));
+        assert!(matches!(
+            new_wasi_ctx.get_vfd(2),
+            Ok(VFD::Inode(INode::Stderr(..)))
+        ));
+        assert!(matches!(
+            new_wasi_ctx.get_vfd(3),
+            Ok(VFD::Inode(INode::PreOpenDir(..)))
+        ));
+        assert!(matches!(
+            new_wasi_ctx.get_vfd(4),
+            Ok(VFD::AsyncSocket(AsyncWasiSocket { .. }))
+        ));
+        assert!(matches!(new_wasi_ctx.get_vfd(5), Err(..)));
+        assert!(&new_wasi_ctx.args == &["abc"]);
+        assert!(&new_wasi_ctx.envs == &["a=1"]);
+        assert_eq!(new_wasi_ctx.vfs_preopen_limit, 3);
+    }
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/preview_1/async_poll.rs.html b/src/async_wasi/snapshots/preview_1/async_poll.rs.html new file mode 100644 index 000000000..5ecbcc8fc --- /dev/null +++ b/src/async_wasi/snapshots/preview_1/async_poll.rs.html @@ -0,0 +1,891 @@ +async_poll.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+
use crate::snapshots::{
+    common::{
+        memory::{Memory, WasmPtr},
+        net::{self, ConnectState, SubscriptionClock},
+        types::*,
+    },
+    env::VFD,
+    Errno, WasiCtx,
+};
+use futures::{stream::FuturesUnordered, StreamExt};
+use net::{async_tokio::AsyncWasiSocket, PrePoll, SubscriptionFd, SubscriptionFdType};
+use std::time::Duration;
+use tokio::io::unix::AsyncFdReadyGuard;
+
+fn handle_event_err(type_: SubscriptionFdType, errno: Errno) -> __wasi_event_t {
+    let mut r = __wasi_event_t {
+        userdata: 0,
+        error: errno.0,
+        type_: 0,
+        fd_readwrite: __wasi_event_fd_readwrite_t {
+            nbytes: 0,
+            flags: 0,
+        },
+    };
+    match type_ {
+        SubscriptionFdType::Read(userdata) => {
+            r.userdata = userdata;
+            r.type_ = __wasi_eventtype_t::__WASI_EVENTTYPE_FD_READ;
+        }
+        SubscriptionFdType::Write(userdata) => {
+            r.userdata = userdata;
+            r.type_ = __wasi_eventtype_t::__WASI_EVENTTYPE_FD_WRITE;
+        }
+        SubscriptionFdType::Both { read: userdata, .. } => {
+            r.userdata = userdata;
+            r.type_ = __wasi_eventtype_t::__WASI_EVENTTYPE_FD_READ;
+        }
+    }
+    r
+}
+
+async fn wait_fd(
+    fd_index: usize,
+    socket: &AsyncWasiSocket,
+    type_: SubscriptionFdType,
+) -> Result<(__wasi_event_t, Option<usize>), Errno> {
+    let connecting = ConnectState::Connecting == socket.state.so_conn_state;
+
+    let handler =
+        |r: Result<AsyncFdReadyGuard<socket2::Socket>, std::io::Error>, userdata, type_| match r {
+            Ok(mut s) => {
+                if !connecting {
+                    s.clear_ready();
+                }
+                (
+                    __wasi_event_t {
+                        userdata,
+                        error: 0,
+                        type_,
+                        fd_readwrite: __wasi_event_fd_readwrite_t {
+                            nbytes: 0,
+                            flags: 0,
+                        },
+                    },
+                    if connecting { Some(fd_index) } else { None },
+                )
+            }
+            Err(e) => (
+                __wasi_event_t {
+                    userdata,
+                    error: Errno::from(e).0,
+                    type_,
+                    fd_readwrite: __wasi_event_fd_readwrite_t {
+                        nbytes: 0,
+                        flags: __wasi_eventrwflags_t::__WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP,
+                    },
+                },
+                None,
+            ),
+        };
+
+    match type_ {
+        SubscriptionFdType::Write(userdata) => Ok(handler(
+            socket.inner.writable().await,
+            userdata,
+            __wasi_eventtype_t::__WASI_EVENTTYPE_FD_WRITE,
+        )),
+        SubscriptionFdType::Read(userdata) => Ok(handler(
+            socket.inner.readable().await,
+            userdata,
+            __wasi_eventtype_t::__WASI_EVENTTYPE_FD_READ,
+        )),
+        SubscriptionFdType::Both { read, write } => {
+            tokio::select! {
+                read_result=socket.inner.readable()=>{
+                    Ok(handler(
+                        read_result,
+                        read,
+                        __wasi_eventtype_t::__WASI_EVENTTYPE_FD_READ,
+                    ))
+                }
+                write_result=socket.inner.writable()=>{
+                    Ok(handler(
+                        write_result,
+                        write,
+                        __wasi_eventtype_t::__WASI_EVENTTYPE_FD_WRITE,
+                    ))
+                }
+            }
+        }
+    }
+}
+
+#[allow(clippy::needless_pass_by_ref_mut)]
+async fn poll_only_fd<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    out_ptr: WasmPtr<__wasi_event_t>,
+    nsubscriptions: usize,
+    revents_num_ptr: WasmPtr<__wasi_size_t>,
+    fd_vec: Vec<SubscriptionFd>,
+) -> Result<(), Errno> {
+    if fd_vec.is_empty() {
+        mem.write_data(revents_num_ptr, 0)?;
+    } else {
+        let r_events = mem.mut_slice(out_ptr, nsubscriptions)?;
+        let mut wait = FuturesUnordered::new();
+        let mut i = 0;
+        for SubscriptionFd { fd, type_ } in fd_vec {
+            match ctx.get_vfd(fd) {
+                Ok(VFD::AsyncSocket(s)) => {
+                    wait.push(wait_fd(fd as usize, s, type_));
+                }
+                Ok(VFD::Closed) => {
+                    r_events[i] = handle_event_err(type_, Errno::__WASI_ERRNO_IO);
+                    i += 1;
+                }
+                _ => {
+                    r_events[i] = handle_event_err(type_, Errno::__WASI_ERRNO_NOTSOCK);
+                    i += 1;
+                }
+            }
+        }
+
+        if i == 0 {
+            let mut connected_fds = vec![];
+
+            let (v, connected_fd) = wait.select_next_some().await?;
+            connected_fds.push(connected_fd);
+            r_events[i] = v;
+            i += 1;
+
+            'wait_poll: loop {
+                if i >= nsubscriptions {
+                    break 'wait_poll;
+                }
+                futures::select! {
+                    v = wait.next() => {
+                        if let Some(v) = v {
+                            let (v, connected_fd) = v?;
+                            connected_fds.push(connected_fd);
+                            r_events[i] = v;
+                            i += 1;
+                        } else {
+                            break 'wait_poll;
+                        }
+                    }
+                    default => {
+                        break 'wait_poll;
+                    }
+                };
+            }
+
+            drop(wait);
+
+            for fd in connected_fds.into_iter().flatten() {
+                if let Ok(VFD::AsyncSocket(socket)) = ctx.get_mut_vfd(fd as i32) {
+                    socket.state.so_conn_state = ConnectState::Connected;
+                }
+            }
+        }
+
+        mem.write_data(revents_num_ptr, i as u32)?;
+    }
+    Ok(())
+}
+
+#[allow(clippy::needless_pass_by_ref_mut)]
+async fn poll_fd_timeout<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    out_ptr: WasmPtr<__wasi_event_t>,
+    nsubscriptions: usize,
+    revents_num_ptr: WasmPtr<__wasi_size_t>,
+    clock: SubscriptionClock,
+    fd_vec: Vec<SubscriptionFd>,
+) -> Result<(), Errno> {
+    let r_events = mem.mut_slice(out_ptr, nsubscriptions)?;
+    let mut wait = FuturesUnordered::new();
+
+    let mut i = 0;
+
+    for SubscriptionFd { fd, type_ } in fd_vec {
+        match ctx.get_vfd(fd) {
+            Ok(VFD::AsyncSocket(s)) => {
+                wait.push(wait_fd(fd as usize, s, type_));
+            }
+            Ok(VFD::Closed) => {
+                r_events[i] = handle_event_err(type_, Errno::__WASI_ERRNO_IO);
+                i += 1;
+            }
+            _ => {
+                r_events[i] = handle_event_err(type_, Errno::__WASI_ERRNO_NOTSOCK);
+                i += 1;
+            }
+        }
+    }
+
+    if i == 0 {
+        let ddl = clock.timeout.unwrap();
+        let now = std::time::SystemTime::now();
+        let timeout = ddl.duration_since(now).unwrap_or(Duration::from_secs(0));
+        let sleep = tokio::time::timeout(timeout, wait.select_next_some()).await;
+        if sleep.is_err() {
+            let r_event = &mut r_events[0];
+            r_event.userdata = clock.userdata;
+            r_event.type_ = __wasi_eventtype_t::__WASI_EVENTTYPE_CLOCK;
+            mem.write_data(revents_num_ptr, 1)?;
+            return Ok(());
+        }
+
+        let mut connected_fds = vec![];
+
+        let (first, connected_fd) = sleep.unwrap()?;
+        connected_fds.push(connected_fd);
+        r_events[i] = first;
+        i += 1;
+
+        'wait: loop {
+            if i >= nsubscriptions {
+                break 'wait;
+            }
+            futures::select! {
+                v = wait.next() => {
+                    if let Some(v) = v {
+                        let (v,connected_fd) = v?;
+                        connected_fds.push(connected_fd);
+                        r_events[i] = v;
+                        i += 1;
+                    } else {
+                        break 'wait;
+                    }
+                }
+                default => {
+                    break 'wait;
+                }
+            };
+        }
+
+        drop(wait);
+
+        for fd in connected_fds.into_iter().flatten() {
+            if let Ok(VFD::AsyncSocket(socket)) = ctx.get_mut_vfd(fd as i32) {
+                socket.state.so_conn_state = ConnectState::Connected;
+            }
+        }
+    }
+
+    mem.write_data(revents_num_ptr, i as u32)?;
+    Ok(())
+}
+
+#[cfg(feature = "serialize")]
+use crate::snapshots::serialize::IoState;
+#[cfg(feature = "serialize")]
+fn record_state(
+    ctx: &mut WasiCtx,
+    ddl: Option<std::time::SystemTime>,
+    fds: &[SubscriptionFd],
+) -> IoState {
+    use crate::snapshots::serialize::PollFdState;
+    let mut save_fds = vec![];
+    for fd in fds {
+        let poll_read;
+        let poll_write;
+
+        match fd.type_ {
+            SubscriptionFdType::Read(_) => {
+                poll_read = true;
+                poll_write = false;
+            }
+            SubscriptionFdType::Write(_) => {
+                poll_read = false;
+                poll_write = true;
+            }
+            SubscriptionFdType::Both { .. } => {
+                poll_read = true;
+                poll_write = true;
+            }
+        }
+
+        if let Ok(VFD::AsyncSocket(s)) = ctx.get_mut_vfd(fd.fd) {
+            match s.state.sock_type.1 {
+                net::SocketType::Datagram => {
+                    // save
+                    save_fds.push(PollFdState::UdpSocket {
+                        fd: fd.fd,
+                        socket_type: s.state.sock_type.into(),
+                        local_addr: s.get_local().ok(),
+                        peer_addr: s.get_peer().ok(),
+                        poll_read,
+                        poll_write,
+                    })
+                }
+                net::SocketType::Stream if s.state.shutdown.is_none() => {
+                    // save
+                    match s.state.so_conn_state {
+                        net::ConnectState::Empty => {}
+                        net::ConnectState::Listening => save_fds.push(PollFdState::TcpListener {
+                            fd: fd.fd,
+                            socket_type: s.state.sock_type.into(),
+                            local_addr: s.get_local().ok(),
+                            peer_addr: s.get_peer().ok(),
+                            poll_read,
+                            poll_write,
+                        }),
+                        net::ConnectState::Connected | net::ConnectState::Connecting => save_fds
+                            .push(PollFdState::TcpStream {
+                                fd: fd.fd,
+                                socket_type: s.state.sock_type.into(),
+                                local_addr: s.get_local().ok(),
+                                peer_addr: s.get_peer().ok(),
+                                poll_read,
+                                poll_write,
+                            }),
+                    }
+                }
+                _ => {}
+            }
+        }
+    }
+
+    IoState::Poll { fds: save_fds, ddl }
+}
+
+pub async fn poll_oneoff<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    in_ptr: WasmPtr<__wasi_subscription_t>,
+    out_ptr: WasmPtr<__wasi_event_t>,
+    nsubscriptions: __wasi_size_t,
+    revents_num_ptr: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let r = poll_oneoff_impl(ctx, mem, in_ptr, out_ptr, nsubscriptions, revents_num_ptr).await;
+    #[cfg(feature = "serialize")]
+    {
+        ctx.io_state = IoState::Empty;
+    }
+    r
+}
+
+async fn poll_oneoff_impl<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    in_ptr: WasmPtr<__wasi_subscription_t>,
+    out_ptr: WasmPtr<__wasi_event_t>,
+    nsubscriptions: __wasi_size_t,
+    revents_num_ptr: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    if nsubscriptions == 0 {
+        return Ok(());
+    }
+
+    let nsubscriptions = nsubscriptions as usize;
+
+    let subs = mem.get_slice(in_ptr, nsubscriptions)?;
+    let prepoll = PrePoll::from_wasi_subscription(subs)?;
+
+    match prepoll {
+        PrePoll::OnlyFd(fd_vec) => {
+            #[cfg(feature = "serialize")]
+            {
+                if let IoState::Empty = ctx.io_state {
+                    ctx.io_state = record_state(ctx, None, &fd_vec);
+                }
+            }
+            poll_only_fd(ctx, mem, out_ptr, nsubscriptions, revents_num_ptr, fd_vec).await?;
+        }
+        PrePoll::ClockAndFd(clock, fd_vec) => {
+            #[cfg(feature = "serialize")]
+            let clock = {
+                // resume
+                if let IoState::Poll { ddl, .. } = ctx.io_state {
+                    let mut clock_clone = clock;
+                    clock_clone.timeout = ddl;
+                    clock_clone
+                } else {
+                    ctx.io_state = record_state(ctx, clock.timeout, &fd_vec);
+                    clock
+                }
+            };
+            poll_fd_timeout(
+                ctx,
+                mem,
+                out_ptr,
+                nsubscriptions,
+                revents_num_ptr,
+                clock,
+                fd_vec,
+            )
+            .await?;
+        }
+        PrePoll::OnlyClock(clock) => {
+            if let Some(e) = clock.err {
+                let r_event = mem.mut_data(out_ptr)?;
+                r_event.userdata = clock.userdata;
+                r_event.type_ = __wasi_eventtype_t::__WASI_EVENTTYPE_CLOCK;
+                r_event.error = e.0;
+                mem.write_data(revents_num_ptr, 1)?;
+                return Ok(());
+            }
+            if let Some(ddl) = clock.timeout {
+                #[cfg(feature = "serialize")]
+                let ddl = {
+                    // resume
+                    if let IoState::Sleep { ddl } = ctx.io_state {
+                        ddl
+                    } else {
+                        ctx.io_state = IoState::Sleep { ddl };
+                        ddl
+                    }
+                };
+                let now = std::time::SystemTime::now();
+                let dur = ddl.duration_since(now).unwrap_or(Duration::from_secs(0));
+                tokio::time::sleep(dur).await;
+                let r_event = mem.mut_data(out_ptr)?;
+                r_event.userdata = clock.userdata;
+                r_event.type_ = __wasi_eventtype_t::__WASI_EVENTTYPE_CLOCK;
+                mem.write_data(revents_num_ptr, 1)?;
+                return Ok(());
+            }
+        }
+    }
+    Ok(())
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/preview_1/async_socket.rs.html b/src/async_wasi/snapshots/preview_1/async_socket.rs.html new file mode 100644 index 000000000..ee76884f6 --- /dev/null +++ b/src/async_wasi/snapshots/preview_1/async_socket.rs.html @@ -0,0 +1,1685 @@ +async_socket.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+
use crate::snapshots::{
+    common::{
+        memory::{Memory, WasmPtr},
+        net::{self, AddressFamily, SocketType, WasiSocketState},
+        types::*,
+    },
+    env::{self, VFD},
+    Errno, WasiCtx,
+};
+use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
+
+cfg_if::cfg_if! {
+    if #[cfg(any(
+        target_os = "linux", target_os = "android",
+        target_os = "dragonfly", target_os = "freebsd",
+        target_os = "openbsd", target_os = "netbsd",
+        target_os = "haiku", target_os = "nto"))] {
+        use libc::MSG_NOSIGNAL;
+    } else {
+        const MSG_NOSIGNAL: std::ffi::c_int = 0x0;
+    }
+}
+
+fn parse_wasi_ip<M: Memory>(mem: &M, addr_ptr: WasmPtr<__wasi_address_t>) -> Result<IpAddr, Errno> {
+    let wasi_addr = *(mem.get_data(addr_ptr)?);
+    if wasi_addr.buf_len != 4 && wasi_addr.buf_len != 16 {
+        return Err(Errno::__WASI_ERRNO_INVAL);
+    }
+    let addr_buf_ptr = WasmPtr::<u8>::from(wasi_addr.buf as usize);
+
+    let addr = if wasi_addr.buf_len == 4 {
+        let addr_buf = mem.get_slice(addr_buf_ptr, 4)?;
+        IpAddr::V4(Ipv4Addr::new(
+            addr_buf[0],
+            addr_buf[1],
+            addr_buf[2],
+            addr_buf[3],
+        ))
+    } else {
+        let addr_buf_ref = mem.get_slice(addr_buf_ptr, 16)?;
+        let mut addr_buf = [0u8; 16];
+        addr_buf.copy_from_slice(addr_buf_ref);
+        IpAddr::V6(Ipv6Addr::from(addr_buf))
+    };
+    Ok(addr)
+}
+
+pub fn sock_open<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    af: __wasi_address_family_t::Type,
+    ty: __wasi_sock_type_t::Type,
+    ro_fd_ptr: WasmPtr<__wasi_fd_t>,
+) -> Result<(), Errno> {
+    let mut state = WasiSocketState::default();
+    match af {
+        __wasi_address_family_t::__WASI_ADDRESS_FAMILY_INET4 => {
+            state.sock_type.0 = AddressFamily::Inet4
+        }
+        __wasi_address_family_t::__WASI_ADDRESS_FAMILY_INET6 => {
+            state.sock_type.0 = AddressFamily::Inet6
+        }
+        _ => return Err(Errno::__WASI_ERRNO_INVAL),
+    }
+    match ty {
+        __wasi_sock_type_t::__WASI_SOCK_TYPE_SOCK_DGRAM => {
+            state.sock_type.1 = SocketType::Datagram;
+        }
+        __wasi_sock_type_t::__WASI_SOCK_TYPE_SOCK_STREAM => {
+            state.sock_type.1 = SocketType::Stream;
+        }
+        _ => return Err(Errno::__WASI_ERRNO_INVAL),
+    }
+
+    let s = net::async_tokio::AsyncWasiSocket::open(state)?;
+    let fd = ctx.insert_vfd(env::VFD::AsyncSocket(s))?;
+    mem.write_data(ro_fd_ptr, fd)?;
+    Ok(())
+}
+
+pub fn sock_bind<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    fd: __wasi_fd_t,
+    addr_ptr: WasmPtr<__wasi_address_t>,
+    port: u32,
+) -> Result<(), Errno> {
+    let ip = parse_wasi_ip(mem, addr_ptr)?;
+    let addr = SocketAddr::new(ip, port as u16);
+
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        s.bind(addr)?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub fn sock_listen<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    backlog: u32,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        s.listen(backlog)?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub async fn sock_accept<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    ro_fd_ptr: WasmPtr<__wasi_fd_t>,
+) -> Result<(), Errno> {
+    #[cfg(feature = "serialize")]
+    {
+        use crate::snapshots::serialize::IoState;
+        if let VFD::AsyncSocket(s) = ctx.get_mut_vfd(fd)? {
+            if !s.state.nonblocking && s.state.local_addr.is_some() {
+                ctx.io_state = IoState::Accept {
+                    bind: s.state.local_addr.unwrap(),
+                }
+            }
+        } else {
+            return Err(Errno::__WASI_ERRNO_NOTSOCK);
+        }
+    }
+
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        let cs = s.accept().await;
+        #[cfg(feature = "serialize")]
+        {
+            use crate::snapshots::serialize::IoState;
+            ctx.io_state = IoState::Empty;
+        }
+        let cs = cs?;
+        let new_fd = ctx.insert_vfd(env::VFD::AsyncSocket(cs))?;
+        mem.write_data(ro_fd_ptr, new_fd)?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub async fn sock_connect<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    fd: __wasi_fd_t,
+    addr_ptr: WasmPtr<__wasi_address_t>,
+    port: u32,
+) -> Result<(), Errno> {
+    let ip = parse_wasi_ip(mem, addr_ptr)?;
+    let addr = SocketAddr::new(ip, port as u16);
+
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        s.connect(addr).await?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub async fn sock_recv<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_iovec_t>,
+    buf_len: __wasi_size_t,
+    flags: __wasi_riflags_t::Type,
+    ro_data_len_ptr: WasmPtr<__wasi_size_t>,
+    ro_flags_ptr: WasmPtr<__wasi_roflags_t::Type>,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        let mut iovec = mem.mut_iovec(buf_ptr, buf_len)?;
+        let mut native_flags = 0;
+
+        if flags & __wasi_riflags_t::__WASI_RIFLAGS_RECV_PEEK > 0 {
+            native_flags |= libc::MSG_PEEK;
+        }
+        if flags & __wasi_riflags_t::__WASI_RIFLAGS_RECV_WAITALL > 0 {
+            native_flags |= libc::MSG_WAITALL;
+        }
+
+        let (n, trunc) = s.recv(&mut iovec, native_flags).await?;
+        if trunc {
+            mem.write_data(
+                ro_flags_ptr,
+                __wasi_roflags_t::__WASI_ROFLAGS_RECV_DATA_TRUNCATED,
+            )?;
+        }
+
+        mem.write_data(ro_data_len_ptr, (n as u32).to_le())?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub async fn sock_recv_from<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_iovec_t>,
+    buf_len: __wasi_size_t,
+    wasi_addr_ptr: WasmPtr<__wasi_address_t>,
+    flags: __wasi_riflags_t::Type,
+    port_ptr: WasmPtr<u32>,
+    ro_data_len_ptr: WasmPtr<__wasi_size_t>,
+    ro_flags_ptr: WasmPtr<__wasi_roflags_t::Type>,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        let wasi_addr = *(mem.mut_data(wasi_addr_ptr)?);
+        if wasi_addr.buf_len < 128 {
+            return Err(Errno::__WASI_ERRNO_INVAL);
+        }
+
+        let mut iovec = mem.mut_iovec(buf_ptr, buf_len)?;
+        let mut native_flags = 0;
+
+        if flags & __wasi_riflags_t::__WASI_RIFLAGS_RECV_PEEK > 0 {
+            native_flags |= libc::MSG_PEEK;
+        }
+        if flags & __wasi_riflags_t::__WASI_RIFLAGS_RECV_WAITALL > 0 {
+            native_flags |= libc::MSG_WAITALL;
+        }
+
+        let (n, trunc, addr) = s.recv_from(&mut iovec, native_flags).await?;
+
+        match addr {
+            Some(SocketAddr::V4(addrv4)) => {
+                let family_ptr = WasmPtr::<u16>::from(wasi_addr.buf as usize);
+                let wasi_addr_buf_ptr = WasmPtr::<u8>::from(2 + wasi_addr.buf as usize);
+                let wasi_addr_buf = mem.mut_slice(wasi_addr_buf_ptr, 4)?;
+                wasi_addr_buf.copy_from_slice(&addrv4.ip().octets());
+
+                mem.write_data(
+                    family_ptr,
+                    __wasi_address_family_t::__WASI_ADDRESS_FAMILY_INET4 as u16,
+                )?;
+
+                mem.write_data(port_ptr, (addrv4.port() as u32).to_le())?;
+            }
+            Some(SocketAddr::V6(addrv6)) => {
+                let family_ptr = WasmPtr::<u16>::from(wasi_addr.buf as usize);
+                let wasi_addr_buf_ptr = WasmPtr::<u8>::from(2 + wasi_addr.buf as usize);
+                let wasi_addr_buf = mem.mut_slice(wasi_addr_buf_ptr, 16)?;
+                wasi_addr_buf.copy_from_slice(&addrv6.ip().octets());
+                mem.write_data(
+                    family_ptr,
+                    __wasi_address_family_t::__WASI_ADDRESS_FAMILY_INET6 as u16,
+                )?;
+                mem.write_data(port_ptr, (addrv6.port() as u32).to_le())?;
+            }
+            None => {}
+        };
+
+        if trunc {
+            mem.write_data(
+                ro_flags_ptr,
+                __wasi_roflags_t::__WASI_ROFLAGS_RECV_DATA_TRUNCATED,
+            )?;
+        }
+
+        mem.write_data(ro_data_len_ptr, (n as u32).to_le())?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub async fn sock_send<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_ciovec_t>,
+    buf_len: __wasi_size_t,
+    _flags: __wasi_siflags_t,
+    send_len_ptr: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        let iovec = mem.get_iovec(buf_ptr, buf_len)?;
+        let n = s.send(&iovec, MSG_NOSIGNAL).await?;
+        mem.write_data(send_len_ptr, (n as u32).to_le())?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub async fn sock_send_to<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_ciovec_t>,
+    buf_len: __wasi_size_t,
+    wasi_addr_ptr: WasmPtr<__wasi_address_t>,
+    port: u32,
+    _flags: __wasi_siflags_t,
+    send_len_ptr: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        let ip = parse_wasi_ip(mem, wasi_addr_ptr)?;
+        let addr = SocketAddr::new(ip, port as u16);
+        let iovec = mem.get_iovec(buf_ptr, buf_len)?;
+
+        let n = s.send_to(&iovec, addr, MSG_NOSIGNAL).await?;
+        mem.write_data(send_len_ptr, (n as u32).to_le())?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub fn sock_shutdown<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    how: __wasi_sdflags_t::Type,
+) -> Result<(), Errno> {
+    use std::net::Shutdown;
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        const BOTH: __wasi_sdflags_t::Type =
+            __wasi_sdflags_t::__WASI_SDFLAGS_WR | __wasi_sdflags_t::__WASI_SDFLAGS_RD;
+
+        let how = match how {
+            __wasi_sdflags_t::__WASI_SDFLAGS_RD => Shutdown::Read,
+            __wasi_sdflags_t::__WASI_SDFLAGS_WR => Shutdown::Write,
+            BOTH => Shutdown::Both,
+            _ => return Err(Errno::__WASI_ERRNO_INVAL),
+        };
+
+        s.shutdown(how)?;
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub fn sock_getpeeraddr<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    wasi_addr_ptr: WasmPtr<__wasi_address_t>,
+    addr_type: WasmPtr<u32>,
+    port_ptr: WasmPtr<u32>,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        let wasi_addr = *(mem.mut_data(wasi_addr_ptr)?);
+
+        let addr = s.get_peer()?;
+
+        let addr_len: u32 = match addr {
+            SocketAddr::V4(addrv4) => {
+                let wasi_addr_buf_ptr = WasmPtr::<u8>::from(wasi_addr.buf as usize);
+                let wasi_addr_buf = mem.mut_slice(wasi_addr_buf_ptr, 4)?;
+                wasi_addr_buf.copy_from_slice(&addrv4.ip().octets());
+                mem.write_data(port_ptr, (addrv4.port() as u32).to_le())?;
+                4
+            }
+            SocketAddr::V6(addrv6) => {
+                let wasi_addr_buf_ptr = WasmPtr::<u8>::from(wasi_addr.buf as usize);
+                let wasi_addr_buf = mem.mut_slice(wasi_addr_buf_ptr, 16)?;
+                wasi_addr_buf.copy_from_slice(&addrv6.ip().octets());
+                mem.write_data(port_ptr, (addrv6.port() as u32).to_le())?;
+                16
+            }
+        };
+
+        let wasi_addr = mem.mut_data(wasi_addr_ptr)?;
+        wasi_addr.buf_len = addr_len.to_le();
+        mem.write_data(addr_type, addr_len.to_le())?;
+
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub fn sock_getlocaladdr<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    wasi_addr_ptr: WasmPtr<__wasi_address_t>,
+    addr_type: WasmPtr<u32>,
+    port_ptr: WasmPtr<u32>,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        let wasi_addr = *(mem.mut_data(wasi_addr_ptr)?);
+
+        let addr = s.get_local()?;
+
+        let addr_len: u32 = match addr {
+            SocketAddr::V4(addrv4) => {
+                let wasi_addr_buf_ptr = WasmPtr::<u8>::from(wasi_addr.buf as usize);
+                let wasi_addr_buf = mem.mut_slice(wasi_addr_buf_ptr, 4)?;
+                wasi_addr_buf.copy_from_slice(&addrv4.ip().octets());
+                mem.write_data(port_ptr, (addrv4.port() as u32).to_le())?;
+                4
+            }
+            SocketAddr::V6(addrv6) => {
+                let wasi_addr_buf_ptr = WasmPtr::<u8>::from(wasi_addr.buf as usize);
+                let wasi_addr_buf = mem.mut_slice(wasi_addr_buf_ptr, 16)?;
+                wasi_addr_buf.copy_from_slice(&addrv6.ip().octets());
+                mem.write_data(port_ptr, (addrv6.port() as u32).to_le())?;
+                16
+            }
+        };
+
+        let wasi_addr = mem.mut_data(wasi_addr_ptr)?;
+        wasi_addr.buf_len = addr_len.to_le();
+        mem.write_data(addr_type, addr_len.to_le())?;
+
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub fn sock_getsockopt<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    level: __wasi_sock_opt_level_t::Type,
+    name: __wasi_sock_opt_so_t::Type,
+    flag: WasmPtr<i32>,
+    flag_size_ptr: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        let flag_size = *(mem.get_data(flag_size_ptr)?);
+        if level != __wasi_sock_opt_level_t::__WASI_SOCK_OPT_LEVEL_SOL_SOCKET {
+            return Err(Errno::__WASI_ERRNO_NOSYS);
+        }
+        let flag_val = match name {
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_REUSEADDR => {
+                if (flag_size as usize) != std::mem::size_of::<i32>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                s.get_so_reuseaddr() as i32
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_TYPE => {
+                if (flag_size as usize) != std::mem::size_of::<i32>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+
+                let (_, t) = s.get_so_type();
+                match t {
+                    SocketType::Datagram => __wasi_sock_type_t::__WASI_SOCK_TYPE_SOCK_DGRAM as i32,
+                    SocketType::Stream => __wasi_sock_type_t::__WASI_SOCK_TYPE_SOCK_STREAM as i32,
+                }
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_ERROR => {
+                if let Some(e) = s.get_so_error()? {
+                    Errno::from(e).0 as i32
+                } else {
+                    0
+                }
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_DONTROUTE => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_BROADCAST => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_SNDBUF => {
+                if (flag_size as usize) != std::mem::size_of::<i32>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                s.get_so_send_buf_size() as i32
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_RCVBUF => {
+                if (flag_size as usize) != std::mem::size_of::<i32>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                s.get_so_recv_buf_size() as i32
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_KEEPALIVE => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_OOBINLINE => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_LINGER => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_RCVLOWAT => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_RCVTIMEO => {
+                if (flag_size as usize) != std::mem::size_of::<__wasi_timeval>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+
+                let timeval = if let Some(timeout) = s.get_so_recv_timeout() {
+                    __wasi_timeval {
+                        tv_sec: (timeout.as_secs() as i64).to_le(),
+                        tv_usec: (timeout.subsec_nanos() as i64).to_le(),
+                    }
+                } else {
+                    __wasi_timeval {
+                        tv_sec: 0,
+                        tv_usec: 0,
+                    }
+                };
+
+                let offset = WasmPtr::<__wasi_timeval>::from(flag.0);
+                mem.write_data(offset, timeval)?;
+
+                return Ok(());
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_SNDTIMEO => {
+                if (flag_size as usize) != std::mem::size_of::<__wasi_timeval>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+
+                let timeval = if let Some(timeout) = s.get_so_send_timeout() {
+                    __wasi_timeval {
+                        tv_sec: (timeout.as_secs() as i64).to_le(),
+                        tv_usec: (timeout.subsec_nanos() as i64).to_le(),
+                    }
+                } else {
+                    __wasi_timeval {
+                        tv_sec: 0,
+                        tv_usec: 0,
+                    }
+                };
+
+                let offset = WasmPtr::<__wasi_timeval>::from(flag.0);
+                mem.write_data(offset, timeval)?;
+
+                return Ok(());
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_ACCEPTCONN => {
+                if (flag_size as usize) != std::mem::size_of::<i32>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                s.get_so_accept_conn()? as i32
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_BINDTODEVICE => {
+                let device = s.device()?.unwrap_or_default();
+                let offset = WasmPtr::<u8>::from(flag.0);
+                let copy_len = device.len().min((flag_size.wrapping_sub(1)) as usize);
+                if copy_len > 0 {
+                    let wasm_buf = mem.mut_slice(offset, copy_len)?;
+                    wasm_buf.copy_from_slice(&device[0..copy_len]);
+                    mem.write_data(flag_size_ptr, (copy_len + 1) as u32)?;
+                } else {
+                    mem.write_data(flag_size_ptr, 0_u32)?;
+                }
+                return Ok(());
+            }
+            _ => {
+                return Err(Errno::__WASI_ERRNO_NOPROTOOPT);
+            }
+        };
+
+        mem.write_data(flag, flag_val)?;
+
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub fn sock_setsockopt<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    fd: __wasi_fd_t,
+    level: __wasi_sock_opt_level_t::Type,
+    name: __wasi_sock_opt_so_t::Type,
+    flag: WasmPtr<i32>,
+    flag_size: __wasi_size_t,
+) -> Result<(), Errno> {
+    let sock_fd = ctx.get_mut_vfd(fd)?;
+    if let VFD::AsyncSocket(s) = sock_fd {
+        if level != __wasi_sock_opt_level_t::__WASI_SOCK_OPT_LEVEL_SOL_SOCKET {
+            return Err(Errno::__WASI_ERRNO_NOSYS);
+        }
+        match name {
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_REUSEADDR => {
+                if (flag_size as usize) != std::mem::size_of::<i32>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                let flag_val = *(mem.get_data(flag)?) > 0;
+                s.set_so_reuseaddr(flag_val)?;
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_TYPE => return Err(Errno::__WASI_ERRNO_FAULT),
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_ERROR => {
+                return Err(Errno::__WASI_ERRNO_FAULT)
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_DONTROUTE => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_BROADCAST => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_SNDBUF => {
+                if (flag_size as usize) != std::mem::size_of::<i32>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                let flag_val = *(mem.get_data(flag)?);
+                s.set_so_send_buf_size(flag_val as usize)?;
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_RCVBUF => {
+                if (flag_size as usize) != std::mem::size_of::<i32>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                let flag_val = *(mem.get_data(flag)?);
+                s.set_so_recv_buf_size(flag_val as usize)?;
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_KEEPALIVE => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_OOBINLINE => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_LINGER => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_RCVLOWAT => {
+                return Err(Errno::__WASI_ERRNO_NOSYS);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_RCVTIMEO => {
+                if (flag_size as usize) != std::mem::size_of::<__wasi_timeval>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                let offset = WasmPtr::<__wasi_timeval>::from(flag.0);
+                let timeval = *(mem.get_data(offset)?);
+                let (tv_sec, tv_usec) =
+                    (i64::from_le(timeval.tv_sec), i64::from_le(timeval.tv_usec));
+
+                let timeout = if tv_sec == 0 && tv_usec == 0 {
+                    None
+                } else {
+                    Some(std::time::Duration::new(tv_sec as u64, tv_usec as u32))
+                };
+
+                s.set_so_recv_timeout(timeout)?;
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_SNDTIMEO => {
+                if (flag_size as usize) != std::mem::size_of::<__wasi_timeval>() {
+                    return Err(Errno::__WASI_ERRNO_INVAL);
+                }
+                let offset = WasmPtr::<__wasi_timeval>::from(flag.0);
+                let timeval = *(mem.get_data(offset)?);
+                let (tv_sec, tv_usec) =
+                    (i64::from_le(timeval.tv_sec), i64::from_le(timeval.tv_usec));
+
+                let timeout = if tv_sec == 0 && tv_usec == 0 {
+                    None
+                } else {
+                    Some(std::time::Duration::new(tv_sec as u64, tv_usec as u32))
+                };
+
+                s.set_so_send_timeout(timeout)?;
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_ACCEPTCONN => {
+                return Err(Errno::__WASI_ERRNO_FAULT);
+            }
+            __wasi_sock_opt_so_t::__WASI_SOCK_OPT_SO_BINDTODEVICE => {
+                if flag_size == 0 {
+                    s.bind_device(None)?;
+                } else {
+                    let buf_ptr = WasmPtr::<u8>::from(flag.0);
+                    let wasm_buf = mem.get_slice(buf_ptr, flag_size as usize)?;
+                    s.bind_device(Some(wasm_buf))?;
+                }
+                return Ok(());
+            }
+            _ => {
+                return Err(Errno::__WASI_ERRNO_NOPROTOOPT);
+            }
+        };
+
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_NOTSOCK)
+    }
+}
+
+pub async fn sock_lookup_ip<M: Memory>(
+    _ctx: &mut WasiCtx,
+    mem: &mut M,
+    host_name_ptr: WasmPtr<u8>,
+    host_name_len: __wasi_size_t,
+    lookup_type: __wasi_address_family_t::Type,
+    addr_buf: WasmPtr<u8>,
+    addr_buf_max_len: __wasi_size_t,
+    raddr_num_ptr: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    match lookup_type {
+        __wasi_address_family_t::__WASI_ADDRESS_FAMILY_INET4 => {
+            let host_name_buf = mem.get_slice(host_name_ptr, host_name_len as usize)?;
+            let host_name =
+                std::str::from_utf8(host_name_buf).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+            let addrs = tokio::net::lookup_host(format!("{host_name}:0")).await?;
+            let write_buf = mem.mut_slice(addr_buf, addr_buf_max_len as usize)?;
+            let mut i = 0;
+            for addr in addrs {
+                if let SocketAddr::V4(ip) = addr {
+                    let buf = ip.ip().octets();
+                    if let Some(w_buf) = write_buf.get_mut(i * 4..(i + 1) * 4) {
+                        w_buf.copy_from_slice(&buf);
+                        i += 1;
+                    } else {
+                        break;
+                    }
+                }
+            }
+            mem.write_data(raddr_num_ptr, i as u32)?;
+            Ok(())
+        }
+        __wasi_address_family_t::__WASI_ADDRESS_FAMILY_INET6 => {
+            let host_name_buf = mem.get_slice(host_name_ptr, host_name_len as usize)?;
+            let host_name =
+                std::str::from_utf8(host_name_buf).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+            let addrs = tokio::net::lookup_host(format!("{host_name}:0")).await?;
+            let write_buf = mem.mut_slice(addr_buf, addr_buf_max_len as usize)?;
+            let mut i = 0;
+            for addr in addrs {
+                if let SocketAddr::V6(ip) = addr {
+                    let buf = ip.ip().octets();
+                    if let Some(w_buf) = write_buf.get_mut(i * 16..(i + 1) * 16) {
+                        w_buf.copy_from_slice(&buf);
+                        i += 1;
+                    } else {
+                        break;
+                    }
+                }
+            }
+            mem.write_data(raddr_num_ptr, i as u32)?;
+            Ok(())
+        }
+        _ => Err(Errno::__WASI_ERRNO_INVAL),
+    }
+}
+
+pub mod addrinfo {
+    use crate::snapshots::{
+        common::memory::{Memory, WasmPtr},
+        env::Errno,
+        WasiCtx,
+    };
+
+    #[allow(dead_code)]
+    #[derive(Copy, Clone, Debug)]
+    #[repr(u8, align(1))]
+    pub enum AddressFamily {
+        Unspec,
+        Inet4,
+        Inet6,
+    }
+
+    #[derive(Debug, Clone)]
+    #[repr(C)]
+    pub struct WasiSockaddr {
+        pub family: AddressFamily,
+        pub sa_data_len: u32,
+        pub sa_data: u32, //*mut u8,
+    }
+
+    #[derive(Debug, Clone)]
+    #[repr(C, packed(4))]
+    pub struct WasiAddrinfo {
+        pub ai_flags: u16,
+        pub ai_family: AddressFamily,
+        pub ai_socktype: u8,
+        pub ai_protocol: u8,
+        pub ai_addrlen: u32,
+        pub ai_addr: u32,      //*mut WasiSockaddr,
+        pub ai_canonname: u32, //*mut u8,
+        pub ai_canonnamelen: u32,
+        pub ai_next: u32, //*mut WasiAddrinfo,
+    }
+
+    pub fn sock_getaddrinfo<M: Memory>(
+        _ctx: &mut WasiCtx,
+        mem: &mut M,
+        node: WasmPtr<u8>,
+        node_len: u32,
+        _server: WasmPtr<u8>,
+        _server_len: u32,
+        _hint: WasmPtr<()>,
+        res: WasmPtr<u32>, // WasmPtr<WasmPtr<WasiAddrinfo>>
+        max_len: u32,
+        res_len: WasmPtr<u32>,
+    ) -> Result<(), Errno> {
+        use std::net::ToSocketAddrs;
+        if max_len == 0 {
+            return Err(Errno::__WASI_ERRNO_INVAL);
+        }
+        let node =
+            std::ffi::CString::from_vec_with_nul(mem.get_slice(node, node_len as usize)?.to_vec())
+                .unwrap_or_default();
+        let node = node.to_str().unwrap_or_default();
+
+        let addr = if node.is_empty() {
+            None
+        } else {
+            // let node = format!("{node}:0");
+            (node, 0).to_socket_addrs()?.next()
+        };
+
+        if let Some(std::net::SocketAddr::V4(ipv4)) = addr {
+            let addr_info_ptr = *mem.get_data(res)?;
+            let addr_info = mem.mut_data(WasmPtr::<WasiAddrinfo>::from(addr_info_ptr as usize))?;
+
+            addr_info.ai_addrlen = 4;
+            let wasi_addr_ptr: WasmPtr<WasiSockaddr> = (addr_info.ai_addr as usize).into();
+            let wasi_addr = mem.mut_data(wasi_addr_ptr)?;
+            wasi_addr.family = AddressFamily::Inet4;
+            let sa_data_ptr: WasmPtr<u8> = (wasi_addr.sa_data as usize).into();
+            let sa_data_len = wasi_addr.sa_data_len;
+            let sa_data = mem.mut_slice(sa_data_ptr, sa_data_len as usize)?;
+            let port_buf = ipv4.port().to_be_bytes();
+            sa_data[0] = port_buf[0];
+            sa_data[1] = port_buf[1];
+            let ip = ipv4.ip().octets();
+            sa_data[2..6].copy_from_slice(&ip);
+            mem.write_data(res_len, 1)?;
+        } else {
+            mem.write_data(res_len, 0)?;
+        }
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/src/async_wasi/snapshots/preview_1/mod.rs.html b/src/async_wasi/snapshots/preview_1/mod.rs.html new file mode 100644 index 000000000..014f90941 --- /dev/null +++ b/src/async_wasi/snapshots/preview_1/mod.rs.html @@ -0,0 +1,1631 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+
use super::{
+    common::{
+        clock,
+        error::Errno,
+        memory::{Memory, WasmPtr},
+        types::*,
+    },
+    env::{
+        vfs::{self, FdFlags, INode, WASIRights},
+        AsyncVM, VFD,
+    },
+    WasiCtx,
+};
+
+#[cfg(all(unix, feature = "async_tokio"))]
+pub mod async_poll;
+#[cfg(all(unix, feature = "async_tokio"))]
+pub mod async_socket;
+
+pub fn args_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    argv: WasmPtr<__wasi_size_t>,
+    argv_buf: WasmPtr<u8>,
+) -> Result<(), Errno> {
+    let mut header_offset = 0;
+    for (argv_index, arg) in ctx.args.iter().enumerate() {
+        let arg_buf = mem.mut_data(argv + argv_index)?;
+        *arg_buf = ((argv_buf.0 + header_offset) as u32).to_le();
+
+        let arg_bytes = arg.as_bytes();
+        let arg_buf = mem.mut_slice(argv_buf + header_offset, arg.len())?;
+        arg_buf.copy_from_slice(arg_bytes);
+
+        header_offset += arg.len() + 1;
+    }
+    Ok(())
+}
+
+pub fn args_sizes_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    argc: WasmPtr<__wasi_size_t>,
+    argv_buf_size: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let wasi_argc = ctx.args.len();
+    debug_assert!(wasi_argc < __wasi_size_t::MAX as usize);
+    let argc = mem.mut_data(argc)?;
+    *argc = (wasi_argc as u32).to_le();
+
+    let mut wasi_argv_buf_size = 0;
+    for argv in &ctx.args {
+        // add \0
+        wasi_argv_buf_size += argv.len() + 1;
+    }
+    let argv_buf_size = mem.mut_data(argv_buf_size)?;
+    *argv_buf_size = (wasi_argv_buf_size as u32).to_le();
+
+    Ok(())
+}
+
+pub fn environ_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    environ: WasmPtr<__wasi_size_t>,
+    environ_buf: WasmPtr<u8>,
+) -> Result<(), Errno> {
+    let mut header_offset = 0;
+
+    for (environ_index, env) in ctx.envs.iter().enumerate() {
+        let environ_ptr = mem.mut_data(environ + environ_index)?;
+        *environ_ptr = ((environ_buf.0 + header_offset) as u32).to_le();
+
+        let env_bytes = env.as_bytes();
+        let env_buf = mem.mut_slice(environ_buf + header_offset, env.len())?;
+        env_buf.copy_from_slice(env_bytes);
+
+        header_offset += env.len() + 1;
+    }
+    Ok(())
+}
+
+pub fn environ_sizes_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    environ_count: WasmPtr<__wasi_size_t>,
+    environ_buf_size: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let wasi_envs_len = ctx.envs.len();
+    debug_assert!(
+        wasi_envs_len < __wasi_size_t::MAX as usize,
+        "wasi_envs_len({wasi_envs_len})"
+    );
+    let environ_count = mem.mut_data(environ_count)?;
+    *environ_count = (wasi_envs_len as u32).to_le();
+
+    let mut wasi_envs_buf_size = 0;
+    for env in &ctx.envs {
+        // add \0
+        wasi_envs_buf_size += env.len() + 1;
+    }
+    let environ_buf_size = mem.mut_data(environ_buf_size)?;
+    *environ_buf_size = (wasi_envs_buf_size as u32).to_le();
+
+    Ok(())
+}
+
+pub fn clock_res_get<M: Memory>(
+    _ctx: &mut WasiCtx,
+    mem: &mut M,
+    clock_id: __wasi_clockid_t::Type,
+    resolution_ptr: WasmPtr<__wasi_timestamp_t>,
+) -> Result<(), Errno> {
+    let resolution = clock::wasi_clock_res_get(clock_id)?;
+    let resolution_ptr = mem.mut_data(resolution_ptr)?;
+    *resolution_ptr = resolution.to_le();
+    Ok(())
+}
+
+pub fn clock_time_get<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &mut M,
+    clock_id: __wasi_clockid_t::Type,
+    precision: __wasi_timestamp_t,
+    time_ptr: WasmPtr<__wasi_timestamp_t>,
+) -> Result<(), Errno> {
+    let time = clock::wasi_clock_time_get(ctx, clock_id, precision)?;
+    let time_ptr = mem.mut_data(time_ptr)?;
+    *time_ptr = time.to_le();
+    Ok(())
+}
+
+pub fn random_get<M: Memory>(
+    _ctx: &mut WasiCtx,
+    mem: &mut M,
+    buf: WasmPtr<u8>,
+    buf_len: __wasi_size_t,
+) -> Result<(), Errno> {
+    let u8_buffer = mem.mut_slice(buf, buf_len as usize)?;
+    getrandom::getrandom(u8_buffer).map_err(|_| Errno(__wasi_errno_t::__WASI_ERRNO_IO))
+}
+
+pub fn fd_prestat_get<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    prestat_ptr: WasmPtr<__wasi_prestat_t>,
+) -> Result<(), Errno> {
+    let prestat = mem.mut_data(prestat_ptr)?;
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::PreOpenDir(dir)) => {
+            let path_str = dir.guest_path.to_str().ok_or(Errno::__WASI_ERRNO_NOTSUP)?;
+            let pr_name_len = path_str.as_bytes().len() as u32;
+
+            prestat.tag = __wasi_preopentype_t::__WASI_PREOPENTYPE_DIR;
+            prestat.u = __wasi_prestat_u_t {
+                dir: __wasi_prestat_dir_t { pr_name_len },
+            };
+            Ok(())
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_prestat_dir_name<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    path_buf_ptr: WasmPtr<u8>,
+    path_max_len: __wasi_size_t,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::PreOpenDir(dir)) => {
+            let path_str = dir.guest_path.to_str().ok_or(Errno::__WASI_ERRNO_NOTSUP)?;
+            let path_bytes = path_str.as_bytes();
+            let path_len = path_bytes.len();
+
+            if path_len < path_max_len as usize {
+                return Err(Errno::__WASI_ERRNO_NAMETOOLONG);
+            }
+
+            let path_buf = mem.mut_slice(path_buf_ptr, path_max_len as usize)?;
+
+            path_buf.clone_from_slice(&path_bytes[0..path_max_len as usize]);
+
+            Ok(())
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_renumber<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    from: __wasi_fd_t,
+    to: __wasi_fd_t,
+) -> Result<(), Errno> {
+    ctx.renumber_vfd(from, to)
+}
+
+pub fn fd_advise<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    _offset: __wasi_filesize_t,
+    _len: __wasi_filesize_t,
+    _advice: __wasi_advice_t::Type,
+) -> Result<(), Errno> {
+    if let VFD::Inode(_) = ctx.get_mut_vfd(fd)? {
+        Ok(())
+    } else {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+}
+
+pub fn fd_allocate<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    offset: __wasi_filesize_t,
+    len: __wasi_filesize_t,
+) -> Result<(), Errno> {
+    if let VFD::Inode(INode::File(f)) = ctx.get_mut_vfd(fd)? {
+        f.fd_allocate(offset, len)
+    } else {
+        Err(Errno::__WASI_ERRNO_BADF)
+    }
+}
+
+pub fn fd_close<M: Memory>(ctx: &mut WasiCtx, _mem: &mut M, fd: __wasi_fd_t) -> Result<(), Errno> {
+    ctx.remove_vfd(fd)?;
+    Ok(())
+}
+
+pub fn fd_seek<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    offset: __wasi_filedelta_t,
+    whence: __wasi_whence_t::Type,
+    newoffset_ptr: WasmPtr<__wasi_filesize_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            let newoffset = mem.mut_data(newoffset_ptr)?;
+            *newoffset = fs.fd_seek(offset, whence)?.to_le();
+            Ok(())
+        }
+        _ => Err(Errno::__WASI_ERRNO_SPIPE),
+    }
+}
+
+pub fn fd_sync<M: Memory>(ctx: &mut WasiCtx, _mem: &mut M, fd: __wasi_fd_t) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::File(fs)) => fs.fd_sync(),
+        VFD::Inode(INode::Stdin(fs)) => fs.fd_sync(),
+        VFD::Inode(INode::Stdout(fs)) => fs.fd_sync(),
+        VFD::Inode(INode::Stderr(fs)) => fs.fd_sync(),
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_datasync<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::File(fs)) => fs.fd_datasync(),
+        VFD::Inode(INode::Stdin(fs)) => fs.fd_datasync(),
+        VFD::Inode(INode::Stdout(fs)) => fs.fd_datasync(),
+        VFD::Inode(INode::Stderr(fs)) => fs.fd_datasync(),
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_tell<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    offset: WasmPtr<__wasi_filesize_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::File(fs)) => mem.write_data(offset, fs.fd_tell()?),
+        VFD::Inode(INode::Stdin(fs)) => mem.write_data(offset, fs.fd_tell()?),
+        VFD::Inode(INode::Stdout(fs)) => mem.write_data(offset, fs.fd_tell()?),
+        VFD::Inode(INode::Stderr(fs)) => mem.write_data(offset, fs.fd_tell()?),
+        _ => Err(Errno::__WASI_ERRNO_SPIPE),
+    }
+}
+
+pub fn fd_fdstat_get<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf_ptr: WasmPtr<__wasi_fdstat_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            mem.write_data(buf_ptr, __wasi_fdstat_t::from(fs.fd_fdstat_get()?))
+        }
+        VFD::Inode(INode::Stdin(fs)) => {
+            mem.write_data(buf_ptr, __wasi_fdstat_t::from(fs.fd_fdstat_get()?))
+        }
+        VFD::Inode(INode::Stdout(fs)) => {
+            mem.write_data(buf_ptr, __wasi_fdstat_t::from(fs.fd_fdstat_get()?))
+        }
+        VFD::Inode(INode::Stderr(fs)) => {
+            mem.write_data(buf_ptr, __wasi_fdstat_t::from(fs.fd_fdstat_get()?))
+        }
+        VFD::Inode(INode::Dir(dir_fs)) => {
+            mem.write_data(buf_ptr, __wasi_fdstat_t::from(dir_fs.fd_fdstat_get()?))
+        }
+        #[cfg(all(unix, feature = "async_tokio"))]
+        VFD::AsyncSocket(s) => mem.write_data(buf_ptr, __wasi_fdstat_t::from(s.fd_fdstat_get()?)),
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_fdstat_set_flags<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    flags: __wasi_fdflags_t::Type,
+) -> Result<(), Errno> {
+    let fdflags = FdFlags::from_bits_truncate(flags);
+
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::File(fs)) => fs.fd_fdstat_set_flags(fdflags),
+
+        #[cfg(all(unix, feature = "async_tokio"))]
+        VFD::AsyncSocket(s) => {
+            s.set_nonblocking(fdflags.contains(FdFlags::NONBLOCK))?;
+            Ok(())
+        }
+
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_fdstat_set_rights<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    fs_rights_base: __wasi_rights_t::Type,
+    fs_rights_inheriting: __wasi_rights_t::Type,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    let fs_rights_base = WASIRights::from_bits_truncate(fs_rights_base);
+    let fs_rights_inheriting = WASIRights::from_bits_truncate(fs_rights_inheriting);
+
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            fs.fd_fdstat_set_rights(fs_rights_base, fs_rights_inheriting)
+        }
+        VFD::Inode(INode::Dir(dir)) => {
+            dir.fd_fdstat_set_rights(fs_rights_base, fs_rights_inheriting)
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_filestat_get<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf: WasmPtr<__wasi_filestat_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            let filestat = fs.fd_filestat_get()?;
+            mem.write_data(buf, __wasi_filestat_t::from(filestat))
+        }
+        VFD::Inode(INode::Stdin(fs)) => {
+            let filestat = fs.fd_filestat_get()?;
+            mem.write_data(buf, __wasi_filestat_t::from(filestat))
+        }
+        VFD::Inode(INode::Stdout(fs)) => {
+            let filestat = fs.fd_filestat_get()?;
+            mem.write_data(buf, __wasi_filestat_t::from(filestat))
+        }
+        VFD::Inode(INode::Stderr(fs)) => {
+            let filestat = fs.fd_filestat_get()?;
+            mem.write_data(buf, __wasi_filestat_t::from(filestat))
+        }
+        VFD::Inode(INode::Dir(dir)) => {
+            let filestat = dir.fd_filestat_get()?;
+            mem.write_data(buf, __wasi_filestat_t::from(filestat))
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_filestat_set_size<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    st_size: __wasi_filesize_t,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    match fd {
+        VFD::Inode(INode::File(fs)) => fs.fd_filestat_set_size(st_size),
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_filestat_set_times<M: Memory>(
+    ctx: &mut WasiCtx,
+    _mem: &mut M,
+    fd: __wasi_fd_t,
+    st_atim: __wasi_timestamp_t,
+    st_mtim: __wasi_timestamp_t,
+    fst_flags: __wasi_fstflags_t::Type,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            fs.fd_filestat_set_times(st_atim, st_mtim, fst_flags)?;
+            Ok(())
+        }
+        VFD::Inode(INode::Dir(dir)) => {
+            dir.fd_filestat_set_times(st_atim, st_mtim, fst_flags)?;
+            Ok(())
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_read<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    iovs: WasmPtr<__wasi_iovec_t>,
+    iovs_len: __wasi_size_t,
+    nread: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            let mut bufs = mem.mut_iovec(iovs, iovs_len)?;
+            let n = fs.fd_read(&mut bufs)? as __wasi_size_t;
+            mem.write_data(nread, n.to_le())
+        }
+        VFD::Inode(INode::Stdin(fs)) => {
+            let mut bufs = mem.mut_iovec(iovs, iovs_len)?;
+            let n = fs.fd_read(&mut bufs)? as __wasi_size_t;
+            mem.write_data(nread, n.to_le())
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_pread<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    iovs: WasmPtr<__wasi_iovec_t>,
+    iovs_len: __wasi_size_t,
+    offset: __wasi_filesize_t,
+    nread: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            let mut bufs = mem.mut_iovec(iovs, iovs_len)?;
+            let n = fs.fd_pread(&mut bufs, offset)? as __wasi_size_t;
+            mem.write_data(nread, n.to_le())
+        }
+        VFD::Inode(INode::Stdin(fs)) => {
+            let bufs = mem.mut_iovec(iovs, iovs_len)?;
+            let n = fs.fd_pread(&bufs, offset)? as __wasi_size_t;
+            mem.write_data(nread, n.to_le())
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_write<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    iovs: WasmPtr<__wasi_ciovec_t>,
+    iovs_len: __wasi_size_t,
+    nwritten: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            let bufs = mem.get_iovec(iovs, iovs_len)?;
+            let n = fs.fd_write(&bufs)? as __wasi_size_t;
+            mem.write_data(nwritten, n.to_le())
+        }
+        VFD::Inode(INode::Stdout(fs)) => {
+            let bufs = mem.get_iovec(iovs, iovs_len)?;
+            let n = fs.fd_write(&bufs)? as __wasi_size_t;
+            mem.write_data(nwritten, n.to_le())
+        }
+        VFD::Inode(INode::Stderr(fs)) => {
+            let bufs = mem.get_iovec(iovs, iovs_len)?;
+            let n = fs.fd_write(&bufs)? as __wasi_size_t;
+            mem.write_data(nwritten, n.to_le())
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_pwrite<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    iovs: WasmPtr<__wasi_ciovec_t>,
+    iovs_len: __wasi_size_t,
+    offset: __wasi_filesize_t,
+    nwritten: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+
+    match fd {
+        VFD::Inode(INode::File(fs)) => {
+            let bufs = mem.get_iovec(iovs, iovs_len)?;
+            let n = fs.fd_pwrite(&bufs, offset)? as __wasi_size_t;
+            mem.write_data(nwritten, n.to_le())
+        }
+        VFD::Inode(INode::Stdout(fs)) => {
+            let bufs = mem.get_iovec(iovs, iovs_len)?;
+            let n = fs.fd_pwrite(&bufs, offset)? as __wasi_size_t;
+            mem.write_data(nwritten, n.to_le())
+        }
+        VFD::Inode(INode::Stderr(fs)) => {
+            let bufs = mem.get_iovec(iovs, iovs_len)?;
+            let n = fs.fd_pwrite(&bufs, offset)? as __wasi_size_t;
+            mem.write_data(nwritten, n.to_le())
+        }
+        _ => Err(Errno::__WASI_ERRNO_BADF),
+    }
+}
+
+pub fn fd_readdir<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    fd: __wasi_fd_t,
+    buf: WasmPtr<u8>,
+    buf_len: __wasi_size_t,
+    cookie: __wasi_dircookie_t,
+    bufused_ptr: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(fd)?;
+    let buf = mem.mut_slice(buf, buf_len as usize)?;
+    match fd {
+        VFD::Inode(INode::PreOpenDir(dir)) => {
+            let bufused = dir.fd_readdir(cookie as usize, buf)? as __wasi_size_t;
+            let bufused_ptr = mem.mut_data(bufused_ptr)?;
+            *bufused_ptr = bufused.to_le();
+            Ok(())
+        }
+        VFD::Inode(INode::Dir(dir)) => {
+            let bufused = dir.fd_readdir(cookie as usize, buf)? as __wasi_size_t;
+            let bufused_ptr = mem.mut_data(bufused_ptr)?;
+            *bufused_ptr = bufused.to_le();
+            Ok(())
+        }
+        _ => Err(Errno::__WASI_ERRNO_NOTDIR),
+    }
+}
+
+pub fn path_create_directory<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    dirfd: __wasi_fd_t,
+    path_ptr: WasmPtr<u8>,
+    path_len: __wasi_size_t,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(dirfd)?;
+    match fd {
+        VFD::Inode(INode::PreOpenDir(dir)) => {
+            let path_buf = mem.get_slice(path_ptr, path_len as usize)?;
+            let path_str = std::str::from_utf8(path_buf).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+            dir.path_create_directory(path_str)?;
+            Ok(())
+        }
+        VFD::Inode(INode::Dir(_)) => Err(Errno::__WASI_ERRNO_ACCES),
+        _ => Err(Errno::__WASI_ERRNO_NOTDIR),
+    }
+}
+
+pub fn path_filestat_get<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    dirfd: __wasi_fd_t,
+    flags: __wasi_lookupflags_t::Type,
+    path_ptr: WasmPtr<u8>,
+    path_len: __wasi_size_t,
+    file_stat_ptr: WasmPtr<__wasi_filestat_t>,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(dirfd)?;
+    match fd {
+        VFD::Inode(INode::PreOpenDir(dir)) => {
+            let path_buf = mem.get_slice(path_ptr, path_len as usize)?;
+            let path_str = std::str::from_utf8(path_buf).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+            let flags = flags & __wasi_lookupflags_t::__WASI_LOOKUPFLAGS_SYMLINK_FOLLOW > 0;
+            let file_stat = dir.path_filestat_get(path_str, flags)?;
+            let stat = mem.mut_data(file_stat_ptr)?;
+            *stat = file_stat.into();
+            stat.dev = 3;
+            Ok(())
+        }
+        VFD::Inode(INode::Dir(_)) => Err(Errno::__WASI_ERRNO_ACCES),
+        _ => Err(Errno::__WASI_ERRNO_NOTDIR),
+    }
+}
+
+pub fn path_filestat_set_times<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _dirfd: __wasi_fd_t,
+    _flags: __wasi_lookupflags_t::Type,
+    _path: WasmPtr<u8>,
+    _path_len: __wasi_size_t,
+    _st_atim: __wasi_timestamp_t,
+    _st_mtim: __wasi_timestamp_t,
+    _fst_flags: __wasi_fstflags_t::Type,
+) -> Result<(), Errno> {
+    Err(Errno::__WASI_ERRNO_NOSYS)
+}
+
+pub fn path_link<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _old_fd: __wasi_fd_t,
+    _old_flags: __wasi_lookupflags_t::Type,
+    _old_path: WasmPtr<u8>,
+    _old_path_len: __wasi_size_t,
+    _new_fd: __wasi_fd_t,
+    _new_path: WasmPtr<u8>,
+    _new_path_len: __wasi_size_t,
+) -> Result<(), Errno> {
+    Err(Errno::__WASI_ERRNO_NOSYS)
+}
+
+pub fn path_open<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &mut M,
+    dirfd: __wasi_fd_t,
+    _dirflags: __wasi_lookupflags_t::Type,
+    path: WasmPtr<u8>,
+    path_len: __wasi_size_t,
+    o_flags: __wasi_oflags_t::Type,
+    fs_rights_base: __wasi_rights_t::Type,
+    fs_rights_inheriting: __wasi_rights_t::Type,
+    fs_flags: __wasi_fdflags_t::Type,
+    fd_ptr: WasmPtr<__wasi_fd_t>,
+) -> Result<(), Errno> {
+    let vfd = ctx.get_mut_vfd(dirfd)?;
+    match vfd {
+        VFD::Inode(INode::PreOpenDir(dir)) => {
+            let path_buf = mem.get_slice(path, path_len as usize)?;
+            let path = std::str::from_utf8(path_buf).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+
+            let oflags = vfs::OFlags::from_bits_truncate(o_flags);
+            let fdflags = vfs::FdFlags::from_bits_truncate(fs_flags);
+            let fs_rights_base = vfs::WASIRights::from_bits_truncate(fs_rights_base);
+            let fs_rights_inheriting = vfs::WASIRights::from_bits_truncate(fs_rights_inheriting);
+            if oflags.contains(vfs::OFlags::DIRECTORY) {
+                let dir = dir.path_open_dir(
+                    &path,
+                    oflags,
+                    fs_rights_base,
+                    fs_rights_inheriting,
+                    fdflags,
+                )?;
+
+                let vfd = VFD::Inode(INode::Dir(dir));
+                let fd_ptr = mem.mut_data(fd_ptr)?;
+                *fd_ptr = ctx.insert_vfd(vfd)?;
+            } else {
+                let fs = dir.path_open_file(&path, oflags, fs_rights_base, fdflags)?;
+
+                let vfd = VFD::Inode(INode::File(fs));
+                let fd_ptr = mem.mut_data(fd_ptr)?;
+                *fd_ptr = ctx.insert_vfd(vfd)?;
+            }
+            Ok(())
+        }
+        _ => Err(Errno::__WASI_ERRNO_NOENT),
+    }
+}
+
+pub fn path_readlink<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _dir_fd: __wasi_fd_t,
+    _path: WasmPtr<u8>,
+    _path_len: __wasi_size_t,
+    _buf: WasmPtr<u8>,
+    _buf_len: __wasi_size_t,
+    _buf_used: WasmPtr<__wasi_size_t>,
+) -> Result<(), Errno> {
+    Err(Errno::__WASI_ERRNO_NOSYS)
+}
+
+pub fn path_remove_directory<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    dirfd: __wasi_fd_t,
+    path_ptr: WasmPtr<u8>,
+    path_len: __wasi_size_t,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(dirfd)?;
+    match fd {
+        VFD::Inode(INode::PreOpenDir(dir)) => {
+            let path_buf = mem.get_slice(path_ptr, path_len as usize)?;
+            let path = std::str::from_utf8(path_buf).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+            dir.path_remove_directory(path)?;
+            Ok(())
+        }
+        VFD::Inode(INode::Dir(_)) => Err(Errno::__WASI_ERRNO_ACCES),
+        _ => Err(Errno::__WASI_ERRNO_NOTDIR),
+    }
+}
+
+pub fn path_rename<M: Memory>(
+    ctx: &WasiCtx,
+    mem: &M,
+    old_fd: __wasi_fd_t,
+    old_path: WasmPtr<u8>,
+    old_path_len: __wasi_size_t,
+    new_fd: __wasi_fd_t,
+    new_path: WasmPtr<u8>,
+    new_path_len: __wasi_size_t,
+) -> Result<(), Errno> {
+    let old_fd = ctx.get_vfd(old_fd)?;
+    let new_fd = ctx.get_vfd(new_fd)?;
+
+    match (old_fd, new_fd) {
+        (VFD::Inode(INode::PreOpenDir(old_dir)), VFD::Inode(INode::PreOpenDir(new_dir))) => {
+            let old_path = mem.get_slice(old_path, old_path_len as usize)?;
+            let old_path = std::str::from_utf8(old_path).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+
+            let new_path = mem.get_slice(new_path, new_path_len as usize)?;
+            let new_path = std::str::from_utf8(new_path).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+
+            let old_file_path = old_dir.get_absolutize_path(&old_path)?;
+            let new_file_path = new_dir.get_absolutize_path(&new_path)?;
+
+            std::fs::rename(old_file_path, new_file_path)?;
+            Ok(())
+        }
+        (VFD::Inode(INode::Dir(_)), _) | (_, VFD::Inode(INode::Dir(_))) => {
+            Err(Errno::__WASI_ERRNO_ACCES)
+        }
+        _ => Err(Errno::__WASI_ERRNO_NOTDIR),
+    }
+}
+
+pub fn path_symlink<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _old_path: WasmPtr<u8>,
+    _old_path_len: __wasi_size_t,
+    _fd: __wasi_fd_t,
+    _new_path: WasmPtr<u8>,
+    _new_path_len: __wasi_size_t,
+) -> Result<(), Errno> {
+    Err(Errno::__WASI_ERRNO_NOSYS)
+}
+
+pub fn path_unlink_file<M: Memory>(
+    ctx: &mut WasiCtx,
+    mem: &M,
+    dirfd: __wasi_fd_t,
+    path_ptr: WasmPtr<u8>,
+    path_len: __wasi_size_t,
+) -> Result<(), Errno> {
+    let fd = ctx.get_mut_vfd(dirfd)?;
+    match fd {
+        VFD::Inode(INode::PreOpenDir(dir)) => {
+            let path_buf = mem.get_slice(path_ptr, path_len as usize)?;
+            let path = std::str::from_utf8(path_buf).or(Err(Errno::__WASI_ERRNO_ILSEQ))?;
+            dir.path_unlink_file(path)?;
+            Ok(())
+        }
+        VFD::Inode(INode::Dir(_)) => Err(Errno::__WASI_ERRNO_ACCES),
+        _ => Err(Errno::__WASI_ERRNO_NOTDIR),
+    }
+}
+
+pub fn proc_exit<M: Memory>(ctx: &mut WasiCtx, _mem: &mut M, code: __wasi_exitcode_t) {
+    ctx.exit_code = u32::from_le(code)
+}
+
+pub fn proc_raise<M: Memory>(
+    _ctx: &mut WasiCtx,
+    _mem: &mut M,
+    _sig: __wasi_signal_t::Type,
+) -> Result<(), Errno> {
+    Err(Errno::__WASI_ERRNO_NOSYS)
+}
+
+pub fn sched_yield<VM: AsyncVM>(_ctx: &mut WasiCtx, vm: &mut VM) -> Result<(), Errno> {
+    vm.yield_now()
+}
+
\ No newline at end of file diff --git a/src/wasmedge_macro/lib.rs.html b/src/wasmedge_macro/lib.rs.html new file mode 100644 index 000000000..08779dd77 --- /dev/null +++ b/src/wasmedge_macro/lib.rs.html @@ -0,0 +1,1547 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+
#![doc(
+    html_logo_url = "https://github.com/cncf/artwork/blob/master/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.png?raw=true",
+    html_favicon_url = "https://raw.githubusercontent.com/cncf/artwork/49169bdbc88a7ce3c4a722c641cc2d548bd5c340/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.svg"
+)]
+
+//! # Overview
+//! The [wasmedge-macro](https://crates.io/crates/wasmedge-macro) crate defines a group of procedural macros used by both [wasmedge-sdk](https://crates.io/crates/wasmedge-sdk) and [wasmedge-sys](https://crates.io/crates/wasmedge-sys) crates.
+
+use proc_macro::TokenStream;
+use quote::quote;
+use syn::{parse_macro_input, parse_quote, spanned::Spanned, FnArg, Item, Pat, PatType};
+
+// ================== macros for wasmedge-sdk ==================
+
+/// Declare a native function that will be used to create a host function instance.
+#[proc_macro_attribute]
+pub fn host_function(_attr: TokenStream, item: TokenStream) -> TokenStream {
+    let body_ast = parse_macro_input!(item as Item);
+    if let Item::Fn(item_fn) = body_ast {
+        match expand_host_func(&item_fn) {
+            Ok(token_stream) => token_stream.into(),
+            Err(err) => err.to_compile_error().into(),
+        }
+    } else {
+        TokenStream::new()
+    }
+}
+
+fn expand_host_func(item_fn: &syn::ItemFn) -> syn::Result<proc_macro2::TokenStream> {
+    // extract T from Option<&mut T>
+    let ret = match &item_fn.sig.inputs.len() {
+        2 => expand_host_func_with_two_args(item_fn),
+        3 => expand_host_func_with_three_args(item_fn),
+        _ => panic!(
+            "Invalid numbers of host function arguments: {}",
+            &item_fn.sig.inputs.len()
+        ),
+    };
+
+    Ok(ret)
+}
+
+fn expand_host_func_with_two_args(item_fn: &syn::ItemFn) -> proc_macro2::TokenStream {
+    // * define the signature of wrapper function
+    // name of wrapper function
+    let wrapper_fn_name_ident = item_fn.sig.ident.clone();
+    let wrapper_fn_name_literal = wrapper_fn_name_ident.to_string();
+    // arguments of wrapper function
+    let wrapper_fn_inputs: syn::punctuated::Punctuated<FnArg, syn::token::Comma> = parse_quote!(
+        frame: wasmedge_sdk::CallingFrame,
+        args: Vec<wasmedge_sdk::WasmValue>,
+        _data: *mut std::os::raw::c_void
+    );
+    // return type of wrapper function
+    let wrapper_fn_return = item_fn.sig.output.clone();
+    // visibility of wrapper function
+    let wrapper_visibility = item_fn.vis.clone();
+
+    // get the name of the first argument
+    let (ident_first_arg, mutability) = match &item_fn.sig.inputs[0] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => (pat_ident.ident.clone(), pat_ident.mutability),
+            Pat::Wild(_) => (
+                proc_macro2::Ident::new("_caller", proc_macro2::Span::call_site()),
+                None,
+            ),
+            _ => panic!("The argument pattern of the first argument is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("The first argument is a receiver"),
+    };
+
+    // get the name of the second argument
+    let ident_second_arg = match &item_fn.sig.inputs[1] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => pat_ident.ident.clone(),
+            Pat::Wild(_) => proc_macro2::Ident::new("_args", proc_macro2::Span::call_site()),
+            _ => panic!("The argument pattern of the second argument is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("The second argument is a receiver"),
+    };
+
+    // * define the signature of inner function
+    // name of inner function
+    let inner_fn_name_literal = format!("inner_{wrapper_fn_name_literal}");
+    let inner_fn_name_ident = syn::Ident::new(&inner_fn_name_literal, item_fn.sig.span());
+    // arguments of inner function
+    let inner_fn_inputs = item_fn.sig.inputs.clone();
+    // return type of inner function
+    let inner_fn_return = item_fn.sig.output.clone();
+    // body of inner function
+    let inner_fn_block = item_fn.block.clone();
+
+    quote!(
+        # wrapper_visibility fn #wrapper_fn_name_ident (#wrapper_fn_inputs) #wrapper_fn_return {
+            // define inner function
+            fn #inner_fn_name_ident (#inner_fn_inputs) #inner_fn_return {
+                #inner_fn_block
+            }
+
+            // create a Caller instance
+            let #mutability #ident_first_arg = Caller::new(frame);
+
+            let #ident_second_arg = args;
+
+            #inner_fn_name_ident(#ident_first_arg, #ident_second_arg)
+        }
+    )
+}
+
+fn expand_host_func_with_three_args(item_fn: &syn::ItemFn) -> proc_macro2::TokenStream {
+    // * define the signature of wrapper function
+    // name of wrapper function
+    let wrapper_fn_name_ident = item_fn.sig.ident.clone();
+    let wrapper_fn_name_literal = wrapper_fn_name_ident.to_string();
+    // arguments of wrapper function
+    let wrapper_fn_inputs: syn::punctuated::Punctuated<FnArg, syn::token::Comma> = parse_quote!(
+        frame: wasmedge_sdk::CallingFrame,
+        args: Vec<wasmedge_sdk::WasmValue>,
+        data: *mut std::os::raw::c_void
+    );
+    // return type of wrapper function
+    let wrapper_fn_return = item_fn.sig.output.clone();
+    // visibility of wrapper function
+    let wrapper_visibility = item_fn.vis.clone();
+
+    // * define the signature of inner function
+    // name of inner function
+    let inner_fn_name_literal = format!("inner_{wrapper_fn_name_literal}");
+    let inner_fn_name_ident = syn::Ident::new(&inner_fn_name_literal, item_fn.sig.span());
+    // arguments of inner function
+    let inner_fn_inputs = item_fn.sig.inputs.clone();
+    // return type of inner function
+    let inner_fn_return = item_fn.sig.output.clone();
+    // body of inner function
+    let inner_fn_block = item_fn.block.clone();
+
+    // extract T from Option<&mut T>
+
+    let data_arg = item_fn.sig.inputs.last().unwrap().clone();
+    let ty_ptr = match &data_arg {
+        FnArg::Typed(PatType { ref ty, .. }) => match **ty {
+            syn::Type::Reference(syn::TypeReference { ref elem, .. }) => syn::TypePtr {
+                star_token: parse_quote!(*),
+                const_token: None,
+                mutability: Some(parse_quote!(mut)),
+                elem: elem.clone(),
+            },
+            syn::Type::Path(syn::TypePath { ref path, .. }) => match path.segments.last() {
+                Some(segment) => {
+                    let id = segment.ident.to_string();
+                    match id == "Option" {
+                        true => match segment.arguments {
+                            syn::PathArguments::AngleBracketed(
+                                syn::AngleBracketedGenericArguments { ref args, .. },
+                            ) => {
+                                let last_generic_arg = args.last();
+                                match last_generic_arg {
+                                    Some(arg) => match arg {
+                                        syn::GenericArgument::Type(ty) => match ty {
+                                            syn::Type::Reference(syn::TypeReference {
+                                                ref elem,
+                                                ..
+                                            }) => syn::TypePtr {
+                                                star_token: parse_quote!(*),
+                                                const_token: None,
+                                                mutability: Some(parse_quote!(mut)),
+                                                elem: elem.clone(),
+                                            },
+                                            _ => panic!("Not found syn::Type::Reference"),
+                                        },
+                                        _ => {
+                                            panic!("Not found syn::GenericArgument::Type")
+                                        }
+                                    },
+                                    None => panic!("Not found the last GenericArgument"),
+                                }
+                            }
+                            _ => panic!("Not found syn::PathArguments::AngleBracketed"),
+                        },
+                        false => panic!("Not found segment ident: Option"),
+                    }
+                }
+                None => panic!("Not found path segments"),
+            },
+            _ => panic!("Unsupported syn::Type type"),
+        },
+        _ => panic!("Unsupported syn::FnArg type"),
+    };
+
+    // generate token stream
+    quote!(
+        # wrapper_visibility fn #wrapper_fn_name_ident (#wrapper_fn_inputs) #wrapper_fn_return {
+            // define inner function
+            fn #inner_fn_name_ident (#inner_fn_inputs) #inner_fn_return {
+                #inner_fn_block
+            }
+
+            // create a Caller instance
+            let caller = Caller::new(frame);
+
+            let data = unsafe { &mut *(data as #ty_ptr) };
+
+            #inner_fn_name_ident(caller, args, data)
+        }
+    )
+}
+
+/// Declare a native async function that will be used to create an async host function instance.
+#[proc_macro_attribute]
+pub fn async_host_function(_attr: TokenStream, item: TokenStream) -> TokenStream {
+    let body_ast = parse_macro_input!(item as Item);
+    if let Item::Fn(item_fn) = body_ast {
+        if item_fn.sig.asyncness.is_none() {
+            panic!("The function must be async");
+        }
+
+        match expand_async_host_func(&item_fn) {
+            Ok(token_stream) => token_stream.into(),
+            Err(err) => err.to_compile_error().into(),
+        }
+    } else {
+        TokenStream::new()
+    }
+}
+
+fn expand_async_host_func(item_fn: &syn::ItemFn) -> syn::Result<proc_macro2::TokenStream> {
+    // extract T from Option<&mut T>
+    let ret = match &item_fn.sig.inputs.len() {
+        2 => expand_async_host_func_with_two_args(item_fn),
+        3 => expand_async_host_func_with_three_args(item_fn),
+        _ => panic!(
+            "Invalid numbers of host function arguments: {}",
+            &item_fn.sig.inputs.len()
+        ),
+    };
+
+    Ok(ret)
+}
+
+fn expand_async_host_func_with_two_args(item_fn: &syn::ItemFn) -> proc_macro2::TokenStream {
+    // * define the signature of wrapper function
+    // name of wrapper function
+    let wrapper_fn_name_ident = item_fn.sig.ident.clone();
+    // arguments of wrapper function
+    let wrapper_fn_inputs: syn::punctuated::Punctuated<FnArg, syn::token::Comma> = parse_quote!(
+        frame: wasmedge_sdk::CallingFrame,
+        args: Vec<wasmedge_sdk::WasmValue>,
+        _data: *mut std::ffi::c_void
+    );
+
+    // visibility of wrapper function
+    let wrapper_visibility = item_fn.vis.clone();
+
+    // get the name of the first argument
+    let (ident_first_arg, mutability) = match &item_fn.sig.inputs[0] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => (pat_ident.ident.clone(), pat_ident.mutability),
+            Pat::Wild(_) => (
+                proc_macro2::Ident::new("_caller", proc_macro2::Span::call_site()),
+                None,
+            ),
+            _ => panic!("The argument pattern of the first argument is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("The first argument is a receiver"),
+    };
+
+    // get the name of the second argument
+    let ident_second_arg = match &item_fn.sig.inputs[1] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => pat_ident.ident.clone(),
+            Pat::Wild(_) => proc_macro2::Ident::new("_args", proc_macro2::Span::call_site()),
+            _ => panic!("The argument pattern of the second argument is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("The second argument is a receiver"),
+    };
+
+    // func body
+    let fn_block = item_fn.block.clone();
+
+    quote!(
+        #wrapper_visibility fn #wrapper_fn_name_ident (#wrapper_fn_inputs) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)> {
+
+            // create a Caller instance
+            let #mutability #ident_first_arg = Caller::new(frame);
+
+            let #ident_second_arg = args;
+
+            Box::new(async move {
+                #fn_block
+            })
+        }
+    )
+}
+
+fn expand_async_host_func_with_three_args(item_fn: &syn::ItemFn) -> proc_macro2::TokenStream {
+    // * define the signature of wrapper function
+    // name of wrapper function
+    let wrapper_fn_name_ident = item_fn.sig.ident.clone();
+    // arguments of wrapper function
+    let wrapper_fn_inputs: syn::punctuated::Punctuated<FnArg, syn::token::Comma> = parse_quote!(
+        frame: wasmedge_sdk::CallingFrame,
+        args: Vec<wasmedge_sdk::WasmValue>,
+        data: *mut std::ffi::c_void
+    );
+    // visibility of wrapper function
+    let wrapper_visibility = item_fn.vis.clone();
+
+    // get the name of the first argument
+    let (ident_first_arg, mutability) = match &item_fn.sig.inputs[0] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => (pat_ident.ident.clone(), pat_ident.mutability),
+            Pat::Wild(_) => (
+                proc_macro2::Ident::new("_caller", proc_macro2::Span::call_site()),
+                None,
+            ),
+            _ => panic!("The argument pattern of the first argument is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("The first argument is a receiver"),
+    };
+
+    // get the name of the second argument
+    let ident_second_arg = match &item_fn.sig.inputs[1] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => pat_ident.ident.clone(),
+            Pat::Wild(_) => proc_macro2::Ident::new("_args", proc_macro2::Span::call_site()),
+            _ => panic!("The argument pattern of the second argument is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("The second argument is a receiver"),
+    };
+
+    // get the name of the third argument
+    let ident_third_arg = match &item_fn.sig.inputs[2] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => pat_ident.ident.clone(),
+            Pat::Wild(_) => proc_macro2::Ident::new("_data", proc_macro2::Span::call_site()),
+            _ => panic!("The argument pattern of the third argument is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("The third argument is a receiver"),
+    };
+
+    // get the type of the third argument
+    let data_arg = item_fn.sig.inputs.last().unwrap().clone();
+    let ty_third_arg = match &data_arg {
+        FnArg::Typed(PatType { ref ty, .. }) => match **ty {
+            syn::Type::Reference(syn::TypeReference { ref elem, .. }) => syn::TypePtr {
+                star_token: parse_quote!(*),
+                const_token: None,
+                mutability: Some(parse_quote!(mut)),
+                elem: elem.clone(),
+            },
+            syn::Type::Path(syn::TypePath { ref path, .. }) => match path.segments.last() {
+                Some(segment) => {
+                    let id = segment.ident.to_string();
+                    match id == "Option" {
+                        true => match segment.arguments {
+                            syn::PathArguments::AngleBracketed(
+                                syn::AngleBracketedGenericArguments { ref args, .. },
+                            ) => {
+                                let last_generic_arg = args.last();
+                                match last_generic_arg {
+                                    Some(arg) => match arg {
+                                        syn::GenericArgument::Type(ty) => match ty {
+                                            syn::Type::Reference(syn::TypeReference {
+                                                ref elem,
+                                                ..
+                                            }) => syn::TypePtr {
+                                                star_token: parse_quote!(*),
+                                                const_token: None,
+                                                mutability: Some(parse_quote!(mut)),
+                                                elem: elem.clone(),
+                                            },
+                                            _ => panic!("Not found syn::Type::Reference"),
+                                        },
+                                        _ => {
+                                            panic!("Not found syn::GenericArgument::Type")
+                                        }
+                                    },
+                                    None => panic!("Not found the last GenericArgument"),
+                                }
+                            }
+                            _ => panic!("Not found syn::PathArguments::AngleBracketed"),
+                        },
+                        false => panic!("Not found segment ident: Option"),
+                    }
+                }
+                None => panic!("Not found path segments"),
+            },
+            _ => panic!("Unsupported syn::Type type"),
+        },
+        _ => panic!("Unsupported syn::FnArg type"),
+    };
+
+    // func body
+    let fn_block = item_fn.block.clone();
+
+    quote!(
+        #wrapper_visibility fn #wrapper_fn_name_ident (#wrapper_fn_inputs) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)> {
+
+            // create a Caller instance
+            let #mutability #ident_first_arg = Caller::new(frame);
+
+            let #ident_second_arg = args;
+
+            // host context data
+            let #ident_third_arg = unsafe { &mut *(data as #ty_third_arg) };
+
+            Box::new(async move {
+                #fn_block
+            })
+        }
+    )
+}
+
+// ================== macros for wasmedge-sys ==================
+
+#[doc(hidden)]
+#[proc_macro_attribute]
+pub fn sys_async_host_function(_attr: TokenStream, item: TokenStream) -> TokenStream {
+    let body_ast = parse_macro_input!(item as Item);
+    if let Item::Fn(item_fn) = body_ast {
+        if item_fn.sig.asyncness.is_none() {
+            panic!("The function must be async");
+        }
+
+        match sys_expand_async_host_func(&item_fn) {
+            Ok(token_stream) => token_stream.into(),
+            Err(err) => err.to_compile_error().into(),
+        }
+    } else {
+        TokenStream::new()
+    }
+}
+
+fn sys_expand_async_host_func(item_fn: &syn::ItemFn) -> syn::Result<proc_macro2::TokenStream> {
+    // extract T from Option<&mut T>
+    let ret = match &item_fn.sig.inputs.len() {
+        2 => sys_expand_async_host_func_with_two_args(item_fn),
+        3 => sys_expand_async_host_func_with_three_args(item_fn),
+        _ => panic!("Invalid numbers of host function arguments"),
+    };
+
+    Ok(ret)
+}
+
+fn sys_expand_async_host_func_with_two_args(item_fn: &syn::ItemFn) -> proc_macro2::TokenStream {
+    // function name
+    let fn_name_ident = &item_fn.sig.ident;
+
+    // function visibility
+    let fn_visibility = &item_fn.vis;
+
+    // generic types
+    let fn_generics = &item_fn.sig.generics;
+
+    // arguments
+    let mut fn_inputs = item_fn.sig.inputs.clone();
+    fn_inputs.push(parse_quote!(_: *mut std::os::raw::c_void));
+
+    // function body
+    let fn_block = &item_fn.block;
+
+    quote!(
+        #fn_visibility fn #fn_name_ident #fn_generics (#fn_inputs) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)> {
+            Box::new(async move {
+                #fn_block
+            })
+        }
+    )
+}
+
+fn sys_expand_async_host_func_with_three_args(item_fn: &syn::ItemFn) -> proc_macro2::TokenStream {
+    // function name
+    let fn_name_ident = &item_fn.sig.ident;
+
+    // function visibility
+    let fn_visibility = &item_fn.vis;
+
+    // generic types
+    let fn_generics = &item_fn.sig.generics;
+
+    // arguments
+    let fn_inputs = &item_fn.sig.inputs;
+
+    // function body
+    let fn_block = &item_fn.block;
+
+    quote!(
+        #fn_visibility fn #fn_name_ident #fn_generics (#fn_inputs) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)> {
+            Box::new(async move {
+                #fn_block
+            })
+        }
+    )
+}
+
+#[doc(hidden)]
+#[proc_macro_attribute]
+pub fn sys_host_function(_attr: TokenStream, item: TokenStream) -> TokenStream {
+    let body_ast = parse_macro_input!(item as Item);
+    if let Item::Fn(item_fn) = body_ast {
+        match sys_expand_host_func_new(&item_fn) {
+            Ok(token_stream) => token_stream.into(),
+            Err(err) => err.to_compile_error().into(),
+        }
+    } else {
+        TokenStream::new()
+    }
+}
+
+fn sys_expand_host_func_new(item_fn: &syn::ItemFn) -> syn::Result<proc_macro2::TokenStream> {
+    // * define the signature of wrapper function
+    // name of wrapper function
+    let wrapper_fn_name_ident = item_fn.sig.ident.clone();
+    let wrapper_fn_name_literal = wrapper_fn_name_ident.to_string();
+    // return type of wrapper function
+    let wrapper_fn_return = item_fn.sig.output.clone();
+    // visibility of wrapper function
+    let wrapper_fn_visibility = item_fn.vis.clone();
+
+    // * define the signature of inner function
+    // name of inner function
+    let inner_fn_name_literal = format!("inner_{wrapper_fn_name_literal}");
+    let inner_fn_name_ident = syn::Ident::new(&inner_fn_name_literal, item_fn.sig.span());
+    // arguments of inner function
+    let inner_fn_inputs = item_fn.sig.inputs.clone();
+    // return type of inner function
+    let inner_fn_return = item_fn.sig.output.clone();
+    // body of inner function
+    let inner_fn_block = item_fn.block.clone();
+
+    // extract the identities of the first two arguments
+    let arg1 = match &item_fn.sig.inputs[0] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => pat_ident.ident.clone(),
+            Pat::Wild(_) => proc_macro2::Ident::new("_", proc_macro2::Span::call_site()),
+            _ => panic!("argument pattern is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("argument is a receiver"),
+    };
+    let arg2 = match &item_fn.sig.inputs[1] {
+        FnArg::Typed(PatType { pat, .. }) => match &**pat {
+            Pat::Ident(pat_ident) => pat_ident.ident.clone(),
+            Pat::Wild(_) => proc_macro2::Ident::new("_", proc_macro2::Span::call_site()),
+            _ => panic!("argument pattern is not a simple ident"),
+        },
+        FnArg::Receiver(_) => panic!("argument is a receiver"),
+    };
+
+    // extract T from Option<&mut T>
+    let ret = match item_fn.sig.inputs.len() {
+        2 => {
+            // insert the third argument
+            // let wrapper_fn_inputs = item_fn.sig.inputs.clone();
+            let mut wrapper_fn_inputs = item_fn.sig.inputs.clone();
+            wrapper_fn_inputs.push(parse_quote!(_data: *mut std::os::raw::c_void));
+
+            quote!(
+                #wrapper_fn_visibility fn #wrapper_fn_name_ident (#wrapper_fn_inputs) #wrapper_fn_return {
+                    // define inner function
+                    fn #inner_fn_name_ident (#inner_fn_inputs) #inner_fn_return {
+                        #inner_fn_block
+                    }
+
+                    #inner_fn_name_ident(#arg1, #arg2)
+                }
+            )
+        }
+        3 => {
+            let data_arg = item_fn.sig.inputs.last().unwrap().clone();
+            let ty_ptr = match &data_arg {
+                FnArg::Typed(PatType { ref ty, .. }) => match **ty {
+                    syn::Type::Reference(syn::TypeReference { ref elem, .. }) => syn::TypePtr {
+                        star_token: parse_quote!(*),
+                        const_token: None,
+                        mutability: Some(parse_quote!(mut)),
+                        elem: elem.clone(),
+                    },
+                    syn::Type::Path(syn::TypePath { ref path, .. }) => match path.segments.last() {
+                        Some(segment) => {
+                            let id = segment.ident.to_string();
+                            match id == "Option" {
+                                true => match segment.arguments {
+                                    syn::PathArguments::AngleBracketed(
+                                        syn::AngleBracketedGenericArguments { ref args, .. },
+                                    ) => {
+                                        let last_generic_arg = args.last();
+                                        match last_generic_arg {
+                                            Some(arg) => match arg {
+                                                syn::GenericArgument::Type(ty) => match ty {
+                                                    syn::Type::Reference(syn::TypeReference {
+                                                        ref elem,
+                                                        ..
+                                                    }) => syn::TypePtr {
+                                                        star_token: parse_quote!(*),
+                                                        const_token: None,
+                                                        mutability: Some(parse_quote!(mut)),
+                                                        elem: elem.clone(),
+                                                    },
+                                                    _ => panic!("Not found syn::Type::Reference"),
+                                                },
+                                                _ => {
+                                                    panic!("Not found syn::GenericArgument::Type")
+                                                }
+                                            },
+                                            None => panic!("Not found the last GenericArgument"),
+                                        }
+                                    }
+                                    _ => panic!("Not found syn::PathArguments::AngleBracketed"),
+                                },
+                                false => panic!("Not found segment ident: Option"),
+                            }
+                        }
+                        None => panic!("Not found path segments"),
+                    },
+                    _ => panic!("Unsupported syn::Type type"),
+                },
+                _ => panic!("Unsupported syn::FnArg type"),
+            };
+
+            // inputs of wrapper function
+            let mut wrapper_fn_inputs = item_fn.sig.inputs.clone();
+            wrapper_fn_inputs.pop();
+            wrapper_fn_inputs.push(parse_quote!(data: *mut std::os::raw::c_void));
+
+            // generate token stream
+            quote!(
+                #wrapper_fn_visibility fn #wrapper_fn_name_ident (#wrapper_fn_inputs) #wrapper_fn_return {
+                    // define inner function
+                    fn #inner_fn_name_ident (#inner_fn_inputs) #inner_fn_return {
+                        #inner_fn_block
+                    }
+
+                    let data = unsafe { &mut *(data as #ty_ptr) };
+
+                    #inner_fn_name_ident(#arg1, #arg2, data)
+                }
+            )
+        }
+        _ => panic!("Invalid numbers of host function arguments"),
+    };
+
+    Ok(ret)
+}
+
+// ================== macros for wasmedge-sys wasi host functions ==================
+
+#[doc(hidden)]
+#[proc_macro_attribute]
+pub fn sys_wasi_host_function(_attr: TokenStream, item: TokenStream) -> TokenStream {
+    let body_ast = parse_macro_input!(item as Item);
+    if let Item::Fn(item_fn) = body_ast {
+        match sys_expand_wasi_host_func(&item_fn) {
+            Ok(token_stream) => token_stream.into(),
+            Err(err) => err.to_compile_error().into(),
+        }
+    } else {
+        TokenStream::new()
+    }
+}
+
+fn sys_expand_wasi_host_func(item_fn: &syn::ItemFn) -> syn::Result<proc_macro2::TokenStream> {
+    // * define the signature of wrapper function
+    // name of wrapper function
+    let fn_name_ident = &item_fn.sig.ident;
+    // return type of wrapper function
+    let fn_return = &item_fn.sig.output;
+    // visibility of wrapper function
+    let fn_visibility = &item_fn.vis;
+
+    // extract T from Option<&mut T>
+    let ret = match item_fn.sig.inputs.len() {
+        3 => {
+            let fn_generics = &item_fn.sig.generics;
+
+            // inputs of wrapper function
+            let fn_inputs = &item_fn.sig.inputs;
+
+            let fn_block = item_fn.block.clone();
+
+            quote!(
+                #fn_visibility fn #fn_name_ident #fn_generics (#fn_inputs) #fn_return
+                    #fn_block
+            )
+        }
+        _ => panic!("Invalid numbers of host function arguments"),
+    };
+
+    Ok(ret)
+}
+
+#[doc(hidden)]
+#[proc_macro_attribute]
+pub fn sys_async_wasi_host_function(_attr: TokenStream, item: TokenStream) -> TokenStream {
+    let body_ast = parse_macro_input!(item as Item);
+    if let Item::Fn(item_fn) = body_ast {
+        if item_fn.sig.asyncness.is_none() {
+            panic!("The function must be async");
+        }
+
+        match sys_expand_async_wasi_host_func(&item_fn) {
+            Ok(token_stream) => token_stream.into(),
+            Err(err) => err.to_compile_error().into(),
+        }
+    } else {
+        TokenStream::new()
+    }
+}
+
+fn sys_expand_async_wasi_host_func(item_fn: &syn::ItemFn) -> syn::Result<proc_macro2::TokenStream> {
+    // extract T from Option<&mut T>
+    let ret = match &item_fn.sig.inputs.len() {
+        2 => sys_expand_async_wasi_host_func_with_two_args(item_fn),
+        3 => sys_expand_async_wasi_host_func_with_three_args(item_fn),
+        _ => panic!("Invalid numbers of host function arguments"),
+    };
+
+    Ok(ret)
+}
+
+fn sys_expand_async_wasi_host_func_with_two_args(
+    item_fn: &syn::ItemFn,
+) -> proc_macro2::TokenStream {
+    // function name
+    let fn_name_ident = &item_fn.sig.ident;
+
+    // function visibility
+    let fn_visibility = &item_fn.vis;
+
+    // generic types
+    let fn_generics = &item_fn.sig.generics;
+
+    // arguments
+    let mut fn_inputs = item_fn.sig.inputs.clone();
+    fn_inputs.push(parse_quote!(_: *mut std::os::raw::c_void));
+
+    // function body
+    let fn_block = &item_fn.block;
+
+    quote!(
+        #fn_visibility fn #fn_name_ident #fn_generics (#fn_inputs) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)> {
+            Box::new(async move {
+                #fn_block
+            })
+        }
+    )
+}
+
+fn sys_expand_async_wasi_host_func_with_three_args(
+    item_fn: &syn::ItemFn,
+) -> proc_macro2::TokenStream {
+    // function name
+    let fn_name_ident = &item_fn.sig.ident;
+
+    // function visibility
+    let fn_visibility = &item_fn.vis;
+
+    // generic types
+    let fn_generics = &item_fn.sig.generics;
+
+    // arguments
+    let fn_inputs = &item_fn.sig.inputs;
+
+    // function body
+    let fn_block = &item_fn.block;
+
+    quote!(
+        #fn_visibility fn #fn_name_ident #fn_generics (#fn_inputs) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)> {
+            Box::new(async move {
+                #fn_block
+            })
+        }
+    )
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/caller.rs.html b/src/wasmedge_sdk/caller.rs.html new file mode 100644 index 000000000..4c87c9a2a --- /dev/null +++ b/src/wasmedge_sdk/caller.rs.html @@ -0,0 +1,159 @@ +caller.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+
use crate::{Executor, Instance, Memory};
+use wasmedge_sys::CallingFrame;
+use wasmedge_types::MemoryType;
+
+/// Represents the calling frame on top of stack.
+///
+/// The [Caller] object is only used as the first argument when defining a host function. With this argument,
+/// developers can have access to the [Executor] instance, the [Instance] instance, and the [Memory] instance inside the host functions they defined.
+#[derive(Debug)]
+pub struct Caller {
+    inner: Option<CallingFrame>,
+    executor: Option<Executor>,
+    instance: Option<Instance>,
+}
+impl Caller {
+    /// Creates a Caller instance with the given [CallingFrame](wasmedge_sys::CallingFrame) instance.
+    ///
+    /// # Caller vs. CallingFrame
+    ///
+    /// `CallingFrame` is a low-level type defined in `wasmedge-sys` crate, while `Caller` is a high-level type. For developers using the APIs in `wasmedge-sdk`, they should create a `Caller` instance with the given `CallingFrame` instance, as `Caller` provides APIs to access high-level instances, such as executor and memory, related to the current calling frame.
+    ///
+    pub fn new(frame: CallingFrame) -> Self {
+        let executor = frame.executor_mut().map(|inner| Executor { inner });
+        let instance = frame.module_instance().map(|inner| Instance { inner });
+
+        Self {
+            inner: Some(frame),
+            executor,
+            instance,
+        }
+    }
+
+    /// Returns the [executor instance](crate::Executor) from this caller.
+    pub fn executor(&self) -> Option<&Executor> {
+        self.executor.as_ref()
+    }
+
+    /// Returns the mutable [executor instance](crate::Executor) from this caller.
+    pub fn executor_mut(&mut self) -> Option<&mut Executor> {
+        self.executor.as_mut()
+    }
+
+    /// Returns the [module instance](crate::Instance) in this caller.
+    pub fn instance(&self) -> Option<&Instance> {
+        self.instance.as_ref()
+    }
+
+    /// Returns the mutable [module instance](crate::Instance) in this caller.
+    pub fn instance_mut(&mut self) -> Option<&mut Instance> {
+        self.instance.as_mut()
+    }
+
+    /// Returns the [memory instance](crate::Memory) by the given index from the module instance of this caller. If
+    /// the memory instance is not found, then return `None`.
+    ///
+    /// # Arguments
+    ///
+    /// * `idx` - The index of the memory instance. By default, a WASM module has only one memory instance after instantiation. Therefore, users can pass in `0` as the index to get the memory instance in host function body. When the [MultiMemories](crate::config::CommonConfigOptions::multi_memories) config option is enabled, there would be more than one memory instances in the wasm module. Users can retrieve the target memory instance by specifying the index of the memory instance in the wasm module instance.
+    ///
+    pub fn memory(&self, idx: u32) -> Option<Memory> {
+        match self.inner.as_ref() {
+            Some(frame) => frame.memory_mut(idx).map(|inner| {
+                let ty: MemoryType = inner.ty().unwrap().into();
+                Memory {
+                    inner,
+                    name: None,
+                    mod_name: None,
+                    ty,
+                }
+            }),
+            None => None,
+        }
+    }
+}
+impl From<CallingFrame> for Caller {
+    fn from(frame: CallingFrame) -> Self {
+        Self::new(frame)
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/compiler.rs.html b/src/wasmedge_sdk/compiler.rs.html new file mode 100644 index 000000000..5e59b3b11 --- /dev/null +++ b/src/wasmedge_sdk/compiler.rs.html @@ -0,0 +1,601 @@ +compiler.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+
//! Defines WasmEdge ahead-of-time compiler.
+
+use crate::{config::Config, WasmEdgeResult};
+use std::path::{Path, PathBuf};
+use wasmedge_sys as sys;
+
+/// Defines WasmEdge ahead-of-time(AOT) compiler and the relevant APIs.
+#[derive(Debug)]
+pub struct Compiler {
+    pub(crate) inner: sys::Compiler,
+}
+impl Compiler {
+    /// Creates a new AOT compiler.
+    ///
+    /// # Error
+    ///
+    /// If fail to create a AOT compiler, then an error is returned.
+    pub fn new(config: Option<&Config>) -> WasmEdgeResult<Self> {
+        let inner = match config {
+            Some(cfg) => sys::Compiler::create(Some(&cfg.inner))?,
+            None => sys::Compiler::create(None)?,
+        };
+
+        Ok(Self { inner })
+    }
+
+    /// Compiles the given wasm file into a shared library file (*.so in Linux, *.dylib in macOS, or *.dll in Windows). The file path of the generated shared library file will be returned if the method works successfully.
+    ///
+    /// # Arguments
+    ///
+    /// * `wasm_file` - The target wasm file.
+    ///
+    /// * `filename` - The filename of the generated shared library file.
+    ///
+    /// * `out_dir` - The target directory to save the generated shared library file.
+    ///
+    /// # Error
+    ///
+    /// If fail to compile, then an error is returned.
+    pub fn compile_from_file(
+        &self,
+        wasm_file: impl AsRef<Path>,
+        filename: impl AsRef<str>,
+        out_dir: impl AsRef<Path>,
+    ) -> WasmEdgeResult<PathBuf> {
+        #[cfg(target_os = "linux")]
+        let extension = "so";
+        #[cfg(target_os = "macos")]
+        let extension = "dylib";
+        #[cfg(target_os = "windows")]
+        let extension = "dll";
+        let aot_file = out_dir
+            .as_ref()
+            .join(format!("{}.{}", filename.as_ref(), extension));
+        self.inner.compile_from_file(wasm_file, &aot_file)?;
+
+        Ok(aot_file)
+    }
+
+    /// Compiles the given wasm bytes into a shared library file (*.so in Linux, *.dylib in macOS, or *.dll in Windows). The file path of the generated shared library file will be returned if the method works successfully.
+    ///
+    /// # Argument
+    ///
+    /// * `bytes` - A in-memory WASM bytes.
+    ///
+    /// * `filename` - The filename of the generated shared library file.
+    ///
+    /// * `out_dir` - The target directory to save the generated shared library file.
+    ///
+    /// # Error
+    ///
+    /// If fail to compile, then an error is returned.
+    pub fn compile_from_bytes(
+        &self,
+        bytes: impl AsRef<[u8]>,
+        filename: impl AsRef<str>,
+        out_dir: impl AsRef<Path>,
+    ) -> WasmEdgeResult<PathBuf> {
+        #[cfg(target_os = "linux")]
+        let extension = "so";
+        #[cfg(target_os = "macos")]
+        let extension = "dylib";
+        #[cfg(target_os = "windows")]
+        let extension = "dll";
+        let aot_file = out_dir
+            .as_ref()
+            .join(format!("{}.{}", filename.as_ref(), extension));
+        self.inner.compile_from_bytes(bytes, &aot_file)?;
+
+        Ok(aot_file)
+    }
+}
+
+#[cfg(not(feature = "async"))]
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        config::{CompilerConfigOptions, ConfigBuilder},
+        params, wat2wasm, CompilerOutputFormat, VmBuilder, WasmVal,
+    };
+    use std::io::Read;
+
+    #[test]
+    fn test_compiler_compile_from_file() -> Result<(), Box<dyn std::error::Error>> {
+        // compile from file
+        {
+            let config = ConfigBuilder::default()
+                .with_compiler_config(
+                    CompilerConfigOptions::new().out_format(CompilerOutputFormat::Native),
+                )
+                .build()?;
+
+            let compiler = Compiler::new(Some(&config))?;
+            let wasm_file = std::env::current_dir()
+                .unwrap()
+                .join("examples/wasmedge-sys/data/fibonacci.wat");
+            let out_dir = std::env::current_dir()?;
+            let aot_filename = "aot_fibonacci_1";
+            let aot_file_path = compiler.compile_from_file(wasm_file, aot_filename, out_dir)?;
+            assert!(aot_file_path.exists());
+            #[cfg(target_os = "macos")]
+            assert!(aot_file_path.ends_with("aot_fibonacci_1.dylib"));
+            #[cfg(target_os = "linux")]
+            assert!(aot_file_path.ends_with("aot_fibonacci_1.so"));
+            #[cfg(target_os = "windows")]
+            assert!(aot_file_path.ends_with("aot_fibonacci_1.dll"));
+
+            // read buffer
+            let mut aot_file = std::fs::File::open(&aot_file_path)?;
+            let mut buffer = [0u8; 4];
+            aot_file.read_exact(&mut buffer)?;
+            let wasm_magic: [u8; 4] = [0x00, 0x61, 0x73, 0x6D];
+            assert_ne!(buffer, wasm_magic);
+
+            let res =
+                VmBuilder::new()
+                    .build()?
+                    .run_func_from_file(&aot_file_path, "fib", params!(5))?;
+            assert_eq!(res[0].to_i32(), 8);
+
+            // cleanup
+            assert!(std::fs::remove_file(aot_file_path).is_ok());
+        }
+
+        // compile from bytes
+        {
+            let wasm_bytes = wat2wasm(
+                br#"(module
+                    (type (;0;) (func (param i32) (result i32)))
+                    (type (;1;) (func))
+                    (func (;0;) (type 0) (param i32) (result i32)
+                      (local i32 i32 i32)
+                      i32.const 1
+                      local.set 1
+                      block  ;; label = @1
+                        local.get 0
+                        i32.const 2
+                        i32.lt_s
+                        br_if 0 (;@1;)
+                        local.get 0
+                        i32.const -1
+                        i32.add
+                        local.tee 1
+                        i32.const 7
+                        i32.and
+                        local.set 2
+                        block  ;; label = @2
+                          block  ;; label = @3
+                            local.get 0
+                            i32.const -2
+                            i32.add
+                            i32.const 7
+                            i32.ge_u
+                            br_if 0 (;@3;)
+                            i32.const 1
+                            local.set 0
+                            i32.const 1
+                            local.set 1
+                            br 1 (;@2;)
+                          end
+                          local.get 1
+                          i32.const -8
+                          i32.and
+                          local.set 3
+                          i32.const 1
+                          local.set 0
+                          i32.const 1
+                          local.set 1
+                          loop  ;; label = @3
+                            local.get 1
+                            local.get 0
+                            i32.add
+                            local.tee 0
+                            local.get 1
+                            i32.add
+                            local.tee 1
+                            local.get 0
+                            i32.add
+                            local.tee 0
+                            local.get 1
+                            i32.add
+                            local.tee 1
+                            local.get 0
+                            i32.add
+                            local.tee 0
+                            local.get 1
+                            i32.add
+                            local.tee 1
+                            local.get 0
+                            i32.add
+                            local.tee 0
+                            local.get 1
+                            i32.add
+                            local.set 1
+                            local.get 3
+                            i32.const -8
+                            i32.add
+                            local.tee 3
+                            br_if 0 (;@3;)
+                          end
+                        end
+                        local.get 2
+                        i32.eqz
+                        br_if 0 (;@1;)
+                        local.get 1
+                        local.set 3
+                        loop  ;; label = @2
+                          local.get 3
+                          local.get 0
+                          i32.add
+                          local.set 1
+                          local.get 3
+                          local.set 0
+                          local.get 1
+                          local.set 3
+                          local.get 2
+                          i32.const -1
+                          i32.add
+                          local.tee 2
+                          br_if 0 (;@2;)
+                        end
+                      end
+                      local.get 1)
+                    (func (;1;) (type 1))
+                    (func (;2;) (type 1)
+                      call 1
+                      call 1)
+                    (func (;3;) (type 0) (param i32) (result i32)
+                      local.get 0
+                      call 0
+                      call 2)
+                    (table (;0;) 1 1 funcref)
+                    (memory (;0;) 16)
+                    (global (;0;) (mut i32) (i32.const 1048576))
+                    (export "memory" (memory 0))
+                    (export "fib" (func 3)))
+              "#,
+            )?;
+
+            // create a aot compiler
+            let config = ConfigBuilder::default()
+                .with_compiler_config(
+                    CompilerConfigOptions::new().out_format(CompilerOutputFormat::Native),
+                )
+                .build()?;
+            let compiler = Compiler::new(Some(&config))?;
+
+            // compile wasm bytes into a shared library file
+            let out_dir = std::env::current_dir()?;
+            let aot_filename = "aot_fibonacci_2";
+            let aot_file_path = compiler.compile_from_bytes(wasm_bytes, aot_filename, out_dir)?;
+            assert!(aot_file_path.exists());
+            #[cfg(target_os = "macos")]
+            assert!(aot_file_path.ends_with("aot_fibonacci_2.dylib"));
+            #[cfg(target_os = "linux")]
+            assert!(aot_file_path.ends_with("aot_fibonacci_2.so"));
+            #[cfg(target_os = "windows")]
+            assert!(aot_file_path.ends_with("aot_fibonacci_2.dll"));
+
+            // read buffer
+            let mut aot_file = std::fs::File::open(&aot_file_path)?;
+            let mut buffer = [0u8; 4];
+            aot_file.read_exact(&mut buffer)?;
+            let wasm_magic: [u8; 4] = [0x00, 0x61, 0x73, 0x6D];
+            assert_ne!(buffer, wasm_magic);
+
+            let res =
+                VmBuilder::new()
+                    .build()?
+                    .run_func_from_file(&aot_file_path, "fib", params!(5))?;
+            assert_eq!(res[0].to_i32(), 8);
+
+            // cleanup
+            assert!(std::fs::remove_file(aot_file_path).is_ok());
+        }
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/config.rs.html b/src/wasmedge_sdk/config.rs.html new file mode 100644 index 000000000..ff9c14a78 --- /dev/null +++ b/src/wasmedge_sdk/config.rs.html @@ -0,0 +1,1757 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+
//! Defines the structs used to construct configurations.
+
+use crate::WasmEdgeResult;
+#[cfg(feature = "aot")]
+use crate::{CompilerOptimizationLevel, CompilerOutputFormat};
+use wasmedge_sys as sys;
+
+/// Defines a builder for creating a [Config].
+#[derive(Debug, Default)]
+pub struct ConfigBuilder {
+    common_config: CommonConfigOptions,
+    stat_config: Option<StatisticsConfigOptions>,
+    #[cfg(feature = "aot")]
+    compiler_config: Option<CompilerConfigOptions>,
+    runtime_config: Option<RuntimeConfigOptions>,
+    host_config: Option<HostRegistrationConfigOptions>,
+}
+impl ConfigBuilder {
+    /// Creates a new [ConfigBuilder] with the given [CommonConfigOptions] setting.
+    pub fn new(options: CommonConfigOptions) -> Self {
+        Self {
+            common_config: options,
+            stat_config: None,
+            #[cfg(feature = "aot")]
+            compiler_config: None,
+            runtime_config: None,
+            host_config: None,
+        }
+    }
+
+    /// Sets the [StatisticsConfigOptions] for the [ConfigBuilder].
+    ///
+    /// # Argument
+    ///
+    /// - `options` specifies the [StatisticsConfigOptions] settings to set.
+    pub fn with_statistics_config(self, options: StatisticsConfigOptions) -> Self {
+        Self {
+            stat_config: Some(options),
+            ..self
+        }
+    }
+
+    /// Sets the [RuntimeConfigOptions] for the [ConfigBuilder].
+    ///
+    /// # Argument
+    ///
+    /// - `options` specifies the [RuntimeConfigOptions] settings to set.
+    pub fn with_runtime_config(self, options: RuntimeConfigOptions) -> Self {
+        Self {
+            runtime_config: Some(options),
+            ..self
+        }
+    }
+
+    /// Sets the [CompilerConfigOptions] for the [ConfigBuilder].
+    ///
+    /// # Argument
+    ///
+    /// - `options` specifies the [CompilerConfigOptions] settings to set.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn with_compiler_config(self, options: CompilerConfigOptions) -> Self {
+        Self {
+            compiler_config: Some(options),
+            ..self
+        }
+    }
+
+    /// Sets the [HostRegistrationConfigOptions] for the [ConfigBuilder].
+    ///
+    /// # Argument
+    ///
+    /// - `options` specifies the [HostRegistrationConfigOptions] settings to set.
+    pub fn with_host_registration_config(self, options: HostRegistrationConfigOptions) -> Self {
+        Self {
+            host_config: Some(options),
+            ..self
+        }
+    }
+
+    /// Creates a new [Config] from the [ConfigBuilder].
+    ///
+    /// # Errors
+    ///
+    /// If fail to create a [Config], then an error is returned.
+    pub fn build(self) -> WasmEdgeResult<Config> {
+        let mut inner = sys::Config::create()?;
+        inner.mutable_globals(self.common_config.mutable_globals);
+        inner.non_trap_conversions(self.common_config.non_trap_conversions);
+        inner.sign_extension_operators(self.common_config.sign_extension_operators);
+        inner.multi_value(self.common_config.multi_value);
+        inner.bulk_memory_operations(self.common_config.bulk_memory_operations);
+        inner.reference_types(self.common_config.reference_types);
+        inner.simd(self.common_config.simd);
+        inner.multi_memories(self.common_config.multi_memories);
+        inner.threads(self.common_config.threads);
+        inner.tail_call(self.common_config.tail_call);
+        inner.function_references(self.common_config.function_references);
+        inner.interpreter_mode(self.common_config.interpreter_mode);
+
+        if let Some(stat_config) = self.stat_config {
+            inner.count_instructions(stat_config.count_instructions);
+            inner.measure_cost(stat_config.measure_cost);
+            inner.measure_time(stat_config.measure_time);
+        }
+        #[cfg(feature = "aot")]
+        if let Some(compiler_config) = self.compiler_config {
+            inner.set_aot_compiler_output_format(compiler_config.out_format);
+            inner.set_aot_optimization_level(compiler_config.opt_level);
+            inner.dump_ir(compiler_config.dump_ir);
+            inner.generic_binary(compiler_config.generic_binary);
+            inner.interruptible(compiler_config.interruptible);
+        }
+        if let Some(runtim_config) = self.runtime_config {
+            inner.set_max_memory_pages(runtim_config.max_memory_pages);
+        }
+        if let Some(host_config) = self.host_config {
+            inner.wasi(host_config.wasi);
+        }
+
+        Ok(Config { inner })
+    }
+}
+
+/// Defines [Config] struct used to check/set the configuration options.
+///
+/// # Example
+///
+/// The following code shows how to create a [Config] with [ConfigBuilder].
+///
+/// ```rust
+///
+/// use wasmedge_sdk::{config::{Config, ConfigBuilder, CommonConfigOptions, StatisticsConfigOptions, RuntimeConfigOptions, HostRegistrationConfigOptions}};
+/// use wasmedge_types::{CompilerOutputFormat, CompilerOptimizationLevel};
+///
+/// let common_options = CommonConfigOptions::default()
+///     .bulk_memory_operations(true)
+///     .multi_value(true)
+///     .mutable_globals(true)
+///     .non_trap_conversions(true)
+///     .reference_types(true)
+///     .sign_extension_operators(true)
+///     .simd(true);
+///
+/// let stat_options = StatisticsConfigOptions::default()
+///     .count_instructions(true)
+///     .measure_cost(true)
+///     .measure_time(true);
+///
+/// let runtime_options = RuntimeConfigOptions::default().max_memory_pages(1024);
+///
+/// let host_options = HostRegistrationConfigOptions::default()
+///     .wasi(true);
+///
+/// let result = ConfigBuilder::new(common_options)
+///     .with_statistics_config(stat_options)
+///     .with_runtime_config(runtime_options)
+///     .with_host_registration_config(host_options)
+///     .build();
+/// assert!(result.is_ok());
+/// let config = result.unwrap();
+/// ```
+#[derive(Debug, Clone)]
+pub struct Config {
+    pub(crate) inner: sys::Config,
+}
+impl Config {
+    /// Checks if the host registration wasi option turns on or not.
+    pub fn wasi_enabled(&self) -> bool {
+        self.inner.wasi_enabled()
+    }
+
+    /// Returns the number of the memory pages available.
+    pub fn max_memory_pages(&self) -> u32 {
+        self.inner.get_max_memory_pages()
+    }
+
+    /// Checks if the ImportExportMutGlobals option turns on or not.
+    pub fn mutable_globals_enabled(&self) -> bool {
+        self.inner.mutable_globals_enabled()
+    }
+
+    /// Checks if the NonTrapFloatToIntConversions option turns on or not.
+    pub fn non_trap_conversions_enabled(&self) -> bool {
+        self.inner.non_trap_conversions_enabled()
+    }
+
+    /// Checks if the SignExtensionOperators option turns on or not.
+    pub fn sign_extension_operators_enabled(&self) -> bool {
+        self.inner.sign_extension_operators_enabled()
+    }
+
+    /// Checks if the MultiValue option turns on or not.
+    pub fn multi_value_enabled(&self) -> bool {
+        self.inner.multi_value_enabled()
+    }
+
+    /// Checks if the BulkMemoryOperations option turns on or not.
+    pub fn bulk_memory_operations_enabled(&self) -> bool {
+        self.inner.bulk_memory_operations_enabled()
+    }
+
+    /// Checks if the ReferenceTypes option turns on or not.
+    pub fn reference_types_enabled(&self) -> bool {
+        self.inner.reference_types_enabled()
+    }
+
+    /// Checks if the SIMD option turns on or not.
+    pub fn simd_enabled(&self) -> bool {
+        self.inner.simd_enabled()
+    }
+
+    /// Checks if the MultiMemories option turns on or not.
+    pub fn multi_memories_enabled(&self) -> bool {
+        self.inner.multi_memories_enabled()
+    }
+
+    /// Checks if the Threads option turns on or not.
+    pub fn threads_enabled(&self) -> bool {
+        self.inner.threads_enabled()
+    }
+
+    /// Checks if the TailCall option turns on or not.
+    pub fn tail_call_enabled(&self) -> bool {
+        self.inner.tail_call_enabled()
+    }
+
+    /// Checks if the FunctionReferences option turns on or not.
+    pub fn function_references_enabled(&self) -> bool {
+        self.inner.function_references_enabled()
+    }
+
+    /// Checks if the `ForceInterpreter` option turns on or not.
+    pub fn interpreter_mode_enabled(&self) -> bool {
+        self.inner.interpreter_mode_enabled()
+    }
+
+    /// Returns the optimization level of AOT compiler.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn optimization_level(&self) -> CompilerOptimizationLevel {
+        self.inner.get_aot_optimization_level()
+    }
+
+    /// Returns the output binary format of AOT compiler.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn out_format(&self) -> CompilerOutputFormat {
+        self.inner.get_aot_compiler_output_format()
+    }
+
+    /// Checks if the dump IR option turns on or not.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn dump_ir_enabled(&self) -> bool {
+        self.inner.dump_ir_enabled()
+    }
+
+    /// Checks if the generic binary option of AOT compiler turns on or not.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn generic_binary_enabled(&self) -> bool {
+        self.inner.generic_binary_enabled()
+    }
+
+    /// Checks if the `Interruptible` option of AOT Compiler turns on or not.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn interruptible_enabled(&self) -> bool {
+        self.inner.interruptible_enabled()
+    }
+
+    /// Checks if the instruction counting option turns on or not.
+    pub fn instruction_counting_enabled(&self) -> bool {
+        self.inner.is_instruction_counting()
+    }
+
+    /// Checks if the cost measuring option turns on or not.
+    pub fn cost_measuring_enabled(&self) -> bool {
+        self.inner.is_cost_measuring()
+    }
+
+    /// Checks if the cost measuring option turns on or not.
+    pub fn time_measuring_enabled(&self) -> bool {
+        self.inner.is_time_measuring()
+    }
+}
+
+/// Defines the common configuration options.
+///
+/// [CommonConfigOptions] is used to set the common configuration options, which are
+///     
+///  - `ImportExportMutGlobals` supports mutable imported and exported globals.
+///
+///    Also see [Import/Export Mutable Globals Proposal](https://github.com/WebAssembly/mutable-global/blob/master/proposals/mutable-global/Overview.md#importexport-mutable-globals).
+///
+///  - `NonTrapFloatToIntConversions` supports the non-trapping float-to-int conversion.
+///
+///    Also see [Non-trapping Float-to-int Conversions Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/nontrapping-float-to-int-conversion/Overview.md).
+///
+///  - `SignExtensionOperators` supports new integer instructions for sign-extending 8-bit, 16-bit, and 32-bit values.
+///     
+///    Also see [Sign-extension Operators Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/sign-extension-ops/Overview.md).
+///
+///  - `MultiValue` supports functions and instructions with multiple return values, and blocks with inputs.
+///     
+///    Also see [Multi-value Extension](https://github.com/WebAssembly/spec/blob/main/proposals/multi-value/Overview.md).
+///
+///  - `BulkMemoryOperations` supports bulk memory operations.
+///
+///    Also see [Bulk Memory Operations Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/bulk-memory-operations/Overview.md#motivation-for-bulk-memory-operations).
+///
+///  - `ReferenceTypes` supports reference types.
+///
+///    Also see [Reference Types Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/reference-types/Overview.md).
+///
+///  - `SIMD` supports 128-bit packed SIMD extension to WebAssembly.
+///
+///    Also see [SIMD Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/simd/SIMD.md).
+#[derive(Debug, Clone, Copy)]
+pub struct CommonConfigOptions {
+    mutable_globals: bool,
+    non_trap_conversions: bool,
+    sign_extension_operators: bool,
+    multi_value: bool,
+    bulk_memory_operations: bool,
+    reference_types: bool,
+    simd: bool,
+    multi_memories: bool,
+    threads: bool,
+    tail_call: bool,
+    function_references: bool,
+    interpreter_mode: bool,
+}
+impl CommonConfigOptions {
+    /// Creates a new instance of [CommonConfigOptions].
+    ///
+    /// The default options are:
+    /// * mutable_globals: true,
+    /// * non_trap_conversions: true,
+    /// * sign_extension_operators: true,
+    /// * multi_value: true,
+    /// * bulk_memory_operations: true,
+    /// * reference_types: true,
+    /// * simd: true,
+    /// * multi_memories: false,
+    /// * threads: false,
+    /// * tail_call: false,
+    /// * function_references: false,
+    /// * interpreter_mode: false,
+    pub fn new() -> Self {
+        Self {
+            mutable_globals: true,
+            non_trap_conversions: true,
+            sign_extension_operators: true,
+            multi_value: true,
+            bulk_memory_operations: true,
+            reference_types: true,
+            simd: true,
+            multi_memories: false,
+            threads: false,
+            tail_call: false,
+            function_references: false,
+            interpreter_mode: false,
+        }
+    }
+
+    /// Enables or disables the ImportExportMutGlobals option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn mutable_globals(self, enable: bool) -> Self {
+        Self {
+            mutable_globals: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the NonTrapFloatToIntConversions option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn non_trap_conversions(self, enable: bool) -> Self {
+        Self {
+            non_trap_conversions: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the SignExtensionOperators option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn sign_extension_operators(self, enable: bool) -> Self {
+        Self {
+            sign_extension_operators: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the MultiValue option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn multi_value(self, enable: bool) -> Self {
+        Self {
+            multi_value: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the BulkMemoryOperations option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn bulk_memory_operations(self, enable: bool) -> Self {
+        Self {
+            bulk_memory_operations: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the ReferenceTypes option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn reference_types(self, enable: bool) -> Self {
+        Self {
+            reference_types: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the SIMD option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn simd(self, enable: bool) -> Self {
+        Self {
+            simd: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the MultiMemories option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn multi_memories(self, enable: bool) -> Self {
+        Self {
+            multi_memories: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the Threads option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn threads(self, enable: bool) -> Self {
+        Self {
+            threads: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the TailCall option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn tail_call(self, enable: bool) -> Self {
+        Self {
+            tail_call: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the FunctionReferences option.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn function_references(self, enable: bool) -> Self {
+        Self {
+            function_references: enable,
+            ..self
+        }
+    }
+
+    /// Enables or disables the `ForceInterpreter` option.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn interpreter_mode(self, enable: bool) -> Self {
+        Self {
+            interpreter_mode: enable,
+            ..self
+        }
+    }
+}
+impl Default for CommonConfigOptions {
+    /// Creates a new default instance of [CommonConfigOptions].
+    ///
+    /// The default options are:
+    /// * mutable_globals: true,
+    /// * non_trap_conversions: true,
+    /// * sign_extension_operators: true,
+    /// * multi_value: true,
+    /// * bulk_memory_operations: true,
+    /// * reference_types: true,
+    /// * simd: true,
+    /// * multi_memories: false,
+    /// * threads: false,
+    /// * tail_call: false,
+    /// * function_references: false,
+    /// * interpreter_mode: false,
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+/// Defines a group of configuration options for AOT compiler.
+///
+/// [CompilerConfigOptions] is used to set the AOT compiler related configuration options, which are
+///
+///  - Compiler Optimization Levels
+///    - `O0` performs as many optimizations as possible.
+///    
+///    - `O1` optimizes quickly without destroying debuggability  
+///    - `02` optimizes for fast execution as much as possible without triggering significant incremental
+///           compile time or code size growth  
+///    - `O3` optimizes for fast execution as much as possible  
+///    - `Os` optimizes for small code size as much as possible without triggering significant incremental
+///           compile time or execution time slowdowns  
+///    - `Oz` optimizes for small code size as much as possible  
+///  - Compiler Output Formats
+///    - `Native` specifies the output format is native dynamic library (`*.wasm.so`)  
+///    - `Wasm` specifies the output format is WebAssembly with AOT compiled codes in custom section (`*.wasm`).
+///  
+///  - `dump_ir` determines if AOT compiler generates IR or not  
+///  - `generic_binary` determines if AOT compiler generates the generic binary or not.
+///  - `interruptible` determines if AOT compiler generates interruptible binary or not.
+///  
+///  The configuration options above are only effective to [AOT compiler](crate::Compiler).
+#[cfg(feature = "aot")]
+#[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+#[derive(Debug, Clone, Copy)]
+pub struct CompilerConfigOptions {
+    out_format: CompilerOutputFormat,
+    opt_level: CompilerOptimizationLevel,
+    dump_ir: bool,
+    generic_binary: bool,
+    interruptible: bool,
+}
+#[cfg(feature = "aot")]
+#[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+impl CompilerConfigOptions {
+    /// Creates a new instance of [CompilerConfigOptions].
+    pub fn new() -> Self {
+        Self {
+            out_format: CompilerOutputFormat::Wasm,
+            opt_level: CompilerOptimizationLevel::O3,
+            dump_ir: false,
+            generic_binary: false,
+            interruptible: false,
+        }
+    }
+
+    /// Sets the output binary format of AOT compiler.
+    ///
+    /// # Argument
+    ///
+    /// - `format` specifies the format of the output binary.
+    pub fn out_format(self, format: CompilerOutputFormat) -> Self {
+        Self {
+            out_format: format,
+            ..self
+        }
+    }
+
+    /// Sets the optimization level of AOT compiler.
+    ///
+    /// # Argument
+    ///
+    /// - `level` specifies the optimization level of AOT compiler.
+    pub fn optimization_level(self, level: CompilerOptimizationLevel) -> Self {
+        Self {
+            opt_level: level,
+            ..self
+        }
+    }
+
+    /// Sets the dump IR option of AOT compiler.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if dump ir or not.
+    pub fn dump_ir(self, enable: bool) -> Self {
+        Self {
+            dump_ir: enable,
+            ..self
+        }
+    }
+
+    /// Sets the generic binary option of AOT compiler.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if generate the generic binary or not when perform AOT compilation.
+    pub fn generic_binary(self, enable: bool) -> Self {
+        Self {
+            generic_binary: enable,
+            ..self
+        }
+    }
+
+    /// Enables or Disables the `Interruptible` option of AOT compiler.
+    ///
+    /// This option determines to generate interruptible binary or not when compilation in AOT compiler.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if turn on the `Interruptible` option.
+    pub fn interruptible(self, enable: bool) -> Self {
+        Self {
+            interruptible: enable,
+            ..self
+        }
+    }
+}
+#[cfg(feature = "aot")]
+#[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+impl Default for CompilerConfigOptions {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+/// Defines a group of runtime configuration options.
+///
+/// [RuntimeConfigOptions] is used to set the runtime configuration options, which are
+///
+/// - `maximum_memory_page` limits the page size of [Memory](crate::Memory). This option is only effective to
+///       [Executor](crate::Executor).
+#[derive(Debug, Clone, Copy)]
+pub struct RuntimeConfigOptions {
+    max_memory_pages: u32,
+}
+impl RuntimeConfigOptions {
+    /// Creates a new instance of [RuntimeConfigOptions].
+    pub fn new() -> Self {
+        Self {
+            max_memory_pages: 65536,
+        }
+    }
+
+    /// Sets the maximum number of the memory pages available.
+    ///
+    /// # Argument
+    ///
+    /// - `count` specifies the page count (64KB per page).
+    pub fn max_memory_pages(self, count: u32) -> Self {
+        Self {
+            max_memory_pages: count,
+        }
+    }
+}
+impl Default for RuntimeConfigOptions {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+/// Defines a group of the statistics configuration options.
+///
+/// [StatisticsConfigOptions] is used to set the statistics configuration options, which are
+///
+///  - `count_instructions` determines if measuring the count of instructions when running a compiled or pure WASM.
+///   
+///  - `measure_cost` determines if measuring the instruction costs when running a compiled or pure WASM.
+///   
+///  - `measure_time` determines if measuring the running time when running a compiled or pure WASM.
+#[derive(Debug, Default, Clone, Copy)]
+pub struct StatisticsConfigOptions {
+    count_instructions: bool,
+    measure_cost: bool,
+    measure_time: bool,
+}
+impl StatisticsConfigOptions {
+    /// Creates a new instance of [StatisticsConfigOptions].
+    pub fn new() -> Self {
+        Self::default()
+    }
+
+    /// Sets the instruction counting option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if support instruction counting or not when execution after AOT compilation.
+    pub fn count_instructions(self, enable: bool) -> Self {
+        Self {
+            count_instructions: enable,
+            ..self
+        }
+    }
+
+    /// Sets the cost measuring option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if support cost measuring or not when execution after AOT compilation.
+    pub fn measure_cost(self, enable: bool) -> Self {
+        Self {
+            measure_cost: enable,
+            ..self
+        }
+    }
+
+    /// Sets the time measuring option.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if support time measuring or not when execution after AOT compilation.
+    pub fn measure_time(self, enable: bool) -> Self {
+        Self {
+            measure_time: enable,
+            ..self
+        }
+    }
+}
+
+/// Defines the host registration configuration options.
+///
+/// [HostRegistrationConfigOptions] is used to set the host registration configuration options, which are
+///
+///   - `Wasi` turns on the `WASI` support.
+#[derive(Debug, Default, Clone, Copy)]
+pub struct HostRegistrationConfigOptions {
+    wasi: bool,
+}
+impl HostRegistrationConfigOptions {
+    /// Creates a new instance of [HostRegistrationConfigOptions].
+    pub fn new() -> Self {
+        Self::default()
+    }
+
+    /// Enables or disables host registration wasi.
+    ///
+    /// # Argument
+    ///
+    /// - `enable` specifies if the option turns on or not.
+    pub fn wasi(self, enable: bool) -> Self {
+        Self { wasi: enable }
+    }
+}
+
+#[cfg(test)]
+#[cfg(feature = "aot")]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_config_create() {
+        let common_options = CommonConfigOptions::default()
+            .bulk_memory_operations(true)
+            .multi_value(true)
+            .mutable_globals(true)
+            .non_trap_conversions(true)
+            .reference_types(true)
+            .sign_extension_operators(true)
+            .simd(true)
+            .multi_memories(true)
+            .interpreter_mode(true);
+
+        let compiler_options = CompilerConfigOptions::default()
+            .dump_ir(true)
+            .generic_binary(true)
+            .interruptible(true)
+            .optimization_level(CompilerOptimizationLevel::O0)
+            .out_format(CompilerOutputFormat::Native);
+
+        let stat_options = StatisticsConfigOptions::default()
+            .count_instructions(true)
+            .measure_cost(true)
+            .measure_time(true);
+
+        let runtime_options = RuntimeConfigOptions::default().max_memory_pages(1024);
+
+        let host_options = HostRegistrationConfigOptions::default().wasi(true);
+
+        let result = ConfigBuilder::new(common_options)
+            .with_statistics_config(stat_options)
+            .with_compiler_config(compiler_options)
+            .with_runtime_config(runtime_options)
+            .with_host_registration_config(host_options)
+            .build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        // check common config options
+        assert!(config.bulk_memory_operations_enabled());
+        assert!(config.multi_value_enabled());
+        assert!(config.mutable_globals_enabled());
+        assert!(config.non_trap_conversions_enabled());
+        assert!(config.reference_types_enabled());
+        assert!(config.sign_extension_operators_enabled());
+        assert!(config.simd_enabled());
+        assert!(config.multi_memories_enabled());
+        assert!(config.interpreter_mode_enabled());
+
+        // check compiler config options
+        assert!(config.dump_ir_enabled());
+        assert!(config.generic_binary_enabled());
+        assert!(config.interruptible_enabled());
+        assert_eq!(config.optimization_level(), CompilerOptimizationLevel::O0);
+        assert_eq!(config.out_format(), CompilerOutputFormat::Native);
+
+        // check statistics config options
+        assert!(config.instruction_counting_enabled());
+        assert!(config.cost_measuring_enabled());
+        assert!(config.time_measuring_enabled());
+
+        // check runtime config options
+        assert_eq!(config.max_memory_pages(), 1024);
+
+        assert!(config.wasi_enabled());
+    }
+
+    #[test]
+    fn test_config_copy() {
+        let common_config = CommonConfigOptions::default()
+            .simd(false)
+            .multi_memories(true);
+        let compiler_config =
+            CompilerConfigOptions::default().optimization_level(CompilerOptimizationLevel::O0);
+        let stat_config = StatisticsConfigOptions::default().measure_time(false);
+        let runtime_config = RuntimeConfigOptions::default().max_memory_pages(1024);
+        let host_config = HostRegistrationConfigOptions::default().wasi(true);
+
+        let result = ConfigBuilder::new(common_config)
+            .with_statistics_config(stat_config)
+            .with_compiler_config(compiler_config)
+            .with_runtime_config(runtime_config)
+            .with_host_registration_config(host_config)
+            .build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+        assert!(!config.simd_enabled());
+        assert!(config.multi_memories_enabled());
+        assert_eq!(config.optimization_level(), CompilerOptimizationLevel::O0);
+        assert!(!config.time_measuring_enabled());
+        assert_eq!(config.max_memory_pages(), 1024);
+        assert!(config.wasi_enabled());
+
+        // make a copy
+        let config_copied = config.clone();
+        assert!(!config_copied.simd_enabled());
+        assert!(config_copied.multi_memories_enabled());
+        assert_eq!(
+            config_copied.optimization_level(),
+            CompilerOptimizationLevel::O0
+        );
+        assert!(!config.time_measuring_enabled());
+        assert_eq!(config_copied.max_memory_pages(), 1024);
+        assert!(config_copied.wasi_enabled());
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/dock.rs.html b/src/wasmedge_sdk/dock.rs.html new file mode 100644 index 000000000..9e064a4e7 --- /dev/null +++ b/src/wasmedge_sdk/dock.rs.html @@ -0,0 +1,1001 @@ +dock.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+
//! Defines WasmEdge VmDock and Param types.
+
+use crate::{error::WasmEdgeError, params, Memory, Vm, WasmEdgeResult, WasmVal, WasmValue};
+use num_derive::FromPrimitive;
+use num_traits::FromPrimitive;
+use std::any::Any;
+
+/// Extends a [Vm](crate::Vm) instance by supporting function arguments of Rust built-in types.
+#[derive(Debug)]
+pub struct VmDock {
+    pub(crate) vm: Box<Vm>, // Can't use Arc because vm can be get_mut after cloned for hostfunc
+}
+impl VmDock {
+    /// Creates a new [VmDock] to be associated with the given [Vm](crate::Vm).
+    ///
+    /// # Arguments
+    ///
+    /// * `vm` - The [Vm] instance to be extended.
+    ///
+    pub fn new(vm: Vm) -> Self {
+        VmDock { vm: Box::new(vm) }
+    }
+
+    /// Runs an exported WASM function registered in a named or active module.
+    ///
+    /// # Arguments
+    ///
+    /// * `func_name` - The name of the exported WASM function to run.
+    ///
+    /// * `params` - The parameter values passed to the exported WASM function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the WASM function, then an error is returned.
+    pub fn run_func(
+        &self,
+        func_name: impl AsRef<str>,
+        params: Vec<Param>,
+    ) -> WasmEdgeResult<Result<Vec<Box<dyn Any + Send + Sync>>, String>> {
+        let inputs_count = params.len() as i32;
+
+        // allocate new frame for passing pointers
+        let pointer_of_pointers = match self.alloc(None, params!(inputs_count * 4 * 2)) {
+            Ok(res) => res[0].to_i32(),
+            Err(err) => {
+                return Err(err);
+            }
+        };
+
+        let mut memory = self.vm.active_module()?.memory("memory")?;
+
+        for (pos, param) in params.iter().enumerate() {
+            let sr = param.settle(self, &mut memory);
+            let (pointer, length_of_input) = match sr {
+                Ok(r) => (r.0, r.1),
+                Err(e) => {
+                    println!("run_wasm error: {}", func_name.as_ref());
+                    return Err(e);
+                }
+            };
+
+            memory.write(
+                pointer.to_le_bytes(),
+                pointer_of_pointers as u32 + pos as u32 * 4 * 2,
+            )?;
+            memory.write(
+                length_of_input.to_le_bytes(),
+                pointer_of_pointers as u32 + pos as u32 * 4 * 2 + 4,
+            )?;
+        }
+
+        // call host function
+        let rets = self
+            .vm
+            .run_func(None, func_name, params!(pointer_of_pointers, inputs_count))?;
+
+        let rvec = memory.read(rets[0].to_i32() as u32, 9)?;
+        self.free(None, params!(rets[0].to_i32(), 9))?;
+
+        let flag = rvec[0];
+        let ret_pointer = i32::from_le_bytes(rvec[1..5].try_into().unwrap());
+        let ret_len = i32::from_le_bytes(rvec[5..9].try_into().unwrap());
+
+        match flag {
+            0 => Ok(Ok(self.parse_result(ret_pointer, ret_len)?)),
+            _ => Ok(Err(self.parse_error(ret_pointer, ret_len)?)),
+        }
+    }
+
+    fn parse_error(&self, ret_pointer: i32, ret_len: i32) -> WasmEdgeResult<String> {
+        let memory = self.vm.active_module()?.memory("memory")?;
+        let err_bytes = memory.read(ret_pointer as u32, ret_len as u32)?;
+        self.free(None, params!(ret_pointer, ret_len))?;
+        Ok(String::from_utf8(err_bytes).map_err(WasmEdgeError::FromUtf8)?)
+    }
+
+    fn parse_result(
+        &self,
+        ret_pointer: i32,
+        ret_len: i32,
+    ) -> WasmEdgeResult<Vec<Box<dyn Any + Send + Sync>>> {
+        let size = ret_len as usize;
+        let memory = self.vm.active_module().unwrap().memory("memory").unwrap();
+        let p_data = memory
+            .read(ret_pointer as u32, size as u32 * 3 * 4)
+            .unwrap();
+        self.free(None, params!(ret_pointer, size as i32 * 3 * 4))?;
+
+        let mut p_values = vec![0; size * 3];
+        for i in 0..size * 3 {
+            p_values[i] = i32::from_le_bytes(p_data[i * 4..(i + 1) * 4].try_into().unwrap());
+        }
+
+        let mut results: Vec<Box<dyn Any + Send + Sync>> = Vec::with_capacity(size);
+        for i in 0..size {
+            let bytes = memory
+                .read(p_values[i * 3] as u32, p_values[i * 3 + 2] as u32)
+                .unwrap();
+            self.free(None, params!(p_values[i * 3], p_values[i * 3 + 2]))?;
+            match FromPrimitive::from_i32(p_values[i * 3 + 1]) {
+                Some(RetTypes::U8) => {
+                    results.push(Box::new(bytes[0]));
+                }
+                Some(RetTypes::I8) => {
+                    results.push(Box::new(bytes[0] as i8));
+                }
+                Some(RetTypes::U16) => {
+                    let v = u16::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::I16) => {
+                    let v = i16::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::U32) => {
+                    let v = u32::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::I32) => {
+                    let v = i32::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::U64) => {
+                    let v = u64::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::I64) => {
+                    let v = i64::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::F32) => {
+                    let v = f32::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::F64) => {
+                    let v = f64::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::Bool) => {
+                    results.push(Box::new(bytes[0] == 1_u8));
+                }
+                Some(RetTypes::Char) => {
+                    let v = u32::from_le_bytes(bytes.try_into().unwrap());
+                    results.push(Box::new(char::from_u32(v)));
+                }
+                Some(RetTypes::U8Array) => {
+                    let len = bytes.len();
+                    let mut v = vec![0; len];
+                    v[..len].copy_from_slice(&bytes[..len]);
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::I8Array) => {
+                    let len = bytes.len();
+                    let mut v = vec![0; len];
+                    for i in 0..len {
+                        v[i] = bytes[i] as i8;
+                    }
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::U16Array) => {
+                    let len = bytes.len() / 2;
+                    let mut v = vec![0; len];
+                    for i in 0..len {
+                        v[i] = u16::from_le_bytes(bytes[i * 2..(i + 1) * 2].try_into().unwrap());
+                    }
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::I16Array) => {
+                    let len = bytes.len() / 2;
+                    let mut v = vec![0; len];
+                    for i in 0..len {
+                        v[i] = i16::from_le_bytes(bytes[i * 2..(i + 1) * 2].try_into().unwrap());
+                    }
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::U32Array) => {
+                    let len = bytes.len() / 4;
+                    let mut v = vec![0; len];
+                    for i in 0..len {
+                        v[i] = u32::from_le_bytes(bytes[i * 4..(i + 1) * 4].try_into().unwrap());
+                    }
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::I32Array) => {
+                    let len = bytes.len() / 4;
+                    let mut v = vec![0; len];
+                    for i in 0..len {
+                        v[i] = i32::from_le_bytes(bytes[i * 4..(i + 1) * 4].try_into().unwrap());
+                    }
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::U64Array) => {
+                    let len = bytes.len() / 8;
+                    let mut v = vec![0; len];
+                    for i in 0..len {
+                        v[i] = u64::from_le_bytes(bytes[i * 8..(i + 1) * 8].try_into().unwrap());
+                    }
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::I64Array) => {
+                    let len = bytes.len() / 8;
+                    let mut v = vec![0; len];
+                    for i in 0..len {
+                        v[i] = i64::from_le_bytes(bytes[i * 8..(i + 1) * 8].try_into().unwrap());
+                    }
+                    results.push(Box::new(v));
+                }
+                Some(RetTypes::String) => {
+                    results.push(Box::new(String::from_utf8(bytes).unwrap()));
+                }
+                None => {}
+            }
+        }
+
+        Ok(results)
+    }
+
+    fn alloc(
+        &self,
+        mod_name: Option<&str>,
+        args: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.vm.run_func(mod_name, "allocate", args)
+    }
+
+    fn free(
+        &self,
+        mod_name: Option<&str>,
+        args: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.vm.run_func(mod_name, "deallocate", args)
+    }
+}
+unsafe impl Send for VmDock {}
+unsafe impl Sync for VmDock {}
+
+/// Defines a type container that wraps a value of Rust built-in type.
+#[derive(Debug)]
+pub enum Param<'a> {
+    I8(i8),
+    U8(u8),
+    I16(i16),
+    U16(u16),
+    I32(i32),
+    U32(u32),
+    I64(i64),
+    U64(u64),
+    F32(f32),
+    F64(f64),
+    Bool(bool),
+    VecI8(&'a Vec<i8>),
+    VecU8(&'a Vec<u8>),
+    VecI16(&'a Vec<i16>),
+    VecU16(&'a Vec<u16>),
+    VecI32(&'a Vec<i32>),
+    VecU32(&'a Vec<u32>),
+    VecI64(&'a Vec<i64>),
+    VecU64(&'a Vec<u64>),
+    String(&'a str),
+}
+impl<'a> Param<'a> {
+    fn settle(&self, vm: &VmDock, mem: &mut Memory) -> WasmEdgeResult<(i32, i32)> {
+        match self {
+            Param::I8(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length)?;
+                mem.write(vec![*v as u8], pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::U8(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length)?;
+                mem.write(vec![*v], pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::I16(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length * 2)?;
+                let bytes = v.to_le_bytes();
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::U16(v) => {
+                let length = 2;
+                let pointer = Param::allocate(vm, length * 2)?;
+                let bytes = v.to_le_bytes();
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::I32(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length * 4)?;
+                let bytes = v.to_le_bytes();
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::U32(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length * 4)?;
+                let bytes = v.to_le_bytes();
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::I64(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length * 8)?;
+                let bytes = v.to_le_bytes();
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::U64(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length * 8)?;
+                let bytes = v.to_le_bytes();
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::F32(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length * 4)?;
+                let bytes = v.to_le_bytes();
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::F64(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length * 8)?;
+                let bytes = v.to_le_bytes();
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::Bool(v) => {
+                let length = 1;
+                let pointer = Param::allocate(vm, length)?;
+                let byte: u8 = match v {
+                    true => 1,
+                    false => 0,
+                };
+                mem.write(vec![byte], pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::VecI8(v) => {
+                let length = v.len() as i32;
+                let pointer = Param::allocate(vm, length)?;
+                let mut bytes = vec![0; length as usize];
+                for (pos, iv) in v.iter().enumerate() {
+                    bytes[pos] = *iv as u8;
+                }
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::VecU8(v) => {
+                let length = v.len() as i32;
+                let pointer = Param::allocate(vm, length)?;
+                let mut bytes = vec![0; length as usize];
+                for (pos, iv) in v.iter().enumerate() {
+                    bytes[pos] = *iv;
+                }
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::VecI16(v) => {
+                let length = v.len() as i32;
+                let pointer = Param::allocate(vm, length * 2)?;
+                let mut bytes = vec![0; length as usize * 2];
+                for (pos, iv) in v.iter().enumerate() {
+                    let b = iv.to_le_bytes();
+                    for i in 0..2 {
+                        bytes[pos * 2 + i] = b[i];
+                    }
+                }
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::VecU16(v) => {
+                let length = v.len() as i32;
+                let pointer = Param::allocate(vm, length * 2)?;
+                let mut bytes = vec![0; length as usize * 2];
+                for (pos, iv) in v.iter().enumerate() {
+                    let b = iv.to_le_bytes();
+                    for i in 0..2 {
+                        bytes[pos * 2 + i] = b[i];
+                    }
+                }
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::VecI32(v) => {
+                let length = v.len() as i32;
+                let pointer = Param::allocate(vm, length * 4)?;
+                let mut bytes = vec![0; length as usize * 4];
+                for (pos, iv) in v.iter().enumerate() {
+                    let b = iv.to_le_bytes();
+                    for i in 0..4 {
+                        bytes[pos * 4 + i] = b[i];
+                    }
+                }
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::VecU32(v) => {
+                let length = v.len() as i32;
+                let pointer = Param::allocate(vm, length * 4)?;
+                let mut bytes = vec![0; length as usize * 4];
+                for (pos, iv) in v.iter().enumerate() {
+                    let b = iv.to_le_bytes();
+                    for i in 0..4 {
+                        bytes[pos * 4 + i] = b[i];
+                    }
+                }
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::VecI64(v) => {
+                let length = v.len() as i32;
+                let pointer = Param::allocate(vm, length * 8)?;
+                let mut bytes = vec![0; length as usize * 8];
+                for (pos, iv) in v.iter().enumerate() {
+                    let b = iv.to_le_bytes();
+                    for i in 0..8 {
+                        bytes[pos * 8 + i] = b[i];
+                    }
+                }
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::VecU64(v) => {
+                let length = v.len() as i32;
+                let pointer = Param::allocate(vm, length * 8)?;
+                let mut bytes = vec![0; length as usize * 8];
+                for (pos, iv) in v.iter().enumerate() {
+                    let b = iv.to_le_bytes();
+                    for i in 0..8 {
+                        bytes[pos * 8 + i] = b[i];
+                    }
+                }
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+            Param::String(v) => {
+                let bytes = v.as_bytes().to_vec();
+                let length = bytes.len() as i32;
+                let pointer = Param::allocate(vm, length)?;
+                mem.write(bytes, pointer as u32)?;
+                Ok((pointer, length))
+            }
+        }
+    }
+
+    fn allocate(dock: &VmDock, size: i32) -> WasmEdgeResult<i32> {
+        let res = dock.vm.run_func(None, "allocate", params!(size))?;
+
+        Ok(res[0].to_i32())
+    }
+}
+
+#[derive(FromPrimitive)]
+enum RetTypes {
+    U8 = 1,
+    I8 = 2,
+    U16 = 3,
+    I16 = 4,
+    U32 = 5,
+    I32 = 6,
+    U64 = 7,
+    I64 = 8,
+    F32 = 9,
+    F64 = 10,
+    Bool = 11,
+    Char = 12,
+    U8Array = 21,
+    I8Array = 22,
+    U16Array = 23,
+    I16Array = 24,
+    U32Array = 25,
+    I32Array = 26,
+    U64Array = 27,
+    I64Array = 28,
+    String = 31,
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/executor.rs.html b/src/wasmedge_sdk/executor.rs.html new file mode 100644 index 000000000..f16953a0e --- /dev/null +++ b/src/wasmedge_sdk/executor.rs.html @@ -0,0 +1,927 @@ +executor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+
//! Defines Executor struct.
+
+#[cfg(all(feature = "async", target_os = "linux"))]
+use crate::wasi::r#async::AsyncState;
+use crate::{config::Config, Func, FuncRef, Statistics, WasmEdgeResult, WasmValue};
+use wasmedge_sys as sys;
+
+/// Defines an execution environment for both pure WASM and compiled WASM.
+#[derive(Debug, Clone)]
+pub struct Executor {
+    pub(crate) inner: sys::Executor,
+}
+impl Executor {
+    /// Creates a new [executor](crate::Executor) to be associated with the given [config](crate::config::Config) and [statistics](crate::Statistics).
+    ///
+    /// # Arguments
+    ///
+    /// - `config` specifies the configuration of the new [executor](crate::Executor).
+    ///
+    /// - `stat` specifies the [statistics](crate::Statistics) needed by the new [executor](crate::Executor).
+    ///
+    /// # Error
+    ///
+    /// If fail to create a [executor](crate::Executor), then an error is returned.
+    pub fn new(config: Option<&Config>, stat: Option<&mut Statistics>) -> WasmEdgeResult<Self> {
+        let inner_executor = match config {
+            Some(config) => match stat {
+                Some(stat) => sys::Executor::create(Some(&config.inner), Some(&mut stat.inner))?,
+                None => sys::Executor::create(Some(&config.inner), None)?,
+            },
+            None => match stat {
+                Some(stat) => sys::Executor::create(None, Some(&mut stat.inner))?,
+                None => sys::Executor::create(None, None)?,
+            },
+        };
+
+        Ok(Self {
+            inner: inner_executor,
+        })
+    }
+
+    /// Runs a host function instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    pub fn run_func(
+        &self,
+        func: &Func,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.inner.call_func(&func.inner, params)
+    }
+
+    /// Runs a host function instance with a timeout setting.
+    ///
+    /// # Arguments
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// * `timeout` - The maximum execution time of the function to be run.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(target_os = "linux", not(target_env = "musl")))]
+    #[cfg_attr(docsrs, doc(cfg(all(target_os = "linux", not(target_env = "musl")))))]
+    pub fn run_func_with_timeout(
+        &self,
+        func: &Func,
+        params: impl IntoIterator<Item = WasmValue>,
+        timeout: std::time::Duration,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.inner
+            .call_func_with_timeout(&func.inner, params, timeout)
+    }
+
+    /// Asynchronously runs a host function instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn run_func_async(
+        &self,
+        async_state: &AsyncState,
+        func: &Func,
+        params: impl IntoIterator<Item = WasmValue> + Send,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.inner
+            .call_func_async(async_state, &func.inner, params)
+            .await
+    }
+
+    /// Asynchronously runs a host function instance with a timeout setting.
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - Used to store asynchronous state at run time.
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// * `timeout` - The maximum execution time of the function to be run.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux", not(target_env = "musl")))]
+    #[cfg_attr(
+        docsrs,
+        doc(cfg(all(feature = "async", target_os = "linux", not(target_env = "musl"))))
+    )]
+    pub async fn run_func_async_with_timeout(
+        &self,
+        async_state: &AsyncState,
+        func: &Func,
+        params: impl IntoIterator<Item = WasmValue> + Send,
+        timeout: std::time::Duration,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.inner
+            .call_func_async_with_timeout(async_state, &func.inner, params, timeout)
+            .await
+    }
+
+    /// Runs a host function reference instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func_ref` - The function reference instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function reference instance, then an error is returned.
+    pub fn run_func_ref(
+        &self,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.inner.call_func_ref(&func_ref.inner, params)
+    }
+
+    /// Asynchronously runs a host function reference instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func_ref` - The function reference instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function reference instance, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn run_func_ref_async(
+        &self,
+        async_state: &AsyncState,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue> + Send,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.inner
+            .call_func_ref_async(async_state, &func_ref.inner, params)
+            .await
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        config::{CommonConfigOptions, ConfigBuilder},
+        params, wat2wasm, Module, Statistics, Store, WasmVal,
+    };
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    use crate::{error::HostFuncError, CallingFrame};
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_executor_create() {
+        {
+            let result = Executor::new(None, None);
+            assert!(result.is_ok());
+        }
+
+        {
+            let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+
+            let result = Executor::new(Some(&config), None);
+            assert!(result.is_ok());
+
+            assert!(config.bulk_memory_operations_enabled());
+        }
+
+        {
+            let result = Statistics::new();
+            assert!(result.is_ok());
+            let mut stat = result.unwrap();
+
+            let result = Executor::new(None, Some(&mut stat));
+            assert!(result.is_ok());
+
+            assert_eq!(stat.cost(), 0);
+        }
+
+        {
+            let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+
+            let result = Statistics::new();
+            assert!(result.is_ok());
+            let mut stat = result.unwrap();
+
+            let result = Executor::new(Some(&config), Some(&mut stat));
+            assert!(result.is_ok());
+
+            assert!(config.bulk_memory_operations_enabled());
+            assert_eq!(stat.cost(), 0);
+        }
+    }
+
+    #[test]
+    fn test_executor_run_func() {
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // read the wasm bytes of fibonacci.wasm
+        let result = wat2wasm(
+            br#"
+            (module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+"#,
+        );
+        assert!(result.is_ok());
+        let wasm_bytes = result.unwrap();
+        let result = Module::from_bytes(Some(&config), wasm_bytes);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // register a module into store as active module
+        let result = store.register_named_module(&mut executor, "extern", &module);
+        assert!(result.is_ok());
+        let extern_instance = result.unwrap();
+
+        // get the exported function "fib"
+        let result = extern_instance.func("fib");
+        assert!(result.is_ok());
+        let fib = result.unwrap();
+
+        // run the exported host function
+        let result = executor.run_func(&fib, params!(5));
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns.len(), 1);
+        assert_eq!(returns[0].to_i32(), 8);
+    }
+
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[tokio::test]
+    async fn test_executor_run_async_func() -> Result<(), Box<dyn std::error::Error>> {
+        fn async_hello(
+            _frame: CallingFrame,
+            _inputs: Vec<WasmValue>,
+            _data: *mut std::os::raw::c_void,
+        ) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)>
+        {
+            Box::new(async move {
+                for _ in 0..10 {
+                    println!("[async hello] say hello");
+                    tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+                }
+
+                println!("[async hello] Done!");
+
+                Ok(vec![])
+            })
+        }
+
+        #[derive(Debug)]
+        struct Data<T, S> {
+            _x: i32,
+            _y: String,
+            _v: Vec<T>,
+            _s: Vec<S>,
+        }
+        let data: Data<i32, &str> = Data {
+            _x: 12,
+            _y: "hello".to_string(),
+            _v: vec![1, 2, 3],
+            _s: vec!["macos", "linux", "windows"],
+        };
+
+        // create an async host function
+        let result =
+            Func::wrap_async_func::<(), (), Data<i32, &str>>(async_hello, Some(Box::new(data)));
+        assert!(result.is_ok());
+        let func = result.unwrap();
+
+        // create an executor
+        let executor = Executor::new(None, None).unwrap();
+
+        // create an async state
+        let async_state = AsyncState::new();
+
+        async fn tick() {
+            let mut i = 0;
+            loop {
+                println!("[tick] i={i}");
+                tokio::time::sleep(std::time::Duration::from_millis(500)).await;
+                i += 1;
+            }
+        }
+        tokio::spawn(tick());
+
+        // call the async host function
+        let _ = executor.run_func_async(&async_state, &func, []).await?;
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/externals/function.rs.html b/src/wasmedge_sdk/externals/function.rs.html new file mode 100644 index 000000000..796352dde --- /dev/null +++ b/src/wasmedge_sdk/externals/function.rs.html @@ -0,0 +1,1479 @@ +function.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+
//! Defines Func, SignatureBuilder, and Signature structs.
+
+#[cfg(all(feature = "async", target_os = "linux"))]
+use crate::wasi::r#async::AsyncState;
+use crate::{
+    error::HostFuncError, io::WasmValTypeList, CallingFrame, Executor, FuncType, ValType,
+    WasmEdgeResult, WasmValue,
+};
+use wasmedge_sys as sys;
+
+/// Defines a host function instance.
+///
+/// A WasmEdge [Func] is a wasm function instance, which is a "wrapper" of the original function (defined in either the host or the WebAssembly module) over the runtime [module instance](crate::Instance) of its originating [module](crate::Module).
+///
+#[derive(Debug, Clone)]
+pub struct Func {
+    pub(crate) inner: sys::Function,
+    pub(crate) name: Option<String>,
+    pub(crate) mod_name: Option<String>,
+    pub(crate) ty: FuncType,
+}
+impl Func {
+    /// Creates a host function by wrapping a native function.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `real_func` - The native function to be wrapped.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create a Func instance, then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
+    pub fn wrap<Args, Rets, T>(
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Result<Vec<WasmValue>, HostFuncError>
+            + Send
+            + Sync
+            + 'static,
+        data: Option<Box<T>>,
+    ) -> WasmEdgeResult<Self>
+    where
+        Args: WasmValTypeList,
+        Rets: WasmValTypeList,
+    {
+        let boxed_func = Box::new(real_func);
+        let args = Args::wasm_types();
+        let returns = Rets::wasm_types();
+        let ty = FuncType::new(Some(args.to_vec()), Some(returns.to_vec()));
+        let inner = sys::Function::create_sync_func::<T>(&ty.clone().into(), boxed_func, data, 0)?;
+        Ok(Self {
+            inner,
+            name: None,
+            mod_name: None,
+            ty,
+        })
+    }
+
+    /// Creates a host function with the given func type.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The function type.
+    ///
+    /// * `real_func` - The native function that will be wrapped as a host function.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create a Func instance, then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
+    pub fn wrap_with_type<T>(
+        ty: FuncType,
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Result<Vec<WasmValue>, HostFuncError>
+            + Send
+            + Sync
+            + 'static,
+        data: Option<Box<T>>,
+    ) -> WasmEdgeResult<Self> {
+        let boxed_func = Box::new(real_func);
+        let inner = sys::Function::create_sync_func::<T>(&ty.clone().into(), boxed_func, data, 0)?;
+        Ok(Self {
+            inner,
+            name: None,
+            mod_name: None,
+            ty,
+        })
+    }
+
+    /// Creates an asynchronous host function by wrapping a native async function.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `real_func` - The native function to be wrapped.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create a Func instance, then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub fn wrap_async_func<Args, Rets, T>(
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Box<
+                dyn std::future::Future<
+                        Output = Result<Vec<WasmValue>, crate::error::HostFuncError>,
+                    > + Send,
+            > + Send
+            + Sync
+            + 'static,
+        data: Option<Box<T>>,
+    ) -> WasmEdgeResult<Self>
+    where
+        Args: WasmValTypeList,
+        Rets: WasmValTypeList,
+        T: Send + Sync,
+    {
+        let boxed_func = Box::new(real_func);
+        let args = Args::wasm_types();
+        let returns = Rets::wasm_types();
+        let ty = FuncType::new(Some(args.to_vec()), Some(returns.to_vec()));
+        let inner = sys::Function::create_async_func(&ty.clone().into(), boxed_func, data, 0)?;
+        Ok(Self {
+            inner,
+            name: None,
+            mod_name: None,
+            ty,
+        })
+    }
+
+    /// Creates an asynchronous host function by wrapping a native async function with the given function type.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The function type.
+    ///
+    /// * `real_func` - The native function to be wrapped.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create a Func instance, then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub fn wrap_async_func_with_type<T>(
+        ty: FuncType,
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Box<
+                dyn std::future::Future<
+                        Output = Result<Vec<WasmValue>, crate::error::HostFuncError>,
+                    > + Send,
+            > + Send
+            + Sync
+            + 'static,
+        data: Option<Box<T>>,
+    ) -> WasmEdgeResult<Self>
+    where
+        T: Send + Sync,
+    {
+        let boxed_func = Box::new(real_func);
+        let inner = sys::Function::create_async_func(&ty.clone().into(), boxed_func, data, 0)?;
+        Ok(Self {
+            inner,
+            name: None,
+            mod_name: None,
+            ty,
+        })
+    }
+
+    /// Returns the exported name of this function.
+    ///
+    /// Notice that this field is meaningful only if this host function is used as an exported instance.
+    pub fn name(&self) -> Option<&str> {
+        match &self.name {
+            Some(name) => Some(name.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns the name of the [module instance](crate::Instance) from which this function exports.
+    ///
+    /// Notice that this field is meaningful only if this host function is used as an exported instance.
+    pub fn mod_name(&self) -> Option<&str> {
+        match &self.mod_name {
+            Some(mod_name) => Some(mod_name.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns a reference to the type of the host function.
+    pub fn ty(&self) -> &FuncType {
+        &self.ty
+    }
+
+    /// Returns a reference to this function instance.
+    pub fn as_ref(&self) -> FuncRef {
+        let inner = self.inner.as_ref();
+        FuncRef {
+            inner,
+            ty: self.ty.clone(),
+        }
+    }
+
+    /// Runs this host function and returns the result.
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [Executor](crate::Executor) instance.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    pub fn run(
+        &self,
+        executor: &Executor,
+        args: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        executor.run_func(self, args)
+    }
+
+    /// Runs this host function with a timeout setting.
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [Executor](crate::Executor) instance.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// * `timeout` - The maximum execution time of the function to be run.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(target_os = "linux", not(target_env = "musl")))]
+    #[cfg_attr(docsrs, doc(cfg(all(target_os = "linux", not(target_env = "musl")))))]
+    pub fn run_with_timeout(
+        &self,
+        executor: &Executor,
+        args: impl IntoIterator<Item = WasmValue>,
+        timeout: std::time::Duration,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        executor.run_func_with_timeout(self, args, timeout)
+    }
+
+    /// Asynchronously runs this host function and returns the result.
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [Executor](crate::Executor) instance.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn run_async(
+        &self,
+        async_state: &AsyncState,
+        executor: &Executor,
+        args: impl IntoIterator<Item = WasmValue> + Send,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        executor.run_func_async(async_state, self, args).await
+    }
+
+    /// Asynchronously runs this host function with a timeout setting.
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - Used to store asynchronous state at run time.
+    ///
+    /// * `executor` - The [Executor](crate::Executor) instance.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// * `timeout` - The maximum execution time of the function to be run.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux", not(target_env = "musl")))]
+    #[cfg_attr(
+        docsrs,
+        doc(cfg(all(feature = "async", target_os = "linux", not(target_env = "musl"))))
+    )]
+    pub async fn run_async_with_timeout(
+        &self,
+        async_state: &AsyncState,
+        executor: &Executor,
+        args: impl IntoIterator<Item = WasmValue> + Send,
+        timeout: std::time::Duration,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        executor
+            .run_func_async_with_timeout(async_state, self, args, timeout)
+            .await
+    }
+}
+
+/// Defines a type builder for creating a [FuncType](https://wasmedge.github.io/WasmEdge/wasmedge_types/struct.FuncType.html) instance.
+#[derive(Debug, Default)]
+pub struct FuncTypeBuilder {
+    args: Option<Vec<ValType>>,
+    returns: Option<Vec<ValType>>,
+}
+impl FuncTypeBuilder {
+    /// Creates a new [FuncTypeBuilder].
+    pub fn new() -> Self {
+        Self {
+            args: None,
+            returns: None,
+        }
+    }
+
+    /// Adds arguments to the function type.
+    ///
+    /// # Argument
+    ///
+    /// `args` specifies the arguments to be added to the function type.
+    pub fn with_args(self, args: impl IntoIterator<Item = ValType>) -> Self {
+        Self {
+            args: Some(args.into_iter().collect::<Vec<_>>()),
+            returns: self.returns,
+        }
+    }
+
+    /// Adds a single argument to the function type.
+    ///
+    /// # Argument
+    ///
+    /// `arg` specifies the argument to be added to the function type.
+    pub fn with_arg(self, arg: ValType) -> Self {
+        self.with_args(std::iter::once(arg))
+    }
+
+    /// Adds returns to the function type.
+    ///
+    /// # Argument
+    ///
+    /// `returns` specifies the returns to be added to the function type.
+    pub fn with_returns(self, returns: impl IntoIterator<Item = ValType>) -> Self {
+        Self {
+            args: self.args,
+            returns: Some(returns.into_iter().collect::<Vec<_>>()),
+        }
+    }
+
+    /// Adds a single return to the function type.
+    ///
+    /// # Argument
+    ///
+    /// `ret` specifies the return to be added to the function type.
+    pub fn with_return(self, ret: ValType) -> Self {
+        self.with_returns(std::iter::once(ret))
+    }
+
+    /// Returns a function type.
+    pub fn build(self) -> FuncType {
+        FuncType::new(self.args, self.returns)
+    }
+}
+
+/// Defines a reference to a [host function](crate::Func).
+///
+/// The [table_and_funcref](https://github.com/WasmEdge/WasmEdge/tree/master/bindings/rust/wasmedge-sdk/examples/table_and_funcref.rs) example presents how to obtain and use [FuncRef].
+#[derive(Debug, Clone)]
+pub struct FuncRef {
+    pub(crate) inner: sys::FuncRef,
+    pub(crate) ty: FuncType,
+}
+impl FuncRef {
+    /// Returns a reference to the ty of the host function this [FuncRef] points to.
+    pub fn ty(&self) -> &FuncType {
+        &self.ty
+    }
+
+    /// Runs this host function the reference refers to.
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [Executor](crate::Executor) instance.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    pub fn run(
+        &self,
+        executor: &Executor,
+        args: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        executor.run_func_ref(self, args)
+    }
+
+    /// Asynchronously runs this host function the reference refers to.
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [Executor](crate::Executor) instance.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(feature = "async")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "async")))]
+    pub async fn run_async<T>(
+        &self,
+        async_state: &AsyncState,
+        executor: &Executor,
+        args: impl IntoIterator<Item = WasmValue> + Send,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        executor.run_func_ref_async(async_state, self, args).await
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        config::{CommonConfigOptions, ConfigBuilder},
+        error::HostFuncError,
+        params, CallingFrame, Executor, ImportObjectBuilder, NeverType, Statistics, Store,
+        VmBuilder, WasmVal, WasmValue,
+    };
+
+    #[test]
+    fn test_func_signature() {
+        // test signature with args and returns
+        {
+            let sig = FuncTypeBuilder::new()
+                .with_args(vec![
+                    ValType::I32,
+                    ValType::I64,
+                    ValType::F32,
+                    ValType::F64,
+                    ValType::V128,
+                    ValType::FuncRef,
+                    ValType::ExternRef,
+                ])
+                .with_returns(vec![ValType::FuncRef, ValType::ExternRef, ValType::V128])
+                .build();
+
+            // check the arguments
+            let result = sig.args();
+            assert!(result.is_some());
+            let args = result.unwrap();
+            assert_eq!(
+                args,
+                &[
+                    ValType::I32,
+                    ValType::I64,
+                    ValType::F32,
+                    ValType::F64,
+                    ValType::V128,
+                    ValType::FuncRef,
+                    ValType::ExternRef,
+                ]
+            );
+
+            // check the returns
+            let result = sig.returns();
+            assert!(result.is_some());
+            let returns = result.unwrap();
+            assert_eq!(
+                returns,
+                &[ValType::FuncRef, ValType::ExternRef, ValType::V128]
+            );
+        }
+
+        // test signature without args and returns
+        {
+            let sig = FuncTypeBuilder::new().build();
+            assert_eq!(sig.args(), None);
+            assert_eq!(sig.returns(), None);
+        }
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_func_basic() {
+        // create an ImportModule
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host func")
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        // get the instance of the ImportObject module
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the exported host function
+        let result = instance.func("add");
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        // check the signature of the host function
+        let func_ty = host_func.ty();
+        assert!(func_ty.args().is_some());
+        assert_eq!(func_ty.args().unwrap(), [ValType::I32; 2]);
+        assert!(func_ty.returns().is_some());
+        assert_eq!(func_ty.returns().unwrap(), [ValType::I32]);
+
+        // run the host function
+        let result = host_func.run(&mut executor, params!(2, 3));
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns.len(), 1);
+        assert_eq!(returns[0].to_i32(), 5);
+    }
+
+    #[test]
+    fn test_func_wrap() {
+        // create a host function
+        let result = Func::wrap::<(i32, i32), i32, NeverType>(real_add, None);
+        assert!(result.is_ok());
+        let func = result.unwrap();
+
+        // create an executor
+        let mut executor = Executor::new(None, None).unwrap();
+
+        // call the host function
+        let result = func.run(&mut executor, params!(2, 3));
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns[0].to_i32(), 5);
+    }
+
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+        _data: *mut std::os::raw::c_void,
+    ) -> std::result::Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+
+    #[test]
+    #[cfg(not(feature = "async"))]
+    fn test_func_wrap_closure() -> Result<(), Box<dyn std::error::Error>> {
+        // define a closure
+        let real_add = |_: CallingFrame,
+                        input: Vec<WasmValue>,
+                        _: *mut std::os::raw::c_void|
+         -> Result<Vec<WasmValue>, HostFuncError> {
+            println!("Rust: Entering Rust function real_add");
+
+            if input.len() != 2 {
+                return Err(HostFuncError::User(1));
+            }
+
+            let a = if input[0].ty() == ValType::I32 {
+                input[0].to_i32()
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+
+            let b = if input[1].ty() == ValType::I32 {
+                input[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            let c = a + b;
+            println!("Rust: calcuating in real_add c: {c:?}");
+
+            println!("Rust: Leaving Rust function real_add");
+            Ok(vec![WasmValue::from_i32(c)])
+        };
+
+        // create an ImportModule instance
+        let result = ImportObjectBuilder::new()
+            // .with_sync_closure::<(i32, i32), i32>("add", real_add)?
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)?
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let mut vm = result.unwrap();
+
+        // register an import module into vm
+        let result = vm.register_import_module(&import);
+        assert!(result.is_ok());
+
+        let returns = vm.run_func(Some("extern"), "add", params![2, 3])?;
+        assert_eq!(returns[0].to_i32(), 5);
+
+        Ok(())
+    }
+
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[tokio::test]
+    async fn test_func_wrap_async_closure() -> Result<(), Box<dyn std::error::Error>> {
+        use crate::wasi::r#async::WasiContext;
+
+        // define an async closure
+        let c = |_frame: CallingFrame,
+                 _args: Vec<WasmValue>,
+                 data: *mut std::os::raw::c_void|
+         -> Box<
+            (dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send),
+        > {
+            // Do not use `Box::from_raw`: let data = unsafe { Box::from_raw(data as *mut Data<i32, &str>) };
+            let data = unsafe { &mut *(data as *mut Data<i32, &str>) };
+
+            Box::new(async move {
+                for _ in 0..10 {
+                    println!("[async hello] say hello");
+                    tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+                    println!("host_data: {:?}", data);
+                }
+
+                println!("[async hello] Done!");
+
+                Ok(vec![])
+            })
+        };
+
+        #[derive(Debug)]
+        struct Data<T, S> {
+            _x: i32,
+            _y: String,
+            _v: Vec<T>,
+            _s: Vec<S>,
+        }
+        let data: Data<i32, &str> = Data {
+            _x: 12,
+            _y: "hello".to_string(),
+            _v: vec![1, 2, 3],
+            _s: vec!["macos", "linux", "windows"],
+        };
+
+        // create an ImportModule instance
+        let result = ImportObjectBuilder::new()
+            .with_async_func::<(), (), Data<i32, &str>>("async_hello", c, Some(Box::new(data)))?
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create a default WasiContext instance
+        let wasi_ctx = WasiContext::default();
+
+        // create a Vm context
+        let result = VmBuilder::new().with_wasi_context(wasi_ctx).build();
+        assert!(result.is_ok());
+        let mut vm = result.unwrap();
+
+        // register an import module into vm
+        let result = vm.register_import_module(&import);
+        assert!(result.is_ok());
+
+        async fn tick() {
+            let mut i = 0;
+            loop {
+                println!("[tick] i={i}");
+                tokio::time::sleep(std::time::Duration::from_millis(500)).await;
+                i += 1;
+            }
+        }
+        tokio::spawn(tick());
+
+        let async_state = AsyncState::new();
+        vm.run_func_async(&async_state, Some("extern"), "async_hello", params!())
+            .await?;
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/externals/global.rs.html b/src/wasmedge_sdk/externals/global.rs.html new file mode 100644 index 000000000..f18567307 --- /dev/null +++ b/src/wasmedge_sdk/externals/global.rs.html @@ -0,0 +1,437 @@ +global.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
//! Defines Global and GlobalType.
+
+use crate::{types::Val, GlobalType, WasmEdgeResult};
+use wasmedge_sys as sys;
+
+/// Defines a WebAssembly global variable, which stores a single value of the given [GlobalType](https://wasmedge.github.io/WasmEdge/wasmedge_types/struct.GlobalType.html) and a flag indicating whether it is mutable or not.
+#[derive(Debug, Clone)]
+pub struct Global {
+    pub(crate) inner: sys::Global,
+    pub(crate) name: Option<String>,
+    pub(crate) mod_name: Option<String>,
+    pub(crate) ty: GlobalType,
+}
+impl Global {
+    /// Creates a new wasm Global instance with the given type and initial value.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The type of the Global instance to be created.
+    ///
+    /// * `init` - The initial value of the Global instance.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create the Global instance, then WasmEdgeError::Global(GlobalError::Create)(crate::error::GlobalError) is returned.
+    pub fn new(ty: GlobalType, init: Val) -> WasmEdgeResult<Self> {
+        let inner = sys::Global::create(&ty.clone().into(), init.into())?;
+        Ok(Self {
+            inner,
+            name: None,
+            mod_name: None,
+            ty,
+        })
+    }
+
+    /// Returns the exported name of this Global instance.
+    ///
+    /// Notice that this field is meaningful only if this Global instance is used as an exported instance.
+    pub fn name(&self) -> Option<&str> {
+        match &self.name {
+            Some(name) => Some(name.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns the name of the [module instance](crate::Instance) from which this Global instance exports.
+    ///
+    /// Notice that this field is meaningful only if this Global instance is used as an exported instance.
+    pub fn mod_name(&self) -> Option<&str> {
+        match &self.mod_name {
+            Some(mod_name) => Some(mod_name.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns a reference to the type of this Global instance.
+    pub fn ty(&self) -> &GlobalType {
+        &self.ty
+    }
+
+    /// Returns the current value of this Global instance.
+    pub fn get_value(&self) -> Val {
+        self.inner.get_value().into()
+    }
+
+    /// Sets a new value of this Global instance.
+    ///
+    /// Notice that only global variables of [Var](wasmedge_types::Mutability) type are allowed to perform this function.
+    ///
+    /// # Argument
+    ///
+    /// * `value` - The new value of the Global instance.
+    ///
+    /// # Error
+    ///
+    /// If fail to update the value of the global variable, then an error is returned.
+    pub fn set_value(&mut self, val: Val) -> WasmEdgeResult<()> {
+        self.inner.set_value(val.into())?;
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        config::{CommonConfigOptions, ConfigBuilder},
+        error::{GlobalError, WasmEdgeError},
+        Executor, ImportObjectBuilder, Mutability, NeverType, Statistics, Store, ValType,
+    };
+
+    #[test]
+    fn test_global_type() {
+        // create a GlobalType instance
+        let global_ty = GlobalType::new(ValType::I32, Mutability::Const);
+
+        // value type
+        assert_eq!(global_ty.value_ty(), ValType::I32);
+        // Mutability
+        assert_eq!(global_ty.mutability(), Mutability::Const);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_global_basic() {
+        // create a Const global instance
+        let result = Global::new(
+            GlobalType::new(ValType::I32, Mutability::Const),
+            Val::I32(1314),
+        );
+        assert!(result.is_ok());
+        let global_const = result.unwrap();
+
+        // create a Var global instance
+        let result = Global::new(
+            GlobalType::new(ValType::F32, Mutability::Var),
+            Val::F32(13.14),
+        );
+        assert!(result.is_ok());
+        let global_var = result.unwrap();
+
+        // create an import object
+        let result = ImportObjectBuilder::new()
+            .with_global("const-global", global_const)
+            .with_global("var-global", global_var)
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the Const global from the store of vm
+        let result = instance.global("const-global");
+        assert!(result.is_ok());
+        let mut const_global = result.unwrap();
+
+        // check global
+        assert!(const_global.name().is_some());
+        assert_eq!(const_global.name().unwrap(), "const-global");
+        assert!(const_global.mod_name().is_some());
+        assert_eq!(const_global.mod_name().unwrap(), "extern");
+        let ty = const_global.ty();
+        assert_eq!(ty.value_ty(), ValType::I32);
+        assert_eq!(ty.mutability(), Mutability::Const);
+
+        // get value of global
+        if let Val::I32(value) = const_global.get_value() {
+            assert_eq!(value, 1314);
+        }
+
+        // set a new value
+        let result = const_global.set_value(Val::I32(314));
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Global(GlobalError::ModifyConst))
+        );
+
+        // get the Var global from the store of vm
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the Var global from the store of vm
+        let result = instance.global("var-global");
+        assert!(result.is_ok());
+        let mut var_global = result.unwrap();
+
+        // check global
+        assert!(var_global.name().is_some());
+        assert_eq!(var_global.name().unwrap(), "var-global");
+        assert!(var_global.mod_name().is_some());
+        assert_eq!(var_global.mod_name().unwrap(), "extern");
+        let ty = var_global.ty();
+        assert_eq!(ty.value_ty(), ValType::F32);
+        assert_eq!(ty.mutability(), Mutability::Var);
+
+        // get the value of var_global
+        if let Val::F32(value) = var_global.get_value() {
+            assert_eq!(value, 13.14);
+        }
+
+        // set a new value
+        let result = var_global.set_value(Val::F32(1.314));
+        assert!(result.is_ok());
+
+        // get the value of var_global again
+        let result = instance.global("var-global");
+        assert!(result.is_ok());
+        let var_global = result.unwrap();
+        if let Val::F32(value) = var_global.get_value() {
+            assert_eq!(value, 1.314);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/externals/memory.rs.html b/src/wasmedge_sdk/externals/memory.rs.html new file mode 100644 index 000000000..61ac2e9ab --- /dev/null +++ b/src/wasmedge_sdk/externals/memory.rs.html @@ -0,0 +1,685 @@ +memory.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+
use crate::{error::WasmEdgeError, WasmEdgeResult};
+use wasmedge_sys as sys;
+use wasmedge_types::MemoryType;
+
+/// Defines a linear memory.
+#[derive(Debug, Clone)]
+pub struct Memory {
+    pub(crate) inner: sys::Memory,
+    pub(crate) name: Option<String>,
+    pub(crate) mod_name: Option<String>,
+    pub(crate) ty: MemoryType,
+}
+impl Memory {
+    /// Creates a new wasm memory instance with the given type.
+    ///
+    /// # Argument
+    ///
+    /// * `ty` - The type of the memory instance to be created.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create the memory instance, then [WasmEdgeError::Mem(MemError::Create)](crate::error::MemError) is returned.
+    pub fn new(ty: MemoryType) -> WasmEdgeResult<Self> {
+        let inner = sys::Memory::create(&ty.clone().into())?;
+        Ok(Self {
+            inner,
+            name: None,
+            mod_name: None,
+            ty,
+        })
+    }
+
+    /// Returns the exported name of this memory.
+    ///
+    /// Notice that this field is meaningful only if this memory is used as an exported instance.
+    pub fn name(&self) -> Option<&str> {
+        match &self.name {
+            Some(name) => Some(name.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns the name of the [module instance](crate::Instance) from which this memory exports.
+    ///
+    /// Notice that this field is meaningful only if this memory is used as an exported instance.
+    pub fn mod_name(&self) -> Option<&str> {
+        match &self.mod_name {
+            Some(mod_name) => Some(mod_name.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns a reference to the type of this memory.
+    pub fn ty(&self) -> &MemoryType {
+        &self.ty
+    }
+
+    /// Returns the size, in WebAssembly pages (64 KiB of each page), of this wasm memory.
+    pub fn page(&self) -> u32 {
+        self.inner.size()
+    }
+
+    /// Returns the byte length of this memory. The returned value will be a multiple of the wasm page size, 64k.
+    pub fn size(&self) -> u64 {
+        self.page() as u64 * 65536_u64
+    }
+
+    /// Safely reads memory contents at the given offset into a buffer.
+    ///
+    /// # Arguments
+    ///
+    /// * `offset` - The offset from which to read.
+    ///
+    /// * `len` - the length of bytes to read.
+    ///
+    /// # Error
+    ///
+    /// If fail to read the memory, then an error is returned.
+    pub fn read(&self, offset: u32, len: u32) -> WasmEdgeResult<Vec<u8>> {
+        let data = self.inner.get_data(offset, len)?;
+        Ok(data)
+    }
+
+    /// Returns a string of byte length `len` from this memory, starting at `offset`.
+    ///
+    /// # Arguments
+    ///
+    /// * `offset` - The offset from which to read.
+    ///
+    /// * `len` - the length of bytes to read.
+    ///
+    /// # Error
+    ///
+    /// If fail to read, then an error is returned.
+    pub fn read_string(&self, offset: u32, len: u32) -> WasmEdgeResult<String> {
+        let slice = self.read(offset, len)?;
+        Ok(std::str::from_utf8(&slice)
+            .map_err(WasmEdgeError::Utf8)?
+            .to_string())
+    }
+
+    /// Safely writes contents of a buffer to this memory at the given offset.
+    ///
+    /// # Arguments
+    ///
+    /// * `data` - The bytes to write to this memory..
+    ///
+    /// * `offset` - The offset at which to write.
+    ///
+    /// # Error
+    ///
+    /// If fail to write to the memory, then an error is returned.
+    pub fn write(&mut self, data: impl AsRef<[u8]>, offset: u32) -> WasmEdgeResult<()> {
+        self.inner.set_data(data, offset)?;
+        Ok(())
+    }
+
+    /// Grows this memory by the `count` pages.
+    ///
+    /// # Argument
+    ///
+    /// * `count` - The number of pages to grow the memory by.
+    ///
+    /// # Error
+    ///
+    /// If fail to grow the memory, then an error is returned.
+    pub fn grow(&mut self, count: u32) -> WasmEdgeResult<()> {
+        self.inner.grow(count)?;
+        Ok(())
+    }
+
+    /// Returns the const data pointer to this memory.
+    ///
+    /// # Arguments
+    ///
+    /// * `offset` - The data start offset in this memory.
+    ///
+    /// * `len` - The requested data length. If the size of `offset` + `len` is larger
+    /// than the data size in this memory.
+    ///   
+    ///
+    /// # Errors
+    ///
+    /// If fail to get the data pointer, then an error is returned.
+    ///
+    pub fn data_pointer(&self, offset: u32, len: u32) -> WasmEdgeResult<*const u8> {
+        self.inner.data_pointer(offset, len)
+    }
+
+    /// Returns the data pointer to this memory.
+    ///
+    /// # Arguments
+    ///
+    /// * `offset` - The data start offset in this memory.
+    ///
+    /// * `len` - The requested data length. If the size of `offset` + `len` is larger than the data size in this memory.
+    ///
+    /// # Errors
+    ///
+    /// If fail to get the data pointer, then an error is returned.
+    ///
+    pub fn data_pointer_mut(&mut self, offset: u32, len: u32) -> WasmEdgeResult<*mut u8> {
+        self.inner.data_pointer_mut(offset, len)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        config::{CommonConfigOptions, ConfigBuilder},
+        Executor, ImportObjectBuilder, NeverType, Statistics, Store,
+    };
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_memory_type() {
+        let result = MemoryType::new(0, None, false);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert_eq!(ty.minimum(), 0);
+        assert_eq!(ty.maximum(), None);
+
+        let result = MemoryType::new(10, Some(20), false);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert_eq!(ty.minimum(), 10);
+        assert_eq!(ty.maximum(), Some(20));
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_memory() {
+        // create a memory instance
+        let result = MemoryType::new(10, Some(20), false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create an import object
+        let result = ImportObjectBuilder::new()
+            .with_memory("memory", memory)
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        let result = store.named_instance("extern");
+        assert!(result.is_err());
+
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the exported memory
+        let result = instance.memory("memory");
+        assert!(result.is_ok());
+        let mut memory = result.unwrap();
+
+        // check memory
+        assert!(memory.name().is_some());
+        assert_eq!(memory.name().unwrap(), "memory");
+        assert_eq!(memory.mod_name(), Some("extern"));
+        assert_eq!(memory.page(), 10);
+
+        // check memory type
+        let ty = memory.ty();
+        assert_eq!(ty.minimum(), 10);
+        assert_eq!(ty.maximum(), Some(20));
+
+        // read data before write data
+        let result = memory.read(0, 10);
+        assert!(result.is_ok());
+        let data = result.unwrap();
+        assert_eq!(data, vec![0; 10]);
+
+        // write data
+        // ! debug
+        let data = vec![1; 10];
+        let result = memory.write(data.as_slice(), 10);
+        // let result = memory.write(vec![1; 10], 10);
+        assert!(result.is_ok());
+        // read data after write data
+        let result = memory.read(10, 10);
+        assert!(result.is_ok());
+        let data = result.unwrap();
+        assert_eq!(data, vec![1; 10]);
+
+        // grow memory
+        let result = memory.grow(5);
+        assert!(result.is_ok());
+        assert_eq!(memory.page(), 15);
+
+        // get memory from instance again
+        let result = instance.memory("memory");
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+        assert_eq!(memory.page(), 15);
+    }
+
+    #[test]
+    fn test_memory_read() {
+        let result = MemoryType::new(10, Some(20), false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let mut memory = result.unwrap();
+
+        let result = memory.read(0, 10);
+        assert!(result.is_ok());
+        let data = result.unwrap();
+        assert_eq!(data, vec![0; 10]);
+
+        let s = String::from("hello");
+        let bytes = s.as_bytes();
+        let len = bytes.len();
+
+        let result = memory.write(bytes, 0);
+        assert!(result.is_ok());
+
+        let result = memory.read(0, len as u32);
+        assert!(result.is_ok());
+        let data = result.unwrap();
+        assert_eq!(data, bytes);
+
+        let result = memory.read_string(0, len as u32);
+        assert!(result.is_ok());
+        let data = result.unwrap();
+        assert_eq!(data, s);
+    }
+
+    #[test]
+    fn test_memory_clone() {
+        #[derive(Debug, Clone)]
+        struct RecordsMemory {
+            memory: Memory,
+        }
+
+        // create a memory instance
+        let result = MemoryType::new(10, Some(20), false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create a RecordsMemory instance
+        let rec_mem = RecordsMemory { memory };
+
+        // clone the RecordsMemory instance
+        let rec_mem_cloned = rec_mem.clone();
+
+        // drop the original RecordsMemory instance
+        drop(rec_mem);
+
+        // check the cloned RecordsMemory instance
+        assert_eq!(rec_mem_cloned.memory.page(), 10);
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/externals/mod.rs.html b/src/wasmedge_sdk/externals/mod.rs.html new file mode 100644 index 000000000..3fb87f203 --- /dev/null +++ b/src/wasmedge_sdk/externals/mod.rs.html @@ -0,0 +1,19 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+
mod function;
+mod global;
+mod memory;
+mod table;
+
+pub use function::{Func, FuncRef, FuncTypeBuilder};
+pub use global::Global;
+pub use memory::Memory;
+pub use table::Table;
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/externals/table.rs.html b/src/wasmedge_sdk/externals/table.rs.html new file mode 100644 index 000000000..c44c59cc7 --- /dev/null +++ b/src/wasmedge_sdk/externals/table.rs.html @@ -0,0 +1,563 @@ +table.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+
use crate::{types::Val, TableType, WasmEdgeResult};
+use wasmedge_sys as sys;
+
+/// Defines a table storing the references to host functions or external objects.
+#[derive(Debug, Clone)]
+pub struct Table {
+    pub(crate) inner: sys::Table,
+    pub(crate) name: Option<String>,
+    pub(crate) mod_name: Option<String>,
+    pub(crate) ty: TableType,
+}
+impl Table {
+    /// Creates a new wasm table instance with the given type.
+    ///
+    /// # Argument
+    ///
+    /// * `ty` - The type of the table instance to be created.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create the table instance, then WasmEdgeError::Table(TableError::Create)(crate::error::TableError) is returned.
+    pub fn new(ty: TableType) -> WasmEdgeResult<Self> {
+        let inner = sys::Table::create(&ty.clone().into())?;
+        Ok(Self {
+            inner,
+            name: None,
+            mod_name: None,
+            ty,
+        })
+    }
+
+    /// Returns the exported name of this table instance.
+    ///
+    /// Notice that this field is meaningful only if this table is used as an exported instance.
+    pub fn name(&self) -> Option<&str> {
+        match &self.name {
+            Some(name) => Some(name.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns the name of the [module instance](crate::Instance) from which this table instance exports.
+    ///
+    /// Notice that this field is meaningful only if this table is used as an exported instance.
+    pub fn mod_name(&self) -> Option<&str> {
+        match &self.mod_name {
+            Some(mod_name) => Some(mod_name.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns a reference to the type of this table.
+    pub fn ty(&self) -> &TableType {
+        &self.ty
+    }
+
+    /// Returns the size of this [Table].
+    pub fn size(&self) -> u32 {
+        self.inner.capacity() as u32
+    }
+
+    /// Grows the size of this table by `delta`, initializing the elements with the provided init value if `init` is given. Returns the previous size of the table.
+    ///
+    /// # Arguments
+    ///
+    /// * `delta` - The number of elements to grow the table instance by.
+    ///
+    /// * `init` - The value to initialize the new table slots with.
+    ///
+    /// # Error
+    ///
+    /// If fail to grow the table, then an error is returned.
+    pub fn grow(&mut self, delta: u32, init: Option<Val>) -> WasmEdgeResult<u32> {
+        // get the current size
+        let original_size = self.size();
+        // grow the table by delta
+        self.inner.grow(delta)?;
+        // initialize the new elements
+        if let Some(init) = init {
+            for idx in original_size..original_size + delta {
+                self.inner.set_data(init.clone().into(), idx)?;
+            }
+        }
+        Ok(original_size)
+    }
+
+    /// Returns the table element at the `index`.
+    ///
+    /// # Argument
+    ///
+    /// * `index` - the index of the table element to get.
+    ///
+    /// # Error
+    ///
+    /// If fail to get the table element, then an error is returned.
+    pub fn get(&self, index: u32) -> WasmEdgeResult<Val> {
+        let value = self.inner.get_data(index)?;
+        Ok(value.into())
+    }
+
+    /// Stores the `data` at the `index` of this table.
+    ///
+    /// # Arguments
+    ///
+    /// * `index` - the index of the table element to store.
+    ///
+    /// * `data` - the data to store at the `index` of this table.
+    ///
+    ///
+    /// # Error
+    ///
+    /// If fail to store the data, then an error is returned.
+    pub fn set(&mut self, index: u32, data: Val) -> WasmEdgeResult<()> {
+        self.inner.set_data(data.into(), index)?;
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        config::{CommonConfigOptions, ConfigBuilder},
+        error::HostFuncError,
+        types::Val,
+        CallingFrame, Executor, ImportObjectBuilder, NeverType, RefType, Statistics, Store,
+        ValType, WasmValue,
+    };
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_table_type() {
+        // create a TableType instance
+        let ty = TableType::new(RefType::FuncRef, 10, Some(20));
+
+        // check element type
+        assert_eq!(ty.elem_ty(), RefType::FuncRef);
+        // check minimum
+        assert_eq!(ty.minimum(), 10);
+        // check maximum
+        assert_eq!(ty.maximum(), Some(20));
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_table_basic() {
+        // create a table instance
+        let result = Table::new(TableType::new(RefType::FuncRef, 10, Some(20)));
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // create an import object
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host func")
+            .with_table("table", table)
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // register the import module
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        // get the module instance by name
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the exported host function
+        let result = instance.func("add");
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        // get the exported table by name
+        let result = instance.table("table");
+        assert!(result.is_ok());
+        let mut table = result.unwrap();
+
+        // check table
+        assert!(table.name().is_some());
+        assert_eq!(table.name().unwrap(), "table");
+        assert!(table.mod_name().is_some());
+        assert_eq!(table.mod_name().unwrap(), "extern");
+        assert_eq!(table.size(), 10);
+        let ty = table.ty();
+        assert_eq!(ty.elem_ty(), RefType::FuncRef);
+        assert_eq!(ty.minimum(), 10);
+        assert_eq!(ty.maximum(), Some(20));
+
+        // get value from table[0]
+        let result = table.get(0);
+        assert!(result.is_ok());
+        if let Val::FuncRef(func_ref) = result.unwrap() {
+            assert!(func_ref.is_none());
+        }
+
+        // set value to table[0]
+        let func_ref = host_func.as_ref();
+        let result = table.set(0, Val::FuncRef(Some(func_ref)));
+        assert!(result.is_ok());
+        // get the value in table[0]
+        let result = table.get(0);
+        assert!(result.is_ok());
+        if let Val::FuncRef(func_ref) = result.unwrap() {
+            assert!(func_ref.is_some());
+            let func_ref = func_ref.unwrap();
+            // check the signature of the host function
+            let func_ty = func_ref.ty();
+            assert!(func_ty.args().is_some());
+            assert_eq!(func_ty.args().unwrap(), [ValType::I32; 2]);
+            assert!(func_ty.returns().is_some());
+            assert_eq!(func_ty.returns().unwrap(), [ValType::I32]);
+        }
+
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        let result = instance.table("table");
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // get the value in table[0]
+        let result = table.get(0);
+        assert!(result.is_ok());
+        if let Val::FuncRef(func_ref) = result.unwrap() {
+            assert!(func_ref.is_some());
+            let func_ref = func_ref.unwrap();
+            let func_ty = func_ref.ty();
+            assert!(func_ty.args().is_some());
+            assert_eq!(func_ty.args().unwrap(), [ValType::I32; 2]);
+            assert!(func_ty.returns().is_some());
+            assert_eq!(func_ty.returns().unwrap(), [ValType::I32]);
+        }
+    }
+
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+        _data: *mut std::os::raw::c_void,
+    ) -> std::result::Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/import.rs.html b/src/wasmedge_sdk/import.rs.html new file mode 100644 index 000000000..414e82f00 --- /dev/null +++ b/src/wasmedge_sdk/import.rs.html @@ -0,0 +1,1947 @@ +import.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+
use crate::{
+    error::HostFuncError, io::WasmValTypeList, CallingFrame, FuncType, Global, Memory, Table,
+    WasmEdgeResult,
+};
+use wasmedge_sys::{self as sys, AsImport, WasmValue};
+
+/// Creates a normal or wasi [import object](crate::ImportObject).
+///
+/// # Example
+///
+/// This example shows how to create a normal import object that contains a host function, a global variable, a memory and a table. The import object is named "extern".
+///
+#[derive(Debug, Default)]
+pub struct ImportObjectBuilder {
+    funcs: Vec<(String, sys::Function)>,
+    globals: Vec<(String, sys::Global)>,
+    memories: Vec<(String, sys::Memory)>,
+    tables: Vec<(String, sys::Table)>,
+}
+impl ImportObjectBuilder {
+    /// Creates a new [ImportObjectBuilder].
+    pub fn new() -> Self {
+        Self {
+            funcs: Vec::new(),
+            globals: Vec::new(),
+            memories: Vec::new(),
+            tables: Vec::new(),
+        }
+    }
+
+    /// Adds a [host function](crate::Func) to the [ImportObject] to create.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [host function](crate::Func) to add.
+    ///
+    /// * `real_func` - The native function.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// # error
+    ///
+    /// If fail to create or add the [host function](crate::Func), then an error is returned.
+    pub fn with_func<Args, Rets, D>(
+        mut self,
+        name: impl AsRef<str>,
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Result<Vec<WasmValue>, HostFuncError>
+            + Send
+            + Sync
+            + 'static,
+        data: Option<Box<D>>,
+    ) -> WasmEdgeResult<Self>
+    where
+        Args: WasmValTypeList,
+        Rets: WasmValTypeList,
+    {
+        let boxed_func = Box::new(real_func);
+        let args = Args::wasm_types();
+        let returns = Rets::wasm_types();
+        let ty = FuncType::new(Some(args.to_vec()), Some(returns.to_vec()));
+        let inner_func = sys::Function::create_sync_func::<D>(&ty.into(), boxed_func, data, 0)?;
+        self.funcs.push((name.as_ref().to_owned(), inner_func));
+        Ok(self)
+    }
+
+    /// Adds a [host function](crate::Func) to the [ImportObject] to create.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [host function](crate::Func) to add.
+    ///
+    /// * `ty` - The function type.
+    ///
+    /// * `real_func` - The native function.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// # error
+    ///
+    /// If fail to create or add the [host function](crate::Func), then an error is returned.
+    pub fn with_func_by_type<D>(
+        mut self,
+        name: impl AsRef<str>,
+        ty: FuncType,
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Result<Vec<WasmValue>, HostFuncError>
+            + Send
+            + Sync
+            + 'static,
+        data: Option<Box<D>>,
+    ) -> WasmEdgeResult<Self> {
+        let boxed_func = Box::new(real_func);
+        let inner_func = sys::Function::create_sync_func::<D>(&ty.into(), boxed_func, data, 0)?;
+        self.funcs.push((name.as_ref().to_owned(), inner_func));
+        Ok(self)
+    }
+
+    /// Adds an [async host function](crate::Func) to the [ImportObject] to create.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [host function](crate::Func) to add.
+    ///
+    /// * `real_func` - The native function.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// # error
+    ///
+    /// If fail to create or add the [host function](crate::Func), then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub fn with_async_func<Args, Rets, D>(
+        mut self,
+        name: impl AsRef<str>,
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Box<
+                dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send,
+            > + Send
+            + Sync
+            + 'static,
+        data: Option<Box<D>>,
+    ) -> WasmEdgeResult<Self>
+    where
+        Args: WasmValTypeList,
+        Rets: WasmValTypeList,
+        D: Send + Sync,
+    {
+        let args = Args::wasm_types();
+        let returns = Rets::wasm_types();
+        let ty = FuncType::new(Some(args.to_vec()), Some(returns.to_vec()));
+        let inner_func =
+            sys::Function::create_async_func(&ty.into(), Box::new(real_func), data, 0)?;
+        self.funcs.push((name.as_ref().to_owned(), inner_func));
+        Ok(self)
+    }
+
+    /// Adds a [global](crate::Global) to the [ImportObject] to create.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [global](crate::Global) to add.
+    ///
+    /// * `global` - The wasm [global instance](crate::Global) to add.
+    ///
+    pub fn with_global(mut self, name: impl AsRef<str>, global: Global) -> Self {
+        self.globals.push((name.as_ref().to_owned(), global.inner));
+        self
+    }
+
+    /// Adds a [memory](crate::Memory) to the [ImportObject] to create.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [memory](crate::Memory) to add.
+    ///
+    /// * `memory` - The wasm [memory instance](crate::Memory) to add.
+    ///
+    pub fn with_memory(mut self, name: impl AsRef<str>, memory: Memory) -> Self {
+        self.memories.push((name.as_ref().to_owned(), memory.inner));
+        self
+    }
+
+    /// Adds a [table](crate::Table) to the [ImportObject] to create.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [table](crate::Table) to add.
+    ///
+    /// * `table` - The wasm [table instance](crate::Table) to add.
+    ///
+    pub fn with_table(mut self, name: impl AsRef<str>, table: Table) -> Self {
+        self.tables.push((name.as_ref().to_owned(), table.inner));
+        self
+    }
+
+    /// Creates a new [ImportObject].
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the [ImportObject] to create.
+    ///
+    /// * `host_data` - The host context data to be stored in the module instance.
+    ///
+    /// # Error
+    ///
+    /// If fail to create the [ImportObject], then an error is returned.
+    pub fn build<T>(
+        self,
+        name: impl AsRef<str>,
+        host_data: Option<Box<T>>,
+    ) -> WasmEdgeResult<ImportObject<T>>
+    where
+        T: ?Sized + Send + Sync + Clone,
+    {
+        let mut inner = sys::ImportModule::create(name.as_ref(), host_data)?;
+
+        // add func
+        for (name, func) in self.funcs.into_iter() {
+            inner.add_func(name, func);
+        }
+
+        // add global
+        for (name, global) in self.globals.into_iter() {
+            inner.add_global(name, global);
+        }
+
+        // add memory
+        for (name, memory) in self.memories.into_iter() {
+            inner.add_memory(name, memory);
+        }
+
+        // add table
+        for (name, table) in self.tables.into_iter() {
+            inner.add_table(name, table);
+        }
+
+        Ok(ImportObject(inner))
+    }
+}
+
+/// Defines an import object that contains the required import data used when instantiating a [module](crate::Module).
+///
+/// An [ImportObject] instance is created with [ImportObjectBuilder](crate::ImportObjectBuilder).
+#[derive(Debug, Clone)]
+pub struct ImportObject<T: ?Sized + Send + Sync + Clone>(pub(crate) sys::ImportModule<T>);
+impl<T: ?Sized + Send + Sync + Clone> ImportObject<T> {
+    /// Returns the name of the import object.
+    pub fn name(&self) -> &str {
+        self.0.name()
+    }
+
+    /// Returns the raw pointer to the inner `WasmEdge_ModuleInstanceContext`.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const sys::ffi::WasmEdge_ModuleInstanceContext {
+        self.0.as_ptr()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    #[cfg(not(feature = "async"))]
+    use crate::VmBuilder;
+    use crate::{
+        config::{CommonConfigOptions, ConfigBuilder},
+        error::{GlobalError, HostFuncError, WasmEdgeError},
+        params,
+        types::Val,
+        CallingFrame, Executor, Global, GlobalType, Memory, MemoryType, Mutability, NeverType,
+        RefType, Statistics, Store, Table, TableType, ValType, WasmVal, WasmValue,
+    };
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_import_builder() {
+        let result = ImportObjectBuilder::new().build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+        assert_eq!(import.name(), "extern");
+    }
+
+    #[test]
+    #[cfg(not(feature = "async"))]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_import_builder_with_data() {
+        // define host data
+        #[derive(Clone, Debug)]
+        struct Circle {
+            radius: i32,
+        }
+
+        let circle = Circle { radius: 10 };
+
+        let result = ImportObjectBuilder::new().build("extern", Some(Box::new(circle)));
+        assert!(result.is_ok());
+
+        let import = result.unwrap();
+        assert_eq!(import.name(), "extern");
+
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let mut vm = result.unwrap();
+
+        // register an import module into vm
+        let result = vm.register_import_module(&import);
+        assert!(result.is_ok());
+
+        // get active module instance
+        let result = vm.named_module_mut("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        let result = instance.host_data::<Circle>();
+        assert!(result.is_some());
+        let host_data = result.unwrap();
+        assert_eq!(host_data.radius, 10);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_import_add_func() {
+        fn real_add(
+            _frame: CallingFrame,
+            inputs: Vec<WasmValue>,
+            _data: *mut std::os::raw::c_void,
+        ) -> std::result::Result<Vec<WasmValue>, HostFuncError> {
+            if inputs.len() != 2 {
+                return Err(HostFuncError::User(1));
+            }
+
+            let a = if inputs[0].ty() == ValType::I32 {
+                inputs[0].to_i32()
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+
+            let b = if inputs[1].ty() == ValType::I32 {
+                inputs[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            let c = a + b;
+
+            Ok(vec![WasmValue::from_i32(c)])
+        }
+
+        // create an import object
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host func")
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        // get the instance of the ImportObject module
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the exported host function
+        let result = instance.func("add");
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        // check the signature of the host function
+        let func_ty = host_func.ty();
+        assert!(func_ty.args().is_some());
+        assert_eq!(func_ty.args().unwrap(), [ValType::I32; 2]);
+        assert!(func_ty.returns().is_some());
+        assert_eq!(func_ty.returns().unwrap(), [ValType::I32]);
+
+        let returns = host_func.run(&mut executor, params![1, 2]).unwrap();
+        assert_eq!(returns[0].to_i32(), 3);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_import_add_memory() {
+        // create a memory
+        let result = MemoryType::new(10, Some(20), false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create an import object
+        let result = ImportObjectBuilder::new()
+            .with_memory("memory", memory)
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        let result = store.named_instance("extern");
+        assert!(result.is_err());
+
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the exported memory
+        let result = instance.memory("memory");
+        assert!(result.is_ok());
+        let mut memory = result.unwrap();
+
+        // check memory
+        assert!(memory.name().is_some());
+        assert_eq!(memory.name().unwrap(), "memory");
+        assert_eq!(memory.mod_name(), Some("extern"));
+        assert_eq!(memory.page(), 10);
+        let ty = memory.ty();
+        assert_eq!(ty.minimum(), 10);
+        assert_eq!(ty.maximum(), Some(20));
+
+        // grow memory
+        let result = memory.grow(5);
+        assert!(result.is_ok());
+        assert_eq!(memory.page(), 15);
+
+        // get memory from instance again
+        let result = instance.memory("memory");
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+        assert_eq!(memory.page(), 15);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_import_add_global() {
+        // create a Const global variable
+        let result = Global::new(
+            GlobalType::new(ValType::I32, Mutability::Const),
+            Val::I32(1314),
+        );
+        assert!(result.is_ok());
+        let global_const = result.unwrap();
+
+        // create a Var global variable
+        let result = Global::new(
+            GlobalType::new(ValType::F32, Mutability::Var),
+            Val::F32(13.14),
+        );
+        assert!(result.is_ok());
+        let global_var = result.unwrap();
+
+        // create an import object
+        let result = ImportObjectBuilder::new()
+            .with_global("const-global", global_const)
+            .with_global("var-global", global_var)
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the Const global from the store of vm
+        let result = instance.global("const-global");
+        assert!(result.is_ok());
+        let mut const_global = result.unwrap();
+
+        // check global
+        assert!(const_global.name().is_some());
+        assert_eq!(const_global.name().unwrap(), "const-global");
+        assert!(const_global.mod_name().is_some());
+        assert_eq!(const_global.mod_name().unwrap(), "extern");
+        let ty = const_global.ty();
+        assert_eq!(ty.value_ty(), ValType::I32);
+        assert_eq!(ty.mutability(), Mutability::Const);
+
+        // get value of global
+        if let Val::I32(value) = const_global.get_value() {
+            assert_eq!(value, 1314);
+        }
+
+        // set a new value
+        let result = const_global.set_value(Val::I32(314));
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Global(GlobalError::ModifyConst))
+        );
+
+        // get the Var global from the store of vm
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the Var global from the store of vm
+        let result = instance.global("var-global");
+        assert!(result.is_ok());
+        let mut var_global = result.unwrap();
+
+        // check global
+        assert!(var_global.name().is_some());
+        assert_eq!(var_global.name().unwrap(), "var-global");
+        assert!(var_global.mod_name().is_some());
+        assert_eq!(var_global.mod_name().unwrap(), "extern");
+        let ty = var_global.ty();
+        assert_eq!(ty.value_ty(), ValType::F32);
+        assert_eq!(ty.mutability(), Mutability::Var);
+
+        // get the value of var_global
+        if let Val::F32(value) = var_global.get_value() {
+            assert_eq!(value, 13.14);
+        }
+
+        // set a new value
+        let result = var_global.set_value(Val::F32(1.314));
+        assert!(result.is_ok());
+
+        // get the value of var_global again
+        let result = instance.global("var-global");
+        assert!(result.is_ok());
+        let var_global = result.unwrap();
+        if let Val::F32(value) = var_global.get_value() {
+            assert_eq!(value, 1.314);
+        }
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_import_add_table() {
+        // create a wasm table instance
+        let result = Table::new(TableType::new(RefType::FuncRef, 10, Some(20)));
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // create an import object
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host func")
+            .with_table("table", table)
+            .build::<NeverType>("extern", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // get the exported host function
+        let result = instance.func("add");
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        // get the exported table
+        let result = instance.table("table");
+        assert!(result.is_ok());
+        let mut table = result.unwrap();
+
+        // check table
+        assert!(table.name().is_some());
+        assert_eq!(table.name().unwrap(), "table");
+        assert!(table.mod_name().is_some());
+        assert_eq!(table.mod_name().unwrap(), "extern");
+        assert_eq!(table.size(), 10);
+        let ty = table.ty();
+        assert_eq!(ty.elem_ty(), RefType::FuncRef);
+        assert_eq!(ty.minimum(), 10);
+        assert_eq!(ty.maximum(), Some(20));
+
+        // get value from table[0]
+        let result = table.get(0);
+        assert!(result.is_ok());
+        if let Val::FuncRef(func_ref) = result.unwrap() {
+            assert!(func_ref.is_none());
+        }
+
+        // set value to table[0]
+        let func_ref = host_func.as_ref();
+        let result = table.set(0, Val::FuncRef(Some(func_ref)));
+        assert!(result.is_ok());
+        // get the value in table[0]
+        let result = table.get(0);
+        assert!(result.is_ok());
+        if let Val::FuncRef(func_ref) = result.unwrap() {
+            assert!(func_ref.is_some());
+            let func_ref = func_ref.unwrap();
+            // check the signature of the host function
+            let func_ty = func_ref.ty();
+            assert!(func_ty.args().is_some());
+            assert_eq!(func_ty.args().unwrap(), [ValType::I32; 2]);
+            assert!(func_ty.returns().is_some());
+            assert_eq!(func_ty.returns().unwrap(), [ValType::I32]);
+        }
+
+        let result = store.named_instance("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        let result = instance.table("table");
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // get the value in table[0]
+        let result = table.get(0);
+        assert!(result.is_ok());
+        if let Val::FuncRef(func_ref) = result.unwrap() {
+            assert!(func_ref.is_some());
+            let func_ref = func_ref.unwrap();
+            // check the signature of the host function
+            let func_ty = func_ref.ty();
+            assert!(func_ty.args().is_some());
+            assert_eq!(func_ty.args().unwrap(), [ValType::I32; 2]);
+            assert!(func_ty.returns().is_some());
+            assert_eq!(func_ty.returns().unwrap(), [ValType::I32]);
+        }
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_import_send() {
+        // create a Const global instance
+        let result = Global::new(
+            GlobalType::new(ValType::F32, Mutability::Const),
+            Val::F32(3.5),
+        );
+        assert!(result.is_ok());
+        let global_const = result.unwrap();
+
+        // create a memory instance
+        let result = MemoryType::new(10, Some(20), false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create a table instance
+        let result = Table::new(TableType::new(RefType::FuncRef, 10, Some(20)));
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // create an ImportModule instance
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host function")
+            .with_global("global", global_const)
+            .with_memory("memory", memory)
+            .with_table("table", table)
+            .build::<NeverType>("extern-module-send", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            // create an executor
+            let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+
+            let result = Statistics::new();
+            assert!(result.is_ok());
+            let mut stat = result.unwrap();
+
+            let result = Executor::new(Some(&config), Some(&mut stat));
+            assert!(result.is_ok());
+            let mut executor = result.unwrap();
+
+            // create a store
+            let result = Store::new();
+            assert!(result.is_ok());
+            let mut store = result.unwrap();
+
+            // register an import module into store
+            let result = store.register_import_module(&mut executor, &import);
+            assert!(result.is_ok());
+
+            // get active module instance
+            let result = store.named_instance("extern-module-send");
+            assert!(result.is_ok());
+            let instance = result.unwrap();
+            assert!(instance.name().is_some());
+            assert_eq!(instance.name().unwrap(), "extern-module-send");
+
+            // check the exported global
+            let result = instance.global("global");
+            assert!(result.is_ok());
+            let global = result.unwrap();
+            let ty = global.ty();
+            assert_eq!(*ty, GlobalType::new(ValType::F32, Mutability::Const));
+            if let Val::F32(value) = global.get_value() {
+                assert_eq!(value, 3.5);
+            }
+
+            // get the exported memory
+            let result = instance.memory("memory");
+            assert!(result.is_ok());
+            let mut memory = result.unwrap();
+            // write data
+            let result = memory.write(vec![1; 10], 10);
+            assert!(result.is_ok());
+            // read data after write data
+            let result = memory.read(10, 10);
+            assert!(result.is_ok());
+            let data = result.unwrap();
+            assert_eq!(data, vec![1; 10]);
+
+            // get the exported table by name
+            let result = instance.table("table");
+            assert!(result.is_ok());
+            let table = result.unwrap();
+            // check table
+            assert!(table.name().is_some());
+            assert_eq!(table.name().unwrap(), "table");
+            assert!(table.mod_name().is_some());
+            assert_eq!(table.mod_name().unwrap(), "extern-module-send");
+            assert_eq!(table.size(), 10);
+            let ty = table.ty();
+            assert_eq!(ty.elem_ty(), RefType::FuncRef);
+            assert_eq!(ty.minimum(), 10);
+            assert_eq!(ty.maximum(), Some(20));
+
+            // get the exported host function
+            let result = instance.func("add");
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            // check the signature of the host function
+            let func_ty = host_func.ty();
+            assert!(func_ty.args().is_some());
+            assert_eq!(func_ty.args().unwrap(), [ValType::I32; 2]);
+            assert!(func_ty.returns().is_some());
+            assert_eq!(func_ty.returns().unwrap(), [ValType::I32]);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_import_sync() {
+        // create a Const global instance
+        let result = Global::new(
+            GlobalType::new(ValType::F32, Mutability::Const),
+            Val::F32(3.5),
+        );
+        assert!(result.is_ok());
+        let global_const = result.unwrap();
+
+        // create a memory instance
+        let result = MemoryType::new(10, Some(20), false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create a table instance
+        let result = Table::new(TableType::new(RefType::FuncRef, 10, Some(20)));
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // create an import object
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host function")
+            .with_global("global", global_const)
+            .with_memory("memory", memory)
+            .with_table("table", table)
+            .build::<NeverType>("extern-module-sync", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+        let import = Arc::new(Mutex::new(import));
+
+        let import_cloned = Arc::clone(&import);
+        let handle = thread::spawn(move || {
+            let result = import_cloned.lock();
+            assert!(result.is_ok());
+            let import = result.unwrap();
+
+            // create an executor
+            let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+
+            let result = Statistics::new();
+            assert!(result.is_ok());
+            let mut stat = result.unwrap();
+
+            let result = Executor::new(Some(&config), Some(&mut stat));
+            assert!(result.is_ok());
+            let mut executor = result.unwrap();
+
+            // create a store
+            let result = Store::new();
+            assert!(result.is_ok());
+            let mut store = result.unwrap();
+
+            // register an import module into store
+            let result = store.register_import_module(&mut executor, &import);
+            assert!(result.is_ok());
+
+            // get active module instance
+            let result = store.named_instance("extern-module-sync");
+            assert!(result.is_ok());
+            let instance = result.unwrap();
+            assert!(instance.name().is_some());
+            assert_eq!(instance.name().unwrap(), "extern-module-sync");
+
+            // check the exported global
+            let result = instance.global("global");
+            assert!(result.is_ok());
+            let global = result.unwrap();
+            let ty = global.ty();
+            assert_eq!(*ty, GlobalType::new(ValType::F32, Mutability::Const));
+            if let Val::F32(v) = global.get_value() {
+                assert_eq!(v, 3.5);
+            }
+
+            // get the exported memory
+            let result = instance.memory("memory");
+            assert!(result.is_ok());
+            let mut memory = result.unwrap();
+            // write data
+            let result = memory.write(vec![1; 10], 10);
+            assert!(result.is_ok());
+            // read data after write data
+            let result = memory.read(10, 10);
+            assert!(result.is_ok());
+            let data = result.unwrap();
+            assert_eq!(data, vec![1; 10]);
+
+            // get the exported table by name
+            let result = instance.table("table");
+            assert!(result.is_ok());
+            let table = result.unwrap();
+            // check table
+            assert!(table.name().is_some());
+            assert_eq!(table.name().unwrap(), "table");
+            assert!(table.mod_name().is_some());
+            assert_eq!(table.mod_name().unwrap(), "extern-module-sync");
+            assert_eq!(table.size(), 10);
+            let ty = table.ty();
+            assert_eq!(ty.elem_ty(), RefType::FuncRef);
+            assert_eq!(ty.minimum(), 10);
+            assert_eq!(ty.maximum(), Some(20));
+
+            // get the exported host function
+            let result = instance.func("add");
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            // check the signature of the host function
+            let func_ty = host_func.ty();
+            assert!(func_ty.args().is_some());
+            assert_eq!(func_ty.args().unwrap(), [ValType::I32; 2]);
+            assert!(func_ty.returns().is_some());
+            assert_eq!(func_ty.returns().unwrap(), [ValType::I32]);
+
+            // run host func
+            let result = host_func.run(&mut executor, params!(2, 3));
+            assert!(result.is_ok());
+            let returns = result.unwrap();
+            assert_eq!(returns[0].to_i32(), 5);
+        });
+
+        handle.join().unwrap();
+    }
+
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+        _data: *mut std::os::raw::c_void,
+    ) -> std::result::Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/instance.rs.html b/src/wasmedge_sdk/instance.rs.html new file mode 100644 index 000000000..072d15d16 --- /dev/null +++ b/src/wasmedge_sdk/instance.rs.html @@ -0,0 +1,793 @@ +instance.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+
//! Defines WasmEdge Instance.
+
+use crate::{
+    Func, FuncType, Global, GlobalType, Memory, MemoryType, Table, TableType, WasmEdgeResult,
+};
+use wasmedge_sys as sys;
+
+/// Represents an instantiated module.
+///
+/// An [Instance] represents an instantiated module. In the instantiation process, A [module instance](crate::Instance) is created based on a [compiled module](crate::Module). From a [module instance] the exported [host function](crate::Func), [table](crate::Table), [memory](crate::Memory), and [global](crate::Global) instances can be fetched.
+#[derive(Debug, Clone)]
+pub struct Instance {
+    pub(crate) inner: sys::Instance,
+}
+impl Instance {
+    /// Returns the name of this exported [module instance](crate::Instance).
+    ///
+    /// If this [module instance](crate::Instance) is an active [instance](crate::Instance), return None.
+    pub fn name(&self) -> Option<String> {
+        self.inner.name()
+    }
+
+    /// Returns the count of the exported [function instances](crate::Func) in this [module instance](crate::Instance).
+    pub fn func_count(&self) -> usize {
+        self.inner.func_len() as usize
+    }
+
+    /// Returns the names of the exported [function instances](crate::Func) in this [module instance](crate::Instance).
+    pub fn func_names(&self) -> Option<Vec<String>> {
+        self.inner.func_names()
+    }
+
+    /// Returns the exported [function instance](crate::Func) in this [module instance](crate::Instance) by the given function name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - the name of the target exported [function instance](crate::Func).
+    pub fn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func> {
+        let inner_func = self.inner.get_func(name.as_ref())?;
+        let ty: FuncType = inner_func.ty()?.into();
+
+        Ok(Func {
+            inner: inner_func,
+            name: Some(name.as_ref().into()),
+            mod_name: self.inner.name(),
+            ty,
+        })
+    }
+
+    /// Returns the count of the exported [global instances](crate::Global) in this [module instance](crate::Instance).
+    pub fn global_count(&self) -> usize {
+        self.inner.global_len() as usize
+    }
+
+    /// Returns the names of the exported [global instances](crate::Global) in this [module instance](crate::Instance).
+    pub fn global_names(&self) -> Option<Vec<String>> {
+        self.inner.global_names()
+    }
+
+    /// Returns the exported [global instance](crate::Global) in this [module instance](crate::Instance) by the given global name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - the name of the target exported [global instance](crate::Global).
+    pub fn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global> {
+        let inner_global = self.inner.get_global(name.as_ref())?;
+        let ty: GlobalType = inner_global.ty()?.into();
+
+        Ok(Global {
+            inner: inner_global,
+            name: Some(name.as_ref().into()),
+            mod_name: self.inner.name(),
+            ty,
+        })
+    }
+
+    /// Returns the count of the exported [memory instances](crate::Memory) in this [module instance](crate::Instance).
+    pub fn memory_count(&self) -> usize {
+        self.inner.mem_len() as usize
+    }
+
+    /// Returns the names of the exported [memory instances](crate::Memory) in this [module instance](crate::Instance).
+    pub fn memory_names(&self) -> Option<Vec<String>> {
+        self.inner.mem_names()
+    }
+
+    /// Returns the exported [memory instance](crate::Memory) in this [module instance](crate::Instance) by the given memory name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - the name of the target exported [memory instance](crate::Memory).
+    pub fn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory> {
+        let inner_memory = self.inner.get_memory(name.as_ref())?;
+        let ty: MemoryType = inner_memory.ty()?.into();
+
+        Ok(Memory {
+            inner: inner_memory,
+            name: Some(name.as_ref().into()),
+            mod_name: self.inner.name(),
+            ty,
+        })
+    }
+
+    /// Returns the count of the exported [table instances](crate::Table) in this [module instance](crate::Instance).
+    pub fn table_count(&self) -> usize {
+        self.inner.table_len() as usize
+    }
+
+    /// Returns the names of the exported [table instances](crate::Table) in this [module instance](crate::Instance).
+    pub fn table_names(&self) -> Option<Vec<String>> {
+        self.inner.table_names()
+    }
+
+    /// Returns the exported [table instance](crate::Table) in this [module instance](crate::Instance) by the given table name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - the name of the target exported [table instance](crate::Table).
+    pub fn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table> {
+        let inner_table = self.inner.get_table(name.as_ref())?;
+        let ty: TableType = inner_table.ty()?.into();
+
+        Ok(Table {
+            inner: inner_table,
+            name: Some(name.as_ref().into()),
+            mod_name: self.inner.name(),
+            ty,
+        })
+    }
+
+    /// Returns the host data held by the module instance.
+    pub fn host_data<T: Send + Sync + Clone>(&mut self) -> Option<&mut T> {
+        self.inner.host_data()
+    }
+}
+
+/// The object used as an module instance is required to implement this trait.
+pub trait AsInstance {
+    /// Returns the name of this exported module instance.
+    fn name(&self) -> &str;
+
+    /// Returns the count of the exported [function instances](crate::Func) in this module instance.
+    fn func_count(&self) -> usize;
+
+    /// Returns the names of the exported [function instances](crate::Func) in this module instance.
+    fn func_names(&self) -> Option<Vec<String>>;
+
+    /// Returns the exported [function instance](crate::Func) in this module instance.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - the name of the target exported [function instance](crate::Func).
+    fn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func>;
+
+    /// Returns the count of the exported global instances.
+    fn global_count(&self) -> usize;
+
+    /// Returns the names of the exported [global instances](crate::Global) in this module instance.
+    fn global_names(&self) -> Option<Vec<String>>;
+
+    /// Returns the exported [global instance](crate::Global) in this module instance.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - the name of the target exported [global instance](crate::Global).
+    fn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>;
+
+    /// Returns the count of the exported [memory instances](crate::Memory) in this module instance.
+    fn memory_count(&self) -> usize;
+
+    /// Returns the names of the exported [memory instances](crate::Memory) in this module instance.
+    fn memory_names(&self) -> Option<Vec<String>>;
+
+    /// Returns the exported [memory instance](crate::Memory) in this module instance.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - the name of the target exported [memory instance](crate::Memory).
+    fn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>;
+
+    /// Returns the count of the exported [table instances](crate::Table) in this module instance.
+    fn table_count(&self) -> usize;
+
+    /// Returns the names of the exported [table instances](crate::Table) in this module instance.
+    fn table_names(&self) -> Option<Vec<String>>;
+
+    /// Returns the exported [table instance](crate::Table) in this module instance by the given table name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - the name of the target exported [table instance](crate::Table).
+    fn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>;
+}
+
+#[cfg(test)]
+#[cfg(target_os = "linux")]
+mod tests {
+    use crate::{
+        config::{CommonConfigOptions, ConfigBuilder},
+        error::HostFuncError,
+        types::Val,
+        CallingFrame, Executor, FuncTypeBuilder, Global, GlobalType, ImportObjectBuilder, Memory,
+        MemoryType, Module, Mutability, NeverType, RefType, Statistics, Store, Table, TableType,
+        ValType, WasmValue,
+    };
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_basic() {
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // check the exported instances
+        assert_eq!(store.named_instance_count(), 0);
+        assert_eq!(store.instance_names().len(), 0);
+
+        // create a Const global instance
+        let result = Global::new(
+            GlobalType::new(ValType::F32, Mutability::Const),
+            Val::F32(3.5),
+        );
+        assert!(result.is_ok());
+        let global_const = result.unwrap();
+
+        // create a memory instance
+        let result = MemoryType::new(10, None, false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create a table instance
+        let result = Table::new(TableType::new(RefType::FuncRef, 5, None));
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // create an ImportModule instance
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host function")
+            .with_global("global", global_const)
+            .with_memory("mem", memory)
+            .with_table("table", table)
+            .build::<NeverType>("extern-module", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        // add a wasm module from a file
+        let file = std::env::current_dir()
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+        let result = Module::from_file(Some(&config), file);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // register a module into store as a named module
+        let result = store.register_named_module(&mut executor, "fib-module", &module);
+        assert!(result.is_ok());
+
+        // check the exported instances
+        assert_eq!(store.named_instance_count(), 2);
+        assert_eq!(store.instance_names().len(), 2);
+        let mod_names = store.instance_names();
+        assert_eq!(mod_names[0], "extern-module");
+        assert_eq!(mod_names[1], "fib-module");
+
+        // check the module instance named "extern-module"
+        {
+            assert_eq!(mod_names[0], "extern-module");
+            let result = store.named_instance(mod_names[0].as_str());
+            assert!(result.is_ok());
+            let instance = result.unwrap();
+            assert!(instance.name().is_some());
+            assert_eq!(instance.name().unwrap(), mod_names[0]);
+
+            assert_eq!(instance.func_count(), 1);
+            assert_eq!(instance.table_count(), 1);
+            assert_eq!(instance.global_count(), 1);
+            assert_eq!(instance.memory_count(), 1);
+
+            // check the exported host function
+            let result = instance.func("add");
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            assert_eq!(
+                host_func.ty(),
+                &FuncTypeBuilder::new()
+                    .with_args(vec![ValType::I32; 2])
+                    .with_returns(vec![ValType::I32])
+                    .build()
+            );
+
+            // check the exported table
+            let result = instance.table("table");
+            assert!(result.is_ok());
+            let table = result.unwrap();
+
+            let table_name = table.name();
+            assert!(table_name.is_some());
+            assert_eq!(table.name().unwrap(), "table");
+            assert_eq!(table.mod_name().unwrap(), "extern-module");
+            assert_eq!(table.size(), 5);
+
+            // check the exported memory
+            let result = instance.memory("mem");
+            assert!(result.is_ok());
+            let memory = result.unwrap();
+
+            assert_eq!(memory.name().unwrap(), "mem");
+            assert_eq!(memory.mod_name().unwrap(), "extern-module");
+            assert_eq!(memory.page(), 10);
+            assert_eq!(memory.size(), 65536 * 10);
+
+            // check the exported global
+            let result = instance.global("global");
+            assert!(result.is_ok());
+            let global = result.unwrap();
+            let val = global.get_value();
+            if let Val::F32(val) = val {
+                assert_eq!(val, 3.5);
+            }
+        }
+
+        // check the module instance named "fib-module"
+        {
+            assert_eq!(mod_names[1], "fib-module");
+            let result = store.named_instance(mod_names[1].as_str());
+            assert!(result.is_ok());
+            let instance = result.unwrap();
+            assert!(instance.name().is_some());
+            assert_eq!(instance.name().unwrap(), mod_names[1]);
+
+            assert_eq!(instance.func_count(), 1);
+            assert_eq!(instance.table_count(), 0);
+            assert_eq!(instance.global_count(), 0);
+            assert_eq!(instance.memory_count(), 1);
+
+            // check the exported host function
+            let result = instance.func("fib");
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            assert_eq!(
+                host_func.ty(),
+                &FuncTypeBuilder::new()
+                    .with_args(vec![ValType::I32])
+                    .with_returns(vec![ValType::I32])
+                    .build()
+            );
+        }
+    }
+
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+        _data: *mut std::os::raw::c_void,
+    ) -> std::result::Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/io.rs.html b/src/wasmedge_sdk/io.rs.html new file mode 100644 index 000000000..1794c7a6e --- /dev/null +++ b/src/wasmedge_sdk/io.rs.html @@ -0,0 +1,621 @@ +io.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+
use crate::{types::ExternRef, FuncRef, ValType, WasmValue};
+
+/// Describes the mapping of Rust type to Wasm type.
+///
+/// ```rust
+/// use wasmedge_sdk::{WasmValType, ValType};
+///
+/// assert_eq!(i32::WASM_TYPE, ValType::I32);
+/// ```
+///
+pub trait WasmValType {
+    /// The Wasm type.
+    const WASM_TYPE: ValType;
+}
+
+/// The `impl_wasm_val_type` macro is used to generate the following struct
+///
+/// ```ignore
+/// impl WasmValType for i32 {
+///     const WASM_TYPE: ValType = ValType::I32;
+/// }
+/// ```
+macro_rules! impl_wasm_val_type {
+    ($t:ty, $w:expr) => {
+        impl WasmValType for $t {
+            const WASM_TYPE: ValType = $w;
+        }
+    };
+}
+
+impl_wasm_val_type!(i8, ValType::I32);
+impl_wasm_val_type!(u8, ValType::I32);
+impl_wasm_val_type!(i16, ValType::I32);
+impl_wasm_val_type!(u16, ValType::I32);
+impl_wasm_val_type!(i32, ValType::I32);
+impl_wasm_val_type!(u32, ValType::I64);
+impl_wasm_val_type!(i64, ValType::I64);
+impl_wasm_val_type!(f32, ValType::F32);
+impl_wasm_val_type!(f64, ValType::F64);
+impl_wasm_val_type!(i128, ValType::V128);
+impl_wasm_val_type!(FuncRef, ValType::FuncRef);
+impl_wasm_val_type!(ExternRef, ValType::ExternRef);
+
+#[cfg(test)]
+mod test_wasm_val_type {
+    use super::*;
+
+    #[test]
+    fn test_wasm_types() {
+        assert_eq!(i8::WASM_TYPE, ValType::I32);
+        assert_eq!(u8::WASM_TYPE, ValType::I32);
+        assert_eq!(i16::WASM_TYPE, ValType::I32);
+        assert_eq!(u16::WASM_TYPE, ValType::I32);
+        assert_eq!(i32::WASM_TYPE, ValType::I32);
+        assert_eq!(u32::WASM_TYPE, ValType::I64);
+        assert_eq!(i64::WASM_TYPE, ValType::I64);
+        assert_eq!(f32::WASM_TYPE, ValType::F32);
+        assert_eq!(f64::WASM_TYPE, ValType::F64);
+        assert_eq!(i128::WASM_TYPE, ValType::V128);
+        assert_eq!(FuncRef::WASM_TYPE, ValType::FuncRef);
+        assert_eq!(ExternRef::WASM_TYPE, ValType::ExternRef);
+    }
+}
+
+/// Describes the mapping of a tuple of Rust types to Wasm types.
+///
+/// ```rust
+/// use wasmedge_sdk::{FuncRef, types::ExternRef, ValType, WasmValTypeList};
+///
+/// assert_eq!(
+///      <(i32, i64, f32, f64, FuncRef, ExternRef)>::wasm_types(),
+///      [ValType::I32, ValType::I64, ValType::F32, ValType::F64, ValType::FuncRef, ValType::ExternRef]
+/// );
+/// ```
+pub trait WasmValTypeList
+where
+    Self: Sized,
+{
+    /// The array type that can hold all the represented values.
+    ///
+    /// Note that all values are stored in their binary form.
+    type Array: AsMut<[i128]>;
+
+    /// Get the Wasm types for the tuple (list) of currently
+    /// represented values.
+    fn wasm_types() -> &'static [ValType];
+}
+
+macro_rules! impl_wasm_val_type_list {
+    ( $($o:ident),* ) => {
+        #[allow(unused_parens, dead_code)]
+        impl< $( $o ),* >
+            WasmValTypeList
+        for ( $( $o ),* )
+        where
+            $( $o: WasmValType ),*
+        {
+            type Array = [i128; count_idents!( $( $o ),* )];
+
+            fn wasm_types() -> &'static [ValType] {
+                &[
+                    $(
+                        $o::WASM_TYPE
+                    ),*
+                ]
+            }
+        }
+    };
+}
+
+// Count the number of identifiers at compile-time.
+macro_rules! count_idents {
+    ( $($idents:ident),* ) => {
+        {
+            #[allow(dead_code, non_camel_case_types)]
+            enum Idents { $( $idents, )* __CountIdentsLast }
+            const COUNT: usize = Idents::__CountIdentsLast as usize;
+            COUNT
+        }
+    };
+}
+
+impl_wasm_val_type_list!();
+impl_wasm_val_type_list!(A1);
+impl_wasm_val_type_list!(A1, A2);
+impl_wasm_val_type_list!(A1, A2, A3);
+impl_wasm_val_type_list!(A1, A2, A3, A4);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8, A9);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15);
+impl_wasm_val_type_list!(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24, A25
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24, A25, A26
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24, A25, A26, A27
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24, A25, A26, A27, A28
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24, A25, A26, A27, A28, A29
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24, A25, A26, A27, A28, A29, A30
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24, A25, A26, A27, A28, A29, A30, A31
+);
+impl_wasm_val_type_list!(
+    A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21,
+    A22, A23, A24, A25, A26, A27, A28, A29, A30, A31, A32
+);
+
+#[cfg(test)]
+mod test_wasm_val_type_list {
+    use super::*;
+
+    #[test]
+    fn test_wasm_types_for_multi_values() {
+        assert_eq!(<()>::wasm_types(), []);
+        assert_eq!(<(i32, i32)>::wasm_types(), [ValType::I32, ValType::I32]);
+        assert_eq!(<(i64, i64)>::wasm_types(), [ValType::I64, ValType::I64]);
+        assert_eq!(<(f32, f32)>::wasm_types(), [ValType::F32, ValType::F32]);
+        assert_eq!(<(f64, f64)>::wasm_types(), [ValType::F64, ValType::F64]);
+        assert_eq!(
+            <(i32, i64, f32, f64, FuncRef, ExternRef)>::wasm_types(),
+            [
+                ValType::I32,
+                ValType::I64,
+                ValType::F32,
+                ValType::F64,
+                ValType::FuncRef,
+                ValType::ExternRef,
+            ]
+        );
+        assert_eq!(
+            <(FuncRef, ExternRef)>::wasm_types(),
+            [ValType::FuncRef, ValType::ExternRef]
+        );
+    }
+}
+
+/// Defines the function converting a value of Rust type to the one of Wasm type.
+pub trait WasmVal {
+    fn to_wasm_value(self) -> WasmValue;
+}
+impl WasmVal for i8 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_i32(self as i32)
+    }
+}
+impl WasmVal for u8 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_i32(self as i32)
+    }
+}
+impl WasmVal for i16 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_i32(self as i32)
+    }
+}
+impl WasmVal for u16 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_i32(self as i32)
+    }
+}
+impl WasmVal for i32 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_i32(self)
+    }
+}
+impl WasmVal for u32 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_i64(self as i64)
+    }
+}
+impl WasmVal for i64 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_i64(self)
+    }
+}
+impl WasmVal for f32 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_f32(self)
+    }
+}
+impl WasmVal for f64 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_f64(self)
+    }
+}
+impl WasmVal for i128 {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_v128(self)
+    }
+}
+impl WasmVal for FuncRef {
+    fn to_wasm_value(self) -> WasmValue {
+        WasmValue::from_func_ref(self.inner)
+    }
+}
+impl WasmVal for ExternRef {
+    fn to_wasm_value(self) -> WasmValue {
+        self.inner
+    }
+}
+
+/// Generates arguments of [WasmValue](crate::WasmValue) types.
+///
+/// Notice that to use the macro, it is required to use `WasmVal` trait.
+#[macro_export]
+macro_rules! params {
+    ( $( $x:expr ),* ) => {
+        #[allow(unused_mut)]
+        {
+            let mut temp_vec = vec![];
+            $(
+                temp_vec.push($x.to_wasm_value());
+
+            )*
+            temp_vec
+        }
+    };
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/lib.rs.html b/src/wasmedge_sdk/lib.rs.html new file mode 100644 index 000000000..c0285873f --- /dev/null +++ b/src/wasmedge_sdk/lib.rs.html @@ -0,0 +1,397 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+
#![doc(
+    html_logo_url = "https://github.com/cncf/artwork/blob/master/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.png?raw=true",
+    html_favicon_url = "https://raw.githubusercontent.com/cncf/artwork/49169bdbc88a7ce3c4a722c641cc2d548bd5c340/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.svg"
+)]
+// If the version of rust used is less than v1.63, please uncomment the follow attribute.
+// #![feature(explicit_generic_args_with_impl_trait)]
+#![allow(clippy::vec_init_then_push)]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+
+//! # Overview
+//!
+//! WasmEdge Rust SDK provides idiomatic [Rust](https://www.rust-lang.org/) language bindings for [WasmEdge](https://wasmedge.org/)
+//!
+//! **Notice:** This project is still under active development and not guaranteed to have a stable API.
+//!
+//! - [WasmEdge website](https://wasmedge.org/)
+//! - [WasmEdge Docs](https://wasmedge.org/docs/)
+//! - [WasmEdge GitHub Page](https://github.com/WasmEdge/WasmEdge)
+//! - [WasmEdge Rust SDK GitHub Page](https://github.com/WasmEdge/wasmedge-rust-sdk)
+//! - [WasmEdge Rust SDK Examples](https://github.com/second-state/wasmedge-rustsdk-examples)
+//!
+//! ## Get Started
+//!
+//! Since this crate depends on the WasmEdge C API, it needs to be installed in your system first. Please refer to [WasmEdge Installation and Uninstallation](https://wasmedge.org/book/en/quick_start/install.html) to install the WasmEdge library. The versioning table below shows the version of the WasmEdge library required by each version of the `wasmedge-sdk` crate.
+//!
+//! | wasmedge-sdk  | WasmEdge lib  | wasmedge-sys  | wasmedge-types| wasmedge-macro| async-wasi|
+//! | :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
+//! | 0.13.1        | 0.13.5        | 0.17.3        | 0.4.4         | 0.6.1         | 0.1.0     |
+//! | 0.13.0        | 0.13.5        | 0.17.3        | 0.4.4         | 0.6.1         | 0.1.0     |
+//! | 0.12.2        | 0.13.4        | 0.17.2        | 0.4.4         | 0.6.1         | 0.1.0     |
+//! | 0.12.1        | 0.13.4        | 0.17.1        | 0.4.4         | 0.6.1         | 0.1.0     |
+//! | 0.12.0        | 0.13.4        | 0.17.0        | 0.4.4         | 0.6.1         | 0.1.0     |
+//! | 0.11.2        | 0.13.3        | 0.16.2        | 0.4.3         | 0.6.1         | 0.1.0     |
+//! | 0.11.0        | 0.13.3        | 0.16.0        | 0.4.3         | 0.6.0         | 0.0.3     |
+//! | 0.10.1        | 0.13.3        | 0.15.1        | 0.4.2         | 0.5.0         | 0.0.2     |
+//! | 0.10.0        | 0.13.2        | 0.15.0        | 0.4.2         | 0.5.0         | 0.0.2     |
+//! | 0.9.0         | 0.13.1        | 0.14.0        | 0.4.2         | 0.4.0         | 0.0.1     |
+//! | 0.9.0         | 0.13.0        | 0.14.0        | 0.4.2         | 0.4.0         | 0.0.1     |
+//! | 0.8.1         | 0.12.1        | 0.13.1        | 0.4.1         | 0.3.0         | -         |
+//! | 0.8.0         | 0.12.0        | 0.13.0        | 0.4.1         | 0.3.0         | -         |
+//! | 0.7.1         | 0.11.2        | 0.12.2        | 0.3.1         | 0.3.0         | -         |
+//! | 0.7.0         | 0.11.2        | 0.12          | 0.3.1         | 0.3.0         | -         |
+//! | 0.6.0         | 0.11.2        | 0.11          | 0.3.0         | 0.2.0         | -         |
+//! | 0.5.0         | 0.11.1        | 0.10          | 0.3.0         | 0.1.0         | -         |
+//! | 0.4.0         | 0.11.0        | 0.9           | 0.2.1         | -             | -         |
+//! | 0.3.0         | 0.10.1        | 0.8           | 0.2           | -             | -         |
+//! | 0.1.0         | 0.10.0        | 0.7           | 0.1           | -             | -         |
+//!
+//!
+//! WasmEdge Rust SDK will automatically search for the WasmEdge library in your system. Alternatively you can set the `WASMEDGE_DIR` environment variable to the path of the WasmEdge library (or the `WASMEDGE_INCLUDE_DIR` and `WASMEDGE_LIB_DIR` variables for more fine-grained control). If you want to use a local `cmake` build of WasmEdge you can set the `WASMEDGE_BUILD_DIR` instead.
+//!
+//! WasmEdge Rust SDK will search for the WasmEdge library in the following paths in order:
+//!
+//! - `$WASMEDGE_[INCLUDE|LIB]_DIR`
+//! - `$WASMEDGE_DIR`
+//! - `$WASMEDGE_BUILD_DIR`
+//! - `$HOME/.wasmedge`
+//! - `/usr/local`
+//! - `$HOME/.local`
+//!
+//! When the `standalone` feature is enabled the correct library will be downloaded during build time and the previous locations are ignored. You can specify a proxy for the download process using the `WASMEDGE_STANDALONE_PROXY`, `WASMEDGE_STANDALONE_PROXY_USER` and `WASMEDGE_STANDALONE_PROXY_PASS` environment variables. You can set the `WASMEDGE_STANDALONE_ARCHIVE` environment variable to use a local archive instead of downloading one.
+//! The following architectures are supported for automatic downloads:
+//!
+//! | os    | libc    | architecture        | linking type    |
+//! | :---: | :-----: | :-----------------: | :-------------: |
+//! | macos | -       | `x86_64`, `aarch64` | dynamic         |
+//! | linux | `glibc` | `x86_64`, `aarch64` | static, dynamic |
+//! | linux | `musl`  | `x86_64`, `aarch64` | static          |
+//!
+//! This crate uses `rust-bindgen` during the build process. If you would like to use an external `rust-bindgen` you can set the `WASMEDGE_RUST_BINDGEN_PATH` environment variable to the `bindgen` executable path. This is particularly useful in systems like Alpine Linux (see [rust-lang/rust-bindgen#2360](https://github.com/rust-lang/rust-bindgen/issues/2360#issuecomment-1595869379), [rust-lang/rust-bindgen#2333](https://github.com/rust-lang/rust-bindgen/issues/2333)).
+//!
+//! **Notice:** The minimum supported Rust version is 1.71.
+//!
+//! ## API Reference
+//!
+//! - [API Reference](https://wasmedge.github.io/wasmedge-rust-sdk/wasmedge_sdk/index.html)
+//! - [Async API Reference](https://second-state.github.io/wasmedge-async-rust-sdk/wasmedge_sdk/index.html)
+//!
+//! ## Examples
+//!
+//! The [Examples of WasmEdge RustSDK](https://github.com/second-state/wasmedge-rustsdk-examples) repo contains a number of examples that demonstrate how to use the WasmEdge Rust SDK.
+//!
+//! ## Contributing
+//!
+//! Please read the [contribution guidelines](https://github.com/WasmEdge/wasmedge-rust-sdk/blob/main/CONTRIBUTING.md) on how to contribute code.
+//!
+//! ## License
+//!
+//! This project is licensed under the terms of the [Apache 2.0 license](https://github.com/tensorflow/rust/blob/HEAD/LICENSE).
+//!
+
+#[doc(hidden)]
+pub mod caller;
+#[doc(hidden)]
+#[cfg(feature = "aot")]
+#[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+mod compiler;
+pub mod config;
+pub mod dock;
+mod executor;
+mod externals;
+mod import;
+mod instance;
+#[doc(hidden)]
+pub mod io;
+#[doc(hidden)]
+pub mod log;
+mod module;
+pub mod plugin;
+mod statistics;
+mod store;
+pub mod types;
+pub mod utils;
+#[doc(hidden)]
+pub mod vm;
+pub mod wasi;
+
+pub use caller::Caller;
+#[doc(inline)]
+#[cfg(feature = "aot")]
+#[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+pub use compiler::Compiler;
+#[doc(inline)]
+pub use executor::Executor;
+#[doc(inline)]
+pub use externals::{Func, FuncRef, FuncTypeBuilder, Global, Memory, Table};
+#[doc(inline)]
+pub use import::{ImportObject, ImportObjectBuilder};
+pub use instance::{AsInstance, Instance};
+#[doc(inline)]
+pub use io::{WasmVal, WasmValType, WasmValTypeList};
+#[doc(inline)]
+pub use log::LogManager;
+#[doc(inline)]
+pub use module::{ExportType, ImportType, Module};
+#[doc(inline)]
+pub use statistics::Statistics;
+#[doc(inline)]
+pub use store::Store;
+#[doc(inline)]
+pub use vm::{Vm, VmBuilder};
+
+pub use wasmedge_types::{
+    error, wat2wasm, CompilerOptimizationLevel, CompilerOutputFormat, ExternalInstanceType,
+    FuncType, GlobalType, HostRegistration, MemoryType, Mutability, RefType, TableType, ValType,
+    WasmEdgeResult,
+};
+
+#[cfg(all(feature = "async", target_os = "linux"))]
+#[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+pub use wasmedge_macro::async_host_function;
+pub use wasmedge_macro::host_function;
+
+/// WebAssembly value type.
+pub type WasmValue = wasmedge_sys::types::WasmValue;
+
+/// This is a workaround solution to the [`never`](https://doc.rust-lang.org/std/primitive.never.html) type in Rust. It will be replaced by `!` once it is stable.
+pub type NeverType = wasmedge_types::NeverType;
+
+#[doc(hidden)]
+pub type CallingFrame = wasmedge_sys::CallingFrame;
+
+/// The object that is used to perform a [host function](crate::Func) is required to implement this trait.
+pub trait Engine {
+    /// Runs a host function instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    fn run_func(
+        &self,
+        func: &Func,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>>;
+
+    /// Runs a host function instance by calling its reference and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func_ref` - A reference to the target host function instance.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    fn run_func_ref(
+        &self,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>>;
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/log.rs.html b/src/wasmedge_sdk/log.rs.html new file mode 100644 index 000000000..f27727dd2 --- /dev/null +++ b/src/wasmedge_sdk/log.rs.html @@ -0,0 +1,47 @@ +log.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
//! Defines WasmEdge LogManager struct
+
+use wasmedge_sys as sys;
+
+/// Manipulates the runtime logger.
+#[derive(Debug)]
+pub struct LogManager {}
+impl LogManager {
+    /// Logs the debug information.
+    pub fn log_debug_info() {
+        sys::utils::log_debug_info()
+    }
+
+    /// Logs the error information.
+    pub fn log_error_info() {
+        sys::utils::log_error_info()
+    }
+
+    /// Sets the logging system off.
+    pub fn log_off() {
+        sys::utils::log_off()
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/module.rs.html b/src/wasmedge_sdk/module.rs.html new file mode 100644 index 000000000..fedb6331b --- /dev/null +++ b/src/wasmedge_sdk/module.rs.html @@ -0,0 +1,929 @@ +module.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+
//! Defines WasmEdge AST Module, ImportType, and ExportType.
+
+use crate::{config::Config, ExternalInstanceType, WasmEdgeResult};
+use std::{borrow::Cow, marker::PhantomData, path::Path};
+use wasmedge_sys as sys;
+
+/// Defines compiled in-memory representation of an input WASM binary.
+///
+/// A [Module] is a compiled in-memory representation of an input WebAssembly binary. In the instantiation process, a [Module] is instatiated to a module [instance](crate::Instance), from which the exported [function](crate::Func), [table](crate::Table), [memory](crate::Memory), and [global](crate::Global) instances can be fetched.
+#[derive(Debug, Clone)]
+pub struct Module {
+    pub(crate) inner: sys::Module,
+}
+impl Module {
+    /// Returns a validated module from a file.
+    ///
+    /// # Arguments
+    ///
+    /// * `config` - The global configuration.
+    ///
+    /// * `file` - A wasm file or an AOT wasm file.
+    ///
+    /// # Error
+    ///
+    /// If fail to load and valiate a module from a file, returns an error.
+    pub fn from_file(config: Option<&Config>, file: impl AsRef<Path>) -> WasmEdgeResult<Self> {
+        let inner_config = config.map(|cfg| &cfg.inner);
+
+        // load module
+        let inner_module = sys::Loader::create(inner_config)?.from_file(file.as_ref())?;
+
+        // validate module
+        sys::Validator::create(inner_config)?.validate(&inner_module)?;
+
+        Ok(Self {
+            inner: inner_module,
+        })
+    }
+
+    /// Loads a WebAssembly binary module from in-memory bytes.
+    ///
+    /// # Arguments
+    ///
+    /// * `config` - The global configuration.
+    ///
+    /// * `bytes` - The in-memory bytes to be parsed.
+    ///
+    /// # Error
+    ///
+    /// If fail to load and valiate the WebAssembly module from the given in-memory bytes, returns an error.
+    pub fn from_bytes(config: Option<&Config>, bytes: impl AsRef<[u8]>) -> WasmEdgeResult<Self> {
+        let inner_config = config.map(|cfg| &cfg.inner);
+
+        // load module
+        let inner_module = sys::Loader::create(inner_config)?.from_bytes(bytes.as_ref())?;
+
+        // validate module
+        sys::Validator::create(inner_config)?.validate(&inner_module)?;
+
+        Ok(Self {
+            inner: inner_module,
+        })
+    }
+
+    /// Returns the count of the imported WasmEdge instances in the [module](crate::Module).
+    pub fn count_of_imports(&self) -> u32 {
+        self.inner.count_of_imports()
+    }
+
+    /// Returns the [import types](crate::ImportType) of all imported WasmEdge instances in the [module](crate::Module).
+    pub fn imports(&self) -> Vec<ImportType> {
+        let mut imports = Vec::new();
+        for inner_import in self.inner.imports() {
+            let import = ImportType {
+                inner: inner_import,
+                _marker: PhantomData,
+            };
+            imports.push(import);
+        }
+        imports
+    }
+
+    /// Returns the count of the exported WasmEdge instances from the [module](crate::Module).
+    pub fn count_of_exports(&self) -> u32 {
+        self.inner.count_of_exports()
+    }
+
+    /// Returns the [export types](crate::ExportType) of all exported WasmEdge instances (including funcs, tables, globals and memories) from the [module](crate::Module).
+    pub fn exports(&self) -> Vec<ExportType> {
+        let mut exports = Vec::new();
+        for inner_export in self.inner.exports() {
+            let export = ExportType {
+                inner: inner_export,
+                _marker: PhantomData,
+            };
+            exports.push(export);
+        }
+        exports
+    }
+
+    /// Gets the [export type](crate::ExportType) by the name of a specific exported WasmEdge instance, such as func, table, global or memory instance.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported WasmEdge instance, such as func, table, global or memory instance.
+    pub fn get_export(&self, name: impl AsRef<str>) -> Option<ExternalInstanceType> {
+        let exports = self
+            .exports()
+            .into_iter()
+            .filter(|x| x.name() == name.as_ref())
+            .collect::<Vec<_>>();
+        match exports.is_empty() {
+            true => None,
+            false => exports[0].ty().ok(),
+        }
+    }
+}
+
+/// Defines the types of the imported instances.
+#[derive(Debug)]
+pub struct ImportType<'module> {
+    inner: sys::ImportType<'module>,
+    _marker: PhantomData<&'module Module>,
+}
+impl<'module> ImportType<'module> {
+    /// Returns the imported name of the WasmEdge instance.
+    pub fn name(&self) -> Cow<'_, str> {
+        self.inner.name()
+    }
+
+    /// Returns the name of the module hosting the imported WasmEdge instance.
+    pub fn module_name(&self) -> Cow<'_, str> {
+        self.inner.module_name()
+    }
+
+    /// Returns the type of the imported WasmEdge instance, which is one of the types defined in [ExternalInstanceType](wasmedge_types::ExternalInstanceType).
+    pub fn ty(&self) -> WasmEdgeResult<ExternalInstanceType> {
+        let ty = self.inner.ty()?;
+        Ok(ty)
+    }
+}
+
+/// Defines the types of the exported instances.
+#[derive(Debug)]
+pub struct ExportType<'module> {
+    inner: sys::ExportType<'module>,
+    _marker: PhantomData<&'module Module>,
+}
+impl<'module> ExportType<'module> {
+    /// Returns the exported name of the WasmEdge instance.
+    pub fn name(&self) -> Cow<'_, str> {
+        self.inner.name()
+    }
+
+    /// Returns the type of the exported WasmEdge instance, which is one of the types defined in [ExternalInstanceType](wasmedge_types::ExternalInstanceType).
+    pub fn ty(&self) -> WasmEdgeResult<ExternalInstanceType> {
+        let ty = self.inner.ty()?;
+        Ok(ty)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        error::{CoreError, CoreLoadError, WasmEdgeError},
+        wat2wasm,
+    };
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_module_from_wasm() {
+        // load wasm module from a specified wasm file
+        let file = std::env::current_dir()
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+
+        let result = Module::from_file(None, file);
+        assert!(result.is_ok());
+
+        // attempt to load a non-existent wasm file
+        let result = Module::from_file(None, "not_exist_file.wasm");
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Core(CoreError::Load(
+                CoreLoadError::IllegalPath
+            )))
+        );
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_module_from_wat() {
+        // load wasm module from a specified wasm file
+        let file = std::env::current_dir()
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+
+        let result = Module::from_file(None, file);
+        assert!(result.is_ok());
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_module_from_bytes() {
+        // read the wasm bytes
+        let wasm_bytes = wat2wasm(
+            br#"
+            (module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+"#,
+        )
+        .unwrap();
+
+        let result = Module::from_bytes(None, wasm_bytes);
+        assert!(result.is_ok());
+
+        // attempt to load an empty buffer
+        let result = Module::from_bytes(None, []);
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Core(CoreError::Load(
+                CoreLoadError::UnexpectedEnd
+            ))),
+        );
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_module_clone() {
+        // read the wasm bytes
+        let wasm_bytes = wat2wasm(
+            br#"
+            (module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+"#,
+        )
+        .unwrap();
+
+        let result = Module::from_bytes(None, wasm_bytes);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+        assert_eq!(module.exports().len(), 2);
+
+        // clone the module
+        let module_clone = module.clone();
+        assert_eq!(module.exports().len(), module_clone.exports().len());
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/plugin.rs.html b/src/wasmedge_sdk/plugin.rs.html new file mode 100644 index 000000000..527a5f9f4 --- /dev/null +++ b/src/wasmedge_sdk/plugin.rs.html @@ -0,0 +1,1475 @@ +plugin.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+
//! Defines plugin related structs.
+
+use crate::{
+    error::HostFuncError, instance::Instance, io::WasmValTypeList, CallingFrame, FuncType, Global,
+    Memory, Table, WasmEdgeResult, WasmValue,
+};
+use wasmedge_sys::{self as sys, AsImport};
+#[cfg(feature = "wasi_nn")]
+use wasmedge_types::error::WasmEdgeError;
+
+/// Defines low-level types used in Plugin development.
+pub mod ffi {
+    pub use wasmedge_sys::ffi::{
+        WasmEdge_ModuleDescriptor, WasmEdge_ModuleInstanceContext, WasmEdge_PluginDescriptor,
+    };
+}
+
+/// Preload config for initializing the wasi_nn plug-in.
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+#[derive(Debug)]
+pub struct NNPreload {
+    /// The alias of the model in the WASI-NN environment.
+    alias: String,
+    /// The inference backend.
+    backend: GraphEncoding,
+    /// The execution target, on which the inference runs.
+    target: ExecutionTarget,
+    /// The path to the model file. Note that the path is the guest path instead of the host path.
+    path: std::path::PathBuf,
+}
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+impl NNPreload {
+    /// Creates a new preload config.
+    ///
+    /// # Arguments
+    ///
+    /// * `alias` - The alias of the model in the WASI-NN environment.
+    ///
+    /// * `backend` - The inference backend.
+    ///
+    /// * `target` - The execution target, on which the inference runs.
+    ///
+    /// * `path` - The path to the model file. Note that the path is the guest path instead of the host path.
+    ///
+    pub fn new(
+        alias: impl AsRef<str>,
+        backend: GraphEncoding,
+        target: ExecutionTarget,
+        path: impl AsRef<std::path::Path>,
+    ) -> Self {
+        Self {
+            alias: alias.as_ref().to_owned(),
+            backend,
+            target,
+            path: path.as_ref().to_owned(),
+        }
+    }
+}
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+impl std::fmt::Display for NNPreload {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(
+            f,
+            "{alias}:{backend}:{target}:{path}",
+            alias = self.alias,
+            backend = self.backend,
+            target = self.target,
+            path = self.path.to_string_lossy().into_owned()
+        )
+    }
+}
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+impl std::str::FromStr for NNPreload {
+    type Err = WasmEdgeError;
+
+    fn from_str(preload: &str) -> std::result::Result<Self, Self::Err> {
+        let nn_preload: Vec<&str> = preload.split(':').collect();
+        if nn_preload.len() != 4 {
+            return Err(WasmEdgeError::Operation(format!(
+                "Failed to convert to NNPreload value. Invalid preload string: {}. The correct format is: 'alias:backend:target:path'",
+                preload
+            )));
+        }
+        let (alias, backend, target, path) = (
+            nn_preload[0].to_string(),
+            nn_preload[1]
+                .parse::<GraphEncoding>()
+                .map_err(|err| WasmEdgeError::Operation(err.to_string()))?,
+            nn_preload[2]
+                .parse::<ExecutionTarget>()
+                .map_err(|err| WasmEdgeError::Operation(err.to_string()))?,
+            std::path::PathBuf::from(nn_preload[3]),
+        );
+
+        Ok(Self::new(alias, backend, target, path))
+    }
+}
+
+#[cfg(feature = "wasi_nn")]
+#[test]
+fn test_generate_nnpreload_from_str() {
+    use std::str::FromStr;
+
+    // valid preload string
+    let preload = "default:GGML:CPU:llama-2-7b-chat.Q5_K_M.gguf";
+    let result = NNPreload::from_str(preload);
+    assert!(result.is_ok());
+    let nnpreload = result.unwrap();
+    assert_eq!(nnpreload.alias, "default");
+    assert_eq!(nnpreload.backend, GraphEncoding::GGML);
+    assert_eq!(nnpreload.target, ExecutionTarget::CPU);
+    assert_eq!(
+        nnpreload.path,
+        std::path::PathBuf::from("llama-2-7b-chat.Q5_K_M.gguf")
+    );
+
+    // invalid preload string
+    let preload = "default:CPU:GGML:llama-2-7b-chat.Q5_K_M.gguf";
+    let result = NNPreload::from_str(preload);
+    assert!(result.is_err());
+    let err = result.unwrap_err();
+    assert_eq!(
+        WasmEdgeError::Operation(
+            "Failed to convert to NNBackend value. Unknown NNBackend type: CPU".to_string()
+        ),
+        err
+    );
+
+    // invalid preload string: unsupported target
+    let preload = "default:GGML:NPU:llama-2-7b-chat.Q5_K_M.gguf";
+    let result = NNPreload::from_str(preload);
+    assert!(result.is_err());
+    let err = result.unwrap_err();
+    assert_eq!(
+        WasmEdgeError::Operation(
+            "Failed to convert to ExecutionTarget value. Unknown ExecutionTarget type: NPU"
+                .to_string()
+        ),
+        err
+    );
+
+    // invalid preload string: invalid format
+    let preload = "default:GGML:CPU";
+    let result = NNPreload::from_str(preload);
+    assert!(result.is_err());
+    let err = result.unwrap_err();
+    assert_eq!(
+        WasmEdgeError::Operation(
+            "Failed to convert to NNPreload value. Invalid preload string: default:GGML:CPU. The correct format is: 'alias:backend:target:path'"
+                .to_string()
+        ),
+        err
+    );
+}
+
+/// Describes the encoding of the graph.
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
+#[allow(non_camel_case_types)]
+pub enum GraphEncoding {
+    OpenVINO,
+    ONNX,
+    TensorFlow,
+    PyTorch,
+    TensorFlowLite,
+    Autodetect,
+    GGML,
+}
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+impl std::fmt::Display for GraphEncoding {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            GraphEncoding::PyTorch => write!(f, "PyTorch"),
+            GraphEncoding::TensorFlowLite => write!(f, "TensorflowLite"),
+            GraphEncoding::TensorFlow => write!(f, "Tensorflow"),
+            GraphEncoding::OpenVINO => write!(f, "OpenVINO"),
+            GraphEncoding::GGML => write!(f, "GGML"),
+            GraphEncoding::ONNX => write!(f, "ONNX"),
+            GraphEncoding::Autodetect => write!(f, "Autodetect"),
+        }
+    }
+}
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+impl std::str::FromStr for GraphEncoding {
+    type Err = WasmEdgeError;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_lowercase().as_str() {
+            "openvino" => Ok(GraphEncoding::OpenVINO),
+            "onnx" => Ok(GraphEncoding::ONNX),
+            "tensorflow" => Ok(GraphEncoding::TensorFlow),
+            "pytorch" => Ok(GraphEncoding::PyTorch),
+            "tensorflowlite" => Ok(GraphEncoding::TensorFlowLite),
+            "autodetect" => Ok(GraphEncoding::Autodetect),
+            "ggml" => Ok(GraphEncoding::GGML),
+            _ => Err(WasmEdgeError::Operation(format!(
+                "Failed to convert to NNBackend value. Unknown NNBackend type: {}",
+                s
+            ))),
+        }
+    }
+}
+
+/// Define where the graph should be executed.
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
+#[allow(non_camel_case_types)]
+pub enum ExecutionTarget {
+    CPU,
+    GPU,
+    TPU,
+    AUTO,
+}
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+impl std::fmt::Display for ExecutionTarget {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            ExecutionTarget::CPU => write!(f, "CPU"),
+            ExecutionTarget::GPU => write!(f, "GPU"),
+            ExecutionTarget::TPU => write!(f, "TPU"),
+            ExecutionTarget::AUTO => write!(f, "AUTO"),
+        }
+    }
+}
+#[cfg(feature = "wasi_nn")]
+#[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+impl std::str::FromStr for ExecutionTarget {
+    type Err = WasmEdgeError;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s.to_uppercase().as_str() {
+            "CPU" => Ok(ExecutionTarget::CPU),
+            "GPU" => Ok(ExecutionTarget::GPU),
+            "TPU" => Ok(ExecutionTarget::TPU),
+            "AUTO" => Ok(ExecutionTarget::AUTO),
+            _ => Err(WasmEdgeError::Operation(format!(
+                "Failed to convert to ExecutionTarget value. Unknown ExecutionTarget type: {}",
+                s
+            ))),
+        }
+    }
+}
+
+/// Defines the API to manage plugins.
+#[derive(Debug)]
+pub struct PluginManager {}
+impl PluginManager {
+    /// Load plugins from the given path.
+    ///
+    /// * If the path is not given, then the default plugin paths will be used. The default plugin paths are
+    ///
+    ///     * The environment variable "WASMEDGE_PLUGIN_PATH".
+    ///
+    ///     * The `../plugin/` directory related to the WasmEdge installation path.
+    ///
+    ///     * The `wasmedge/` directory under the library path if the WasmEdge is installed under the "/usr".
+    ///
+    /// * If the path is given, then
+    ///
+    ///     * If the path is pointing at a file , then it indicates that a single plugin will be loaded from the file.
+    ///
+    ///     * If the path is pointing at a directory, then the method will load plugins from the files in the directory.
+    ///
+    /// # Argument
+    ///
+    /// * `path` - A path to a plugin file or a directory holding plugin files. If `None`, then the default plugin path will be used.
+    pub fn load(path: Option<&std::path::Path>) -> WasmEdgeResult<()> {
+        match path {
+            Some(p) => sys::plugin::PluginManager::load_plugins(p),
+            None => {
+                sys::plugin::PluginManager::load_plugins_from_default_paths();
+                Ok(())
+            }
+        }
+    }
+
+    /// Initialize the wasi_nn plug-in with the preloads.
+    ///
+    /// Note that this function is only available after loading the wasi_nn plug-in and before creating, and before creating the module instance from the plug-in.
+    ///
+    /// # Argument
+    ///
+    /// * `preloads` - The preload list.
+    ///
+    /// # Example
+    ///
+    /// ```ignore
+    /// // load wasinn-pytorch-plugin from the default plugin directory: /usr/local/lib/wasmedge
+    /// PluginManager::load(None)?;
+    /// // preload named model
+    /// PluginManager::nn_preload(vec![NNPreload::new(
+    ///     "default",
+    ///     GraphEncoding::GGML,
+    ///     ExecutionTarget::CPU,
+    ///     "llama-2-7b-chat.Q5_K_M.gguf",
+    /// )]);
+    /// ```
+    ///
+    /// If a preload is string, then use `NNPreload::from_str` to create a `NNPreload` instance:
+    ///
+    /// ```ignore
+    /// use std::str::FromStr;
+    ///
+    /// // load wasinn-pytorch-plugin from the default plugin directory: /usr/local/lib/wasmedge
+    /// PluginManager::load(None)?;
+    /// // preload named model
+    /// PluginManager::nn_preload(vec![NNPreload::from_str("default:GGML:CPU:llama-2-7b-chat.Q5_K_M.gguf")?]);
+    ///
+    /// ```
+    #[cfg(feature = "wasi_nn")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+    pub fn nn_preload(preloads: Vec<NNPreload>) {
+        let mut nn_preloads = Vec::new();
+        for preload in preloads {
+            nn_preloads.push(preload.to_string());
+        }
+
+        let nn_preloads_str: Vec<&str> = nn_preloads.iter().map(|s| s.as_str()).collect();
+
+        sys::plugin::PluginManager::nn_preload(nn_preloads_str);
+    }
+
+    /// Returns the count of loaded plugins.
+    pub fn count() -> u32 {
+        sys::plugin::PluginManager::count()
+    }
+
+    /// Returns the names of all loaded plugins.
+    pub fn names() -> Vec<String> {
+        sys::plugin::PluginManager::names()
+    }
+
+    /// Returns the target plugin by its name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target plugin.
+    ///
+    /// # Error
+    ///
+    /// If failed to return the plugin module instance, then return [PluginError::NotFound](wasmedge_types::error::PluginError::NotFound) error.
+    pub fn find(name: impl AsRef<str>) -> WasmEdgeResult<Plugin> {
+        sys::plugin::PluginManager::find(name.as_ref()).map(|p| Plugin { inner: p })
+    }
+
+    /// Initializes the `wasmedge_process` plugin module instance with the parameters.
+    ///
+    /// # Arguments
+    ///
+    /// * `allowed_cmds` - A white list of commands.
+    ///
+    /// * `allowed` - Determines if wasmedge_process is allowed to execute all commands on the white list.
+    #[cfg(all(
+        target_os = "linux",
+        feature = "wasmedge_process",
+        not(feature = "static")
+    ))]
+    #[cfg_attr(
+        docsrs,
+        doc(cfg(all(
+            target_os = "linux",
+            feature = "wasmedge_process",
+            not(feature = "static")
+        )))
+    )]
+    pub fn init_wasmedge_process(allowed_cmds: Option<Vec<&str>>, allowed: bool) {
+        sys::plugin::PluginManager::init_wasmedge_process(allowed_cmds, allowed);
+    }
+}
+
+/// Represents a loaded plugin. It provides the APIs for accessing the plugin.
+#[derive(Debug)]
+pub struct Plugin {
+    inner: sys::plugin::Plugin,
+}
+impl Plugin {
+    /// Returns the name of this plugin.
+    pub fn name(&self) -> String {
+        self.inner.name()
+    }
+
+    /// Returns the count of the module instances in this plugin.
+    pub fn mod_count(&self) -> u32 {
+        self.inner.mod_count()
+    }
+
+    /// Returns the names of all module instances in this plugin.
+    pub fn mod_names(&self) -> Vec<String> {
+        self.inner.mod_names()
+    }
+
+    /// Returns a module instance that is generated from the module with the given name in this plugin.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target module.
+    ///
+    /// # Error
+    ///
+    /// If failed to return the plugin module instance, then return [PluginError::Create](wasmedge_types::error::PluginError::Create) error.
+    pub fn mod_instance(&self, name: impl AsRef<str>) -> WasmEdgeResult<PluginInstance> {
+        self.inner
+            .mod_instance(name.as_ref())
+            .map(|i| Instance { inner: i })
+    }
+}
+
+pub type PluginInstance = Instance;
+
+/// Defines the type of the function that creates a module instance for a plugin.
+pub type ModuleInstanceCreateFn = sys::plugin::ModuleInstanceCreateFn;
+
+/// Defines the type of the program options.
+pub type ProgramOptionType = sys::plugin::ProgramOptionType;
+
+/// Represents Plugin descriptor for plugins.
+#[derive(Debug)]
+pub struct PluginDescriptor {
+    inner: sys::plugin::PluginDescriptor,
+}
+impl PluginDescriptor {
+    /// Creates a new plugin descriptor.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The name of the plugin.
+    ///
+    /// * `desc` - The description of the plugin.
+    ///
+    /// * `version` - The version of the plugin.
+    ///
+    /// # Error
+    ///
+    /// If fail to create the plugin descriptor, then an error will be returned.
+    pub fn new(
+        name: impl AsRef<str>,
+        desc: impl AsRef<str>,
+        version: PluginVersion,
+    ) -> WasmEdgeResult<Self> {
+        Ok(Self {
+            inner: sys::plugin::PluginDescriptor::create(name, desc, version.inner)?,
+        })
+    }
+
+    /// Adds a module descriptor to the plugin descriptor.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The name of the module.
+    ///
+    /// * `desc` - The description of the module.
+    ///
+    /// * `f` - The function that creates a module instance for the plugin.
+    ///
+    /// # Error
+    ///
+    /// If fail to add the module descriptor, then an error will be returned.
+    pub fn add_module_descriptor(
+        mut self,
+        name: impl AsRef<str>,
+        desc: impl AsRef<str>,
+        f: Option<ModuleInstanceCreateFn>,
+    ) -> WasmEdgeResult<Self> {
+        self.inner = self.inner.add_module_descriptor(name, desc, f)?;
+        Ok(self)
+    }
+
+    /// Adds a program option to the plugin descriptor.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The name of the program option.
+    ///
+    /// * `desc` - The description of the program option.
+    ///
+    /// * `ty` - The type of the program option.
+    ///
+    /// # Error
+    ///
+    /// If fail to add the program option, then an error will be returned.
+    pub fn add_program_option(
+        mut self,
+        name: impl AsRef<str>,
+        desc: impl AsRef<str>,
+        ty: ProgramOptionType,
+    ) -> WasmEdgeResult<Self> {
+        self.inner = self.inner.add_program_option(name, desc, ty)?;
+        Ok(self)
+    }
+
+    /// Returns the raw pointer to the inner `WasmEdge_PluginDescriptor`.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_raw_ptr(&self) -> *const sys::ffi::WasmEdge_PluginDescriptor {
+        self.inner.as_raw_ptr()
+    }
+}
+
+/// Defines the version of a plugin.
+#[derive(Debug)]
+pub struct PluginVersion {
+    pub inner: sys::plugin::PluginVersion,
+}
+impl PluginVersion {
+    /// Creates a new plugin version.
+    pub fn new(major: u32, minor: u32, patch: u32, build: u32) -> Self {
+        Self {
+            inner: sys::plugin::PluginVersion::create(major, minor, patch, build),
+        }
+    }
+}
+
+/// Creates a [plugin module](crate::plugin::PluginModule).
+///
+/// # Example
+///
+/// [Create a simple math plugin](https://github.com/second-state/wasmedge-rustsdk-examples/tree/main/simple-plugin)
+///
+#[derive(Debug, Default)]
+pub struct PluginModuleBuilder<T: ?Sized + Send + Sync + Clone> {
+    funcs: Vec<(String, sys::Function)>,
+    globals: Vec<(String, sys::Global)>,
+    memories: Vec<(String, sys::Memory)>,
+    tables: Vec<(String, sys::Table)>,
+    host_data: Option<Box<T>>,
+}
+impl<T: ?Sized + Send + Sync + Clone> PluginModuleBuilder<T> {
+    /// Creates a new [PluginModuleBuilder].
+    pub fn new() -> Self {
+        Self {
+            funcs: Vec::new(),
+            globals: Vec::new(),
+            memories: Vec::new(),
+            tables: Vec::new(),
+            host_data: None,
+        }
+    }
+
+    /// Adds a [host function](crate::Func) to the [crate::ImportObject] to create.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [host function](crate::Func) to add.
+    ///
+    /// * `real_func` - The native function.
+    ///
+    /// * `data` - The additional data object to set to this host function context.
+    ///
+    /// # error
+    ///
+    /// If fail to create or add the [host function](crate::Func), then an error is returned.
+    pub fn with_func<Args, Rets, D>(
+        mut self,
+        name: impl AsRef<str>,
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Result<Vec<WasmValue>, HostFuncError>
+            + Send
+            + Sync
+            + 'static,
+        data: Option<Box<D>>,
+    ) -> WasmEdgeResult<Self>
+    where
+        Args: WasmValTypeList,
+        Rets: WasmValTypeList,
+    {
+        let boxed_func = Box::new(real_func);
+        let args = Args::wasm_types();
+        let returns = Rets::wasm_types();
+        let ty = FuncType::new(Some(args.to_vec()), Some(returns.to_vec()));
+        let inner_func = sys::Function::create_sync_func::<D>(&ty.into(), boxed_func, data, 0)?;
+        self.funcs.push((name.as_ref().to_owned(), inner_func));
+        Ok(self)
+    }
+
+    /// Adds an [async host function](crate::Func) to the [PluginModule] to create.
+    ///
+    /// N.B. that this function can be used in thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [host function](crate::Func) to add.
+    ///
+    /// * `real_func` - The native function.
+    ///
+    /// # error
+    ///
+    /// If fail to create or add the [host function](crate::Func), then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub fn with_async_func<Args, Rets, D>(
+        mut self,
+        name: impl AsRef<str>,
+        real_func: impl Fn(
+                CallingFrame,
+                Vec<WasmValue>,
+                *mut std::os::raw::c_void,
+            ) -> Box<
+                dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send,
+            > + Send
+            + Sync
+            + 'static,
+        data: Option<Box<D>>,
+    ) -> WasmEdgeResult<Self>
+    where
+        Args: WasmValTypeList,
+        Rets: WasmValTypeList,
+        D: Send + Sync,
+    {
+        let args = Args::wasm_types();
+        let returns = Rets::wasm_types();
+        let ty = FuncType::new(Some(args.to_vec()), Some(returns.to_vec()));
+        let inner_func =
+            sys::Function::create_async_func(&ty.into(), Box::new(real_func), data, 0)?;
+        self.funcs.push((name.as_ref().to_owned(), inner_func));
+        Ok(self)
+    }
+
+    /// Adds a [global](crate::Global) to the [PluginModule] to create.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [global](crate::Global) to add.
+    ///
+    /// * `global` - The wasm [global instance](crate::Global) to add.
+    ///
+    pub fn with_global(mut self, name: impl AsRef<str>, global: Global) -> Self {
+        self.globals.push((name.as_ref().to_owned(), global.inner));
+        self
+    }
+
+    /// Adds a [memory](crate::Memory) to the [PluginModule] to create.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [memory](crate::Memory) to add.
+    ///
+    /// * `memory` - The wasm [memory instance](crate::Memory) to add.
+    ///
+    pub fn with_memory(mut self, name: impl AsRef<str>, memory: Memory) -> Self {
+        self.memories.push((name.as_ref().to_owned(), memory.inner));
+        self
+    }
+
+    /// Adds a [table](crate::Table) to the [PluginModule] to create.
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The exported name of the [table](crate::Table) to add.
+    ///
+    /// * `table` - The wasm [table instance](crate::Table) to add.
+    ///
+    pub fn with_table(mut self, name: impl AsRef<str>, table: Table) -> Self {
+        self.tables.push((name.as_ref().to_owned(), table.inner));
+        self
+    }
+
+    /// Adds host data to the [PluginModule] to create.
+    ///
+    /// # Arguments
+    ///
+    /// * `host_data` - The host data to be stored in the module instance.
+    ///
+    /// * `finalizer` - The function to drop the host data. Notice that this argument is available only if `host_data` is set some value.
+    ///
+    pub fn with_host_data(mut self, host_data: Box<T>) -> Self {
+        self.host_data = Some(host_data);
+        self
+    }
+
+    /// Creates a new [PluginModule].
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the [PluginModule] to create.
+    ///
+    /// # Error
+    ///
+    /// If fail to create the [PluginModule], then an error is returned.
+    pub fn build(self, name: impl AsRef<str>) -> WasmEdgeResult<PluginModule> {
+        let mut inner = sys::plugin::PluginModule::create(name.as_ref(), self.host_data)?;
+
+        // add func
+        for (name, func) in self.funcs.into_iter() {
+            inner.add_func(name, func);
+        }
+
+        // add global
+        for (name, global) in self.globals.into_iter() {
+            inner.add_global(name, global);
+        }
+
+        // add memory
+        for (name, memory) in self.memories.into_iter() {
+            inner.add_memory(name, memory);
+        }
+
+        // add table
+        for (name, table) in self.tables.into_iter() {
+            inner.add_table(name, table);
+        }
+
+        Ok(PluginModule(inner))
+    }
+}
+
+/// Defines an import object that contains the required import data used when instantiating a [module](crate::Module).
+///
+/// An [PluginModule] instance is created with [PluginModuleBuilder](crate::plugin::PluginModuleBuilder).
+#[derive(Debug, Clone)]
+pub struct PluginModule(pub(crate) sys::plugin::PluginModule);
+impl PluginModule {
+    /// Returns the name of the plugin module instance.
+    pub fn name(&self) -> &str {
+        self.0.name()
+    }
+
+    /// Returns the raw pointer to the inner `WasmEdge_ModuleInstanceContext`.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_raw_ptr(&self) -> *const sys::ffi::WasmEdge_ModuleInstanceContext {
+        self.0.as_raw_ptr()
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/statistics.rs.html b/src/wasmedge_sdk/statistics.rs.html new file mode 100644 index 000000000..efb6c656e --- /dev/null +++ b/src/wasmedge_sdk/statistics.rs.html @@ -0,0 +1,149 @@ +statistics.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
//! Defines WasmEdge Statistics struct.
+
+use crate::WasmEdgeResult;
+use wasmedge_sys as sys;
+
+/// Used to collect statistics of the WasmEdge runtime, such as the count of instructions in execution.
+#[derive(Debug, Clone)]
+pub struct Statistics {
+    pub(crate) inner: sys::Statistics,
+}
+impl Statistics {
+    /// Creates a new [Statistics].
+    ///
+    /// # Error
+    ///
+    /// If fail to create a [Statistics], then an error is returned.
+    pub fn new() -> WasmEdgeResult<Self> {
+        let inner = sys::Statistics::create()?;
+        Ok(Self { inner })
+    }
+
+    /// Returns the instruction count in execution.
+    pub fn count(&self) -> u64 {
+        self.inner.instr_count()
+    }
+
+    /// Returns the instruction count per second in execution.
+    ///
+    /// # Notice
+    ///
+    /// For the following cases,
+    /// - [Statistics] is not enabled, or
+    /// - the total execution time is 0
+    ///
+    /// The instructions per second could be `NaN`, which represents `divided-by-zero`.
+    /// Use the `is_nan` function of F64 to check the return value before use it,
+    /// for example,
+    ///
+    /// ```
+    /// use wasmedge_sdk::Statistics;
+    ///
+    /// // create a Statistics instance
+    /// let stat = Statistics::new().expect("fail to create a Statistics");
+    ///
+    /// // check instruction count per second
+    /// assert!(stat.count_per_second().is_nan());
+    /// ```
+    pub fn count_per_second(&self) -> f64 {
+        self.inner.instr_per_sec()
+    }
+
+    /// Returns the total cost in execution.
+    pub fn cost(&self) -> u64 {
+        self.inner.cost_in_total()
+    }
+
+    /// Sets the cost of instructions.
+    ///
+    /// # Arguments
+    ///
+    /// - `cost_table` specifies the slice of cost table.
+    pub fn set_cost_table(&mut self, cost_table: impl AsRef<[u64]>) {
+        self.inner.set_cost_table(cost_table)
+    }
+
+    /// Sets the cost limit in execution.
+    ///
+    /// # Arguments
+    ///
+    /// - `limit` specifies the cost limit.
+    pub fn set_cost_limit(&mut self, limit: u64) {
+        self.inner.set_cost_limit(limit)
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/store.rs.html b/src/wasmedge_sdk/store.rs.html new file mode 100644 index 000000000..75b5d6713 --- /dev/null +++ b/src/wasmedge_sdk/store.rs.html @@ -0,0 +1,927 @@ +store.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+
//! Defines WasmEdge Store struct.
+
+use crate::{plugin::PluginInstance, Executor, ImportObject, Instance, Module, WasmEdgeResult};
+use wasmedge_sys as sys;
+
+/// Represents all global state that can be manipulated by WebAssembly programs. A [store](crate::Store) consists of the runtime representation of all instances of [functions](crate::Func), [tables](crate::Table), [memories](crate::Memory), and [globals](crate::Global).
+#[derive(Debug, Clone)]
+pub struct Store {
+    pub(crate) inner: sys::Store,
+}
+impl Store {
+    /// Creates a new [Store].
+    ///
+    /// # Error
+    ///
+    /// If fail to create a new [Store], then an error is returned.
+    pub fn new() -> WasmEdgeResult<Self> {
+        let inner = sys::Store::create()?;
+        Ok(Self { inner })
+    }
+
+    /// Registers and instantiates a WasmEdge [import object](crate::ImportObject) into this [store](crate::Store).
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [executor](crate::Executor) that runs the host functions in this [store](crate::Store).
+    ///
+    /// * `import` - The WasmEdge [import object](crate::ImportObject) to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register the given [import object](crate::ImportObject), then an error is returned.
+    pub fn register_import_module<T>(
+        &mut self,
+        executor: &mut Executor,
+        import: &ImportObject<T>,
+    ) -> WasmEdgeResult<()>
+    where
+        T: ?Sized + Send + Sync + Clone,
+    {
+        executor
+            .inner
+            .register_import_module(&self.inner, &import.0)
+    }
+
+    /// Registers and instantiates a WasmEdge [compiled module](crate::Module) into this [store](crate::Store) as a named [module instance](crate::Instance), and returns the module instance.
+    ///
+    /// Instantiates the given WasmEdge [compiled module](crate::Module), including the [functions](crate::Func), [memories](crate::Memory), [tables](crate::Table), and [globals](crate::Global) it hosts; and then, registers the [module instance](crate::Instance) into the [store](crate::Store) with the given name.
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [executor](crate::Executor) that runs the host functions in this [store](crate::Store).
+    ///
+    /// * `mod_name` - The exported name of the registered [module](crate::Module).
+    ///
+    /// * `module` - The validated [module](crate::Module) to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register the given [module](crate::Module), then an error is returned.
+    pub fn register_named_module(
+        &mut self,
+        executor: &mut Executor,
+        mod_name: impl AsRef<str>,
+        module: &Module,
+    ) -> WasmEdgeResult<Instance> {
+        let inner_instance =
+            executor
+                .inner
+                .register_named_module(&self.inner, &module.inner, mod_name.as_ref())?;
+        Ok(Instance {
+            inner: inner_instance,
+        })
+    }
+
+    /// Registers and instantiates a WasmEdge [compiled module](crate::Module) into this [store](crate::Store) as an anonymous active [module instance](crate::Instance), and returns the module instance.
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [executor](crate::Executor) that runs the host functions in this [store](crate::Store).
+    ///
+    /// * `module` - The validated [module](crate::Module) to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register the given [module](crate::Module), then an error is returned.
+    pub fn register_active_module(
+        &mut self,
+        executor: &mut Executor,
+        module: &Module,
+    ) -> WasmEdgeResult<Instance> {
+        let inner = executor
+            .inner
+            .register_active_module(&self.inner, &module.inner)?;
+
+        Ok(Instance { inner })
+    }
+
+    /// Registers a PluginInstance into this store.
+    ///
+    /// # Arguments
+    ///
+    /// * `executor` - The [executor](crate::Executor) that runs the host functions in this [store](crate::Store).
+    ///
+    /// * `plugin` - The WasmEdge [plugin instance](crate::plugin::PluginInstance) to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register the plugin instance, then an error is returned.
+    pub fn register_plugin_module(
+        &mut self,
+        executor: &mut Executor,
+        plugin: &PluginInstance,
+    ) -> WasmEdgeResult<()> {
+        executor
+            .inner
+            .register_plugin_instance(&self.inner, &plugin.inner)
+    }
+
+    /// Returns the number of the named [module instances](crate::Instance) in this [store](crate::Store).
+    pub fn named_instance_count(&self) -> u32 {
+        self.inner.module_len()
+    }
+
+    /// Returns the names of all registered named [module instances](crate::Instance).
+    pub fn instance_names(&self) -> Vec<String> {
+        match self.inner.module_names() {
+            Some(names) => names,
+            None => vec![],
+        }
+    }
+
+    /// Returns the named [module instance](crate::Instance) with the given name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target [module instance](crate::Instance) to be returned.
+    pub fn named_instance(&mut self, name: impl AsRef<str>) -> WasmEdgeResult<Instance> {
+        let inner_instance = self.inner.module(name.as_ref())?;
+
+        Ok(Instance {
+            inner: inner_instance,
+        })
+    }
+
+    /// Checks if the [store](crate::Store) contains a named module instance.
+    ///
+    /// # Argument
+    ///
+    /// * `mod_name` - The name of the named module.
+    ///
+    pub fn contains(&self, mod_name: impl AsRef<str>) -> bool {
+        self.inner.contains(mod_name.as_ref())
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        config::{CommonConfigOptions, ConfigBuilder},
+        error::HostFuncError,
+        types::Val,
+        CallingFrame, Executor, Global, GlobalType, ImportObjectBuilder, Memory, MemoryType,
+        Module, Mutability, NeverType, RefType, Statistics, Table, TableType, ValType, WasmValue,
+    };
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_store_create() {
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+
+        let result = Store::new();
+        assert!(result.is_ok());
+        let store = result.unwrap();
+
+        assert_eq!(store.named_instance_count(), 0);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_store_register_import_module() {
+        // create a Const global instance
+        let result = Global::new(
+            GlobalType::new(ValType::F32, Mutability::Const),
+            Val::F32(3.5),
+        );
+        assert!(result.is_ok());
+        let global_const = result.unwrap();
+
+        // create a memory instance
+        let result = MemoryType::new(10, None, false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create a table instance
+        let result = Table::new(TableType::new(RefType::FuncRef, 5, None));
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // create an ImportModule instance
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host function")
+            .with_global("global", global_const)
+            .with_memory("mem", memory)
+            .with_table("table", table)
+            .build::<NeverType>("extern-module", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // register an import module into store
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        assert_eq!(store.named_instance_count(), 1);
+        assert_eq!(store.instance_names(), ["extern-module"]);
+
+        // get active module instance
+        let result = store.named_instance("extern-module");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+        assert!(instance.name().is_some());
+        assert_eq!(instance.name().unwrap(), "extern-module");
+
+        let result = instance.global("global");
+        assert!(result.is_ok());
+        let global = result.unwrap();
+        let ty = global.ty();
+        assert_eq!(*ty, GlobalType::new(ValType::F32, Mutability::Const));
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_store_register_named_module() {
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // load wasm module
+        let file = std::env::current_dir()
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+
+        let result = Module::from_file(Some(&config), file);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // register a module into store as a named module
+        let result = store.register_named_module(&mut executor, "extern-module", &module);
+        assert!(result.is_ok());
+
+        assert_eq!(store.named_instance_count(), 1);
+        assert_eq!(store.instance_names(), ["extern-module"]);
+
+        // get active module instance
+        let result = store.named_instance("extern-module");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+        assert!(instance.name().is_some());
+        assert_eq!(instance.name().unwrap(), "extern-module");
+    }
+
+    #[test]
+    fn test_store_register_active_module() {
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // load wasm module
+        let file = std::env::current_dir()
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+
+        let result = Module::from_file(Some(&config), file);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // register a module into store as active module
+        let result = store.register_active_module(&mut executor, &module);
+        assert!(result.is_ok());
+        let active_instance = result.unwrap();
+        assert!(active_instance.name().is_none());
+        let result = active_instance.func("fib");
+        assert!(result.is_ok());
+
+        assert_eq!(store.named_instance_count(), 0);
+        assert_eq!(store.instance_names().len(), 0);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_store_basic() {
+        // create an executor
+        let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::new();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::new(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create a store
+        let result = Store::new();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // create a Const global instance
+        let result = Global::new(
+            GlobalType::new(ValType::F32, Mutability::Const),
+            Val::F32(3.5),
+        );
+        assert!(result.is_ok());
+        let global_const = result.unwrap();
+
+        // create a memory instance
+        let result = MemoryType::new(10, None, false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create a table instance
+        let result = Table::new(TableType::new(RefType::FuncRef, 5, None));
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // create an ImportModule instance
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host function")
+            .with_global("global", global_const)
+            .with_memory("mem", memory)
+            .with_table("table", table)
+            .build::<NeverType>("extern-module", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // register a module into store as a named module
+        let result = store.register_import_module(&mut executor, &import);
+        assert!(result.is_ok());
+
+        // add a wasm module from a file
+        let file = std::env::current_dir()
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+        let result = Module::from_file(Some(&config), file);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        let result = store.register_named_module(&mut executor, "fib-module", &module);
+        assert!(result.is_ok());
+
+        // check the exported instances
+        assert_eq!(store.named_instance_count(), 2);
+        let mod_names = store.instance_names();
+        assert_eq!(mod_names[0], "extern-module");
+        assert_eq!(mod_names[1], "fib-module");
+
+        assert_eq!(mod_names[0], "extern-module");
+        let result = store.named_instance(&mod_names[0]);
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+        assert!(instance.name().is_some());
+        assert_eq!(instance.name().unwrap(), mod_names[0]);
+
+        assert_eq!(mod_names[1], "fib-module");
+        let result = store.named_instance(&mod_names[1]);
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+        assert!(instance.name().is_some());
+        assert_eq!(instance.name().unwrap(), mod_names[1]);
+    }
+
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+        _data: *mut std::os::raw::c_void,
+    ) -> std::result::Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/types.rs.html b/src/wasmedge_sdk/types.rs.html new file mode 100644 index 000000000..772a73c2e --- /dev/null +++ b/src/wasmedge_sdk/types.rs.html @@ -0,0 +1,195 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+
//! Defines the general types.
+
+use crate::FuncRef;
+use wasmedge_sys::WasmValue;
+use wasmedge_types::{self, FuncType, RefType};
+
+/// Defines runtime values that a WebAssembly module can either consume or produce.
+#[derive(Debug, Clone)]
+pub enum Val {
+    /// 32-bit integer.
+    ///
+    /// Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.
+    I32(i32),
+    /// 64-bit integer.
+    ///
+    /// Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.
+    I64(i64),
+    /// 32-bit floating-point data as defined by the [IEEE 754-2019](https://ieeexplore.ieee.org/document/8766229).
+    F32(f32),
+    /// 64-bit floating-point data as defined by the [IEEE 754-2019](https://ieeexplore.ieee.org/document/8766229).
+    F64(f64),
+    /// 128-bit vector of packed integer or floating-point data.
+    ///
+    /// The packed data can be interpreted as signed or unsigned integers, single or double precision floating-point
+    /// values, or a single 128 bit type. The interpretation is determined by individual operations.
+    V128(i128),
+    /// A reference to a [host function](crate::Func).
+    ///
+    /// `FuncRef(None)` is the null function reference, created by `ref.null
+    /// func` in Wasm.
+    FuncRef(Option<FuncRef>),
+    /// A reference to opaque data in the wasm instance.
+    ///
+    /// `ExternRef(None)` is the null external reference, created by `ref.null
+    /// extern` in Wasm.
+    ExternRef(Option<ExternRef>),
+}
+impl From<Val> for WasmValue {
+    fn from(val: Val) -> Self {
+        match val {
+            Val::I32(i) => WasmValue::from_i32(i),
+            Val::I64(i) => WasmValue::from_i64(i),
+            Val::F32(i) => WasmValue::from_f32(i),
+            Val::F64(i) => WasmValue::from_f64(i),
+            Val::V128(i) => WasmValue::from_v128(i),
+            Val::FuncRef(Some(func_ref)) => WasmValue::from_func_ref(func_ref.inner),
+            Val::FuncRef(None) => WasmValue::from_null_ref(RefType::FuncRef),
+            Val::ExternRef(Some(extern_ref)) => extern_ref.inner,
+            Val::ExternRef(None) => WasmValue::from_null_ref(RefType::ExternRef),
+        }
+    }
+}
+impl From<WasmValue> for Val {
+    fn from(value: WasmValue) -> Self {
+        match value.ty() {
+            wasmedge_types::ValType::I32 => Val::I32(value.to_i32()),
+            wasmedge_types::ValType::I64 => Val::I64(value.to_i64()),
+            wasmedge_types::ValType::F32 => Val::F32(value.to_f32()),
+            wasmedge_types::ValType::F64 => Val::F64(value.to_f64()),
+            wasmedge_types::ValType::V128 => Val::V128(value.to_v128()),
+            wasmedge_types::ValType::FuncRef => {
+                if value.is_null_ref() {
+                    Val::FuncRef(None)
+                } else {
+                    let inner = value
+                        .func_ref()
+                        .expect("[wasmedge] Failed to convert a WasmValue to a FuncRef.");
+                    let ty: FuncType = inner.ty().unwrap().into();
+                    Val::FuncRef(Some(FuncRef { inner, ty }))
+                }
+            }
+            wasmedge_types::ValType::ExternRef => {
+                if value.is_null_ref() {
+                    Val::ExternRef(None)
+                } else {
+                    Val::ExternRef(Some(ExternRef { inner: value }))
+                }
+            }
+        }
+    }
+}
+
+/// A reference to opaque data in the wasm instance.
+#[derive(Debug, Clone, Copy)]
+pub struct ExternRef {
+    pub(crate) inner: WasmValue,
+}
+impl ExternRef {
+    /// Creates a new instance of [ExternRef] wrapping the given value.
+    pub fn new<T>(extern_obj: &mut T) -> Self
+    where
+        T: 'static + Send + Sync,
+    {
+        let inner = WasmValue::from_extern_ref::<T>(extern_obj);
+        Self { inner }
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/utils.rs.html b/src/wasmedge_sdk/utils.rs.html new file mode 100644 index 000000000..d71c1283d --- /dev/null +++ b/src/wasmedge_sdk/utils.rs.html @@ -0,0 +1,117 @@ +utils.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
//! Defines WasmEdge Driver and CoreVersion types
+use wasmedge_sys::utils;
+
+/// Defines WasmEdge Driver functions
+#[derive(Debug)]
+pub struct Driver {}
+impl Driver {
+    /// Triggers the WasmEdge AOT compiler tool
+    pub fn aot_compiler<I, V>(args: I) -> i32
+    where
+        I: IntoIterator<Item = V>,
+        V: AsRef<str>,
+    {
+        utils::driver_aot_compiler(args)
+    }
+
+    /// Triggers the WasmEdge runtime tool
+    pub fn runtime_tool<I, V>(args: I) -> i32
+    where
+        I: IntoIterator<Item = V>,
+        V: AsRef<str>,
+    {
+        utils::driver_runtime_tool(args)
+    }
+
+    /// Triggers the WasmEdge unified tool
+    pub fn unified_tool<I, V>(args: I) -> i32
+    where
+        I: IntoIterator<Item = V>,
+        V: AsRef<str>,
+    {
+        utils::driver_unified_tool(args)
+    }
+}
+
+/// The version info of WasmEdge core
+pub struct CoreVersion {}
+impl CoreVersion {
+    /// Returns the major version value of WasmEdge core.
+    pub fn major() -> u32 {
+        wasmedge_sys::utils::version_major_value()
+    }
+
+    /// Returns the minor version value of WasmEdge core.
+    pub fn minor() -> u32 {
+        wasmedge_sys::utils::version_minor_value()
+    }
+
+    /// Returns the patch version value of WasmEdge core.
+    pub fn patch() -> u32 {
+        wasmedge_sys::utils::version_patch_value()
+    }
+
+    /// Returns the version string of WasmEdge core.
+    pub fn version_string() -> String {
+        wasmedge_sys::utils::version_string()
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/vm.rs.html b/src/wasmedge_sdk/vm.rs.html new file mode 100644 index 000000000..461663a96 --- /dev/null +++ b/src/wasmedge_sdk/vm.rs.html @@ -0,0 +1,4667 @@ +vm.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+
//! Defines WasmEdge Vm struct.
+
+#[cfg(all(feature = "async", target_os = "linux"))]
+use crate::wasi::r#async::{AsyncState, WasiContext, WasiInstance};
+#[cfg(not(feature = "async"))]
+use crate::wasi::WasiInstance;
+use crate::{
+    config::Config,
+    error::{VmError, WasmEdgeError},
+    plugin::{PluginInstance, PluginManager},
+    Executor, HostRegistration, ImportObject, Instance, Module, Statistics, Store, WasmEdgeResult,
+    WasmValue,
+};
+use std::{collections::HashMap, path::Path};
+use wasmedge_sys as sys;
+
+/// Constructs a [Vm] instance.
+#[derive(Debug, Default)]
+pub struct VmBuilder {
+    config: Option<Config>,
+    stat: Option<Statistics>,
+    store: Option<Store>,
+    plugins: Vec<(String, Vec<String>)>,
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    wasi_ctx: Option<WasiContext>,
+}
+impl VmBuilder {
+    /// Creates a new [VmBuilder].
+    pub fn new() -> Self {
+        Self::default()
+    }
+
+    /// Sets the [Config] for the [Vm] to build.
+    ///
+    /// # Argument
+    ///
+    /// * `config` - The [Config] to set.
+    pub fn with_config(mut self, config: Config) -> Self {
+        self.config = Some(config);
+        self
+    }
+
+    /// Sets the [Statistics] for the [Vm] to build.
+    ///
+    /// # Argument
+    ///
+    /// * `stat` - The [Statistics] to set.
+    pub fn with_statistics(mut self, stat: Statistics) -> Self {
+        self.stat = Some(stat);
+        self
+    }
+
+    /// Sets the [Store] for the [Vm] to build.
+    ///
+    /// # Argument
+    ///
+    /// * `store` - The [Store] to set.
+    pub fn with_store(mut self, store: Store) -> Self {
+        self.store = Some(store);
+        self
+    }
+
+    /// Sets the `wasi_nn` plugin for the [Vm] to build. The `wasi_nn` plugin should be deployed with WasmEdge library.
+    pub fn with_plugin_wasi_nn(self) -> Self {
+        self.with_plugin("wasi_nn", None)
+    }
+
+    /// Sets the `wasi_crypto` plugin for the [Vm] to build. The `wasi_crypto` plugin should be deployed with WasmEdge library.
+    pub fn with_plugin_wasi_crypto(self) -> Self {
+        self.with_plugin("wasi_crypto", None)
+    }
+
+    /// Sets the `wasmedge_process` plugin for the [Vm] to build. The `wasmedge_process` plugin should be deployed with WasmEdge library.
+    pub fn with_plugin_wasmedge_process(self) -> Self {
+        self.with_plugin("wasmedge_process", None)
+    }
+
+    /// Sets the `rustls` plugin for the [Vm] to build. The `rustls` plugin should be deployed with WasmEdge library.
+    pub fn with_plugin_rustls(self) -> Self {
+        self.with_plugin("rustls", None)
+    }
+
+    /// Set the third-party plugin for the [Vm] to build.
+    ///
+    /// # Arguments
+    ///
+    /// * `pname` - The name of the plugin.
+    ///
+    /// * `mnames` - The names of the plugin modules to be registered. If `None`, then all modules in the plugin are registered.
+    pub fn with_plugin(mut self, pname: impl AsRef<str>, mnames: Option<Vec<&str>>) -> Self {
+        match mnames {
+            Some(mod_names) => self.plugins.push((
+                pname.as_ref().into(),
+                mod_names.into_iter().map(|s| s.into()).collect(),
+            )),
+            None => self.plugins.push((pname.as_ref().into(), Vec::new())),
+        }
+
+        self
+    }
+
+    /// Sets the [WasiContext] for the [Vm] to build.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub fn with_wasi_context(mut self, wasi_ctx: WasiContext) -> Self {
+        self.wasi_ctx = Some(wasi_ctx);
+        self
+    }
+
+    /// Creates a new [Vm].
+    ///
+    /// # Error
+    ///
+    /// If fail to create, then an error is returned.
+    pub fn build(self) -> WasmEdgeResult<Vm> {
+        self.build_vm()
+    }
+
+    #[cfg(not(feature = "async"))]
+    fn build_vm(mut self) -> WasmEdgeResult<Vm> {
+        // executor
+        let executor = Executor::new(self.config.as_ref(), self.stat.as_mut())?;
+
+        // store
+        let store = match self.store {
+            Some(store) => store,
+            None => Store::new()?,
+        };
+
+        // create a Vm instance
+        let mut vm = Vm {
+            config: self.config,
+            stat: self.stat,
+            executor,
+            store,
+            named_instances: HashMap::new(),
+            active_instance: None,
+            builtin_host_instances: HashMap::new(),
+            plugin_host_instances: Vec::new(),
+        };
+
+        // * built-in host instances
+        if let Some(cfg) = vm.config.as_ref() {
+            if cfg.wasi_enabled() {
+                if let Ok(wasi_module) = sys::WasiModule::create(None, None, None) {
+                    vm.executor.inner.register_wasi_instance(
+                        &vm.store.inner,
+                        &sys::WasiInstance::Wasi(wasi_module.clone()),
+                    )?;
+
+                    vm.builtin_host_instances.insert(
+                        HostRegistration::Wasi,
+                        HostRegistrationInstance::Wasi(WasiInstance { inner: wasi_module }),
+                    );
+                } else {
+                    panic!("failed to create WasiModule")
+                }
+            }
+        }
+
+        // * load and register plugin instances
+        for (pname, mnames) in self.plugins.iter() {
+            match mnames.is_empty() {
+                true => {
+                    let plugin = PluginManager::find(pname)?;
+                    for mname in plugin.mod_names().iter() {
+                        let plugin_instance = plugin.mod_instance(mname)?;
+                        vm.plugin_host_instances.push(plugin_instance);
+                        vm.store.register_plugin_module(
+                            &mut vm.executor,
+                            vm.plugin_host_instances.last().unwrap(),
+                        )?;
+                    }
+                }
+                false => {
+                    for mname in mnames {
+                        let plugin_instance = Self::create_plugin_instance(pname, mname)?;
+                        vm.plugin_host_instances.push(plugin_instance);
+                        vm.store.register_plugin_module(
+                            &mut vm.executor,
+                            vm.plugin_host_instances.last().unwrap(),
+                        )?;
+                    }
+                }
+            }
+        }
+
+        Ok(vm)
+    }
+
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    fn build_vm(mut self) -> WasmEdgeResult<Vm> {
+        // executor
+        let executor = Executor::new(self.config.as_ref(), self.stat.as_mut())?;
+
+        // store
+        let store = match self.store {
+            Some(store) => store,
+            None => Store::new()?,
+        };
+
+        // create a Vm instance
+        let mut vm = Vm {
+            config: self.config,
+            stat: self.stat,
+            executor,
+            store,
+            named_instances: HashMap::new(),
+            active_instance: None,
+            builtin_host_instances: HashMap::new(),
+            plugin_host_instances: Vec::new(),
+        };
+
+        // * register AsyncWasiModule
+        if let Some(cfg) = vm.config.as_ref() {
+            if cfg.wasi_enabled() {
+                match self.wasi_ctx {
+                    Some(ctx) => {
+                        // create an AsyncWasiModule instance
+                        let wasi_module =
+                            sys::r#async::module::AsyncWasiModule::create_from_wasi_context(
+                                ctx.inner,
+                            )?;
+
+                        // register the AsyncWasiModule instance
+                        vm.executor.inner.register_wasi_instance(
+                            &vm.store.inner,
+                            &sys::WasiInstance::AsyncWasi(wasi_module.clone()),
+                        )?;
+
+                        vm.builtin_host_instances.insert(
+                            HostRegistration::Wasi,
+                            HostRegistrationInstance::Wasi(WasiInstance(wasi_module)),
+                        );
+                    }
+                    None => {
+                        return Err(Box::new(WasmEdgeError::Vm(VmError::CreateWithWasiContext)));
+                    }
+                }
+            }
+        }
+
+        // * load and register plugin instances
+        for (pname, mnames) in self.plugins.iter() {
+            match mnames.is_empty() {
+                true => {
+                    let plugin = PluginManager::find(pname)?;
+                    for mname in plugin.mod_names().iter() {
+                        let plugin_instance = plugin.mod_instance(mname)?;
+                        vm.plugin_host_instances.push(plugin_instance);
+                        vm.store.register_plugin_module(
+                            &mut vm.executor,
+                            vm.plugin_host_instances.last().unwrap(),
+                        )?;
+                    }
+                }
+                false => {
+                    for mname in mnames {
+                        let plugin_instance = Self::create_plugin_instance(pname, mname)?;
+                        vm.plugin_host_instances.push(plugin_instance);
+                        vm.store.register_plugin_module(
+                            &mut vm.executor,
+                            vm.plugin_host_instances.last().unwrap(),
+                        )?;
+                    }
+                }
+            }
+        }
+
+        Ok(vm)
+    }
+
+    fn create_plugin_instance(
+        pname: impl AsRef<str>,
+        mname: impl AsRef<str>,
+    ) -> WasmEdgeResult<PluginInstance> {
+        let plugin = PluginManager::find(pname.as_ref())?;
+        plugin.mod_instance(mname.as_ref())
+    }
+}
+
+/// A [Vm] defines a virtual environment for managing WebAssembly programs.
+///
+/// # Example
+///
+/// The example below presents how to register a module as named module in a Vm instance and run a target wasm function.
+///
+/// ```rust
+/// // If the version of rust used is less than v1.63, please uncomment the follow attribute.
+/// // #![feature(explicit_generic_args_with_impl_trait)]
+/// #[cfg(not(feature = "async"))]
+/// use wasmedge_sdk::{params, VmBuilder, WasmVal, wat2wasm, ValType, NeverType};
+///
+/// #[cfg_attr(test, test)]
+/// fn main() -> Result<(), Box<dyn std::error::Error>> {
+///     #[cfg(not(feature = "async"))]
+///     {
+///         // create a Vm context
+///         let vm = VmBuilder::new().build()?;
+///
+///         // register a wasm module from the given in-memory wasm bytes
+///         let wasm_bytes = wat2wasm(
+///           br#"(module
+///               (type (;0;) (func (param i32) (result i32)))
+///               (type (;1;) (func))
+///               (func (;0;) (type 0) (param i32) (result i32)
+///                 (local i32 i32 i32)
+///                 i32.const 1
+///                 local.set 1
+///                 block  ;; label = @1
+///                   local.get 0
+///                   i32.const 2
+///                   i32.lt_s
+///                   br_if 0 (;@1;)
+///                   local.get 0
+///                   i32.const -1
+///                   i32.add
+///                   local.tee 1
+///                   i32.const 7
+///                   i32.and
+///                   local.set 2
+///                   block  ;; label = @2
+///                     block  ;; label = @3
+///                       local.get 0
+///                       i32.const -2
+///                       i32.add
+///                       i32.const 7
+///                       i32.ge_u
+///                       br_if 0 (;@3;)
+///                       i32.const 1
+///                       local.set 0
+///                       i32.const 1
+///                       local.set 1
+///                       br 1 (;@2;)
+///                     end
+///                     local.get 1
+///                     i32.const -8
+///                     i32.and
+///                     local.set 3
+///                     i32.const 1
+///                     local.set 0
+///                     i32.const 1
+///                     local.set 1
+///                     loop  ;; label = @3
+///                       local.get 1
+///                       local.get 0
+///                       i32.add
+///                       local.tee 0
+///                       local.get 1
+///                       i32.add
+///                       local.tee 1
+///                       local.get 0
+///                       i32.add
+///                       local.tee 0
+///                       local.get 1
+///                       i32.add
+///                       local.tee 1
+///                       local.get 0
+///                       i32.add
+///                       local.tee 0
+///                       local.get 1
+///                       i32.add
+///                       local.tee 1
+///                       local.get 0
+///                       i32.add
+///                       local.tee 0
+///                       local.get 1
+///                       i32.add
+///                       local.set 1
+///                       local.get 3
+///                       i32.const -8
+///                       i32.add
+///                       local.tee 3
+///                       br_if 0 (;@3;)
+///                     end
+///                   end
+///                   local.get 2
+///                   i32.eqz
+///                   br_if 0 (;@1;)
+///                   local.get 1
+///                   local.set 3
+///                   loop  ;; label = @2
+///                     local.get 3
+///                     local.get 0
+///                     i32.add
+///                     local.set 1
+///                     local.get 3
+///                     local.set 0
+///                     local.get 1
+///                     local.set 3
+///                     local.get 2
+///                     i32.const -1
+///                     i32.add
+///                     local.tee 2
+///                     br_if 0 (;@2;)
+///                   end
+///                 end
+///                 local.get 1)
+///               (func (;1;) (type 1))
+///               (func (;2;) (type 1)
+///                 call 1
+///                 call 1)
+///               (func (;3;) (type 0) (param i32) (result i32)
+///                 local.get 0
+///                 call 0
+///                 call 2)
+///               (table (;0;) 1 1 funcref)
+///               (memory (;0;) 16)
+///               (global (;0;) (mut i32) (i32.const 1048576))
+///               (export "memory" (memory 0))
+///               (export "fib" (func 3)))
+///           "#,
+///         )?;
+///         let mut vm = vm.register_module_from_bytes("extern", wasm_bytes)?;
+///
+///         // run `fib` function in the named module instance
+///         let returns = vm.run_func(Some("extern"), "fib", params!(10))?;
+///         assert_eq!(returns.len(), 1);
+///         assert_eq!(returns[0].to_i32(), 89);
+///     }
+///
+///     Ok(())
+/// }
+/// ```
+#[derive(Debug, Clone)]
+pub struct Vm {
+    pub(crate) config: Option<Config>,
+    stat: Option<Statistics>,
+    executor: Executor,
+    store: Store,
+    named_instances: HashMap<String, Instance>,
+    active_instance: Option<Instance>,
+    builtin_host_instances: HashMap<HostRegistration, HostRegistrationInstance>,
+    plugin_host_instances: Vec<PluginInstance>,
+}
+impl Vm {
+    /// Registers a [wasm module](crate::Module) into this vm as a named or active module [instance](crate::Instance).
+    ///
+    /// # Arguments
+    ///
+    /// * `mod_name` - The exported name for the registered module. If `None`, then the module is registered as an active instance.
+    ///
+    /// * `module` - The module to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register the given [module](crate::Module), then an error is returned.
+    ///
+    pub fn register_module(
+        mut self,
+        mod_name: Option<&str>,
+        module: Module,
+    ) -> WasmEdgeResult<Self> {
+        match mod_name {
+            Some(name) => {
+                let named_instance =
+                    self.store
+                        .register_named_module(&mut self.executor, name, &module)?;
+                self.named_instances.insert(name.into(), named_instance);
+            }
+            None => {
+                self.active_instance = Some(
+                    self.store
+                        .register_active_module(&mut self.executor, &module)?,
+                );
+            }
+        };
+
+        Ok(self)
+    }
+
+    /// Registers a wasm module into the vm from a wasm file.
+    ///
+    /// # Arguments
+    ///
+    /// * `mod_name` - The exported name for the registered module.
+    ///
+    /// * `file` - A wasm file or an AOT wasm file.
+    ///
+    /// # Error
+    ///
+    /// If fail to register, then an error is returned.
+    pub fn register_module_from_file(
+        self,
+        mod_name: impl AsRef<str>,
+        file: impl AsRef<Path>,
+    ) -> WasmEdgeResult<Self> {
+        // load module from file
+        let module = Module::from_file(self.config.as_ref(), file.as_ref())?;
+
+        // register the named module
+        self.register_module(Some(mod_name.as_ref()), module)
+    }
+
+    /// Registers a wasm module from the given in-memory wasm bytes into this vm.
+    ///
+    /// # Arguments
+    ///
+    /// * `mod_name` - The exported name for the registered module.
+    ///
+    /// * `bytes` - The in-memory wasm bytes.
+    ///
+    /// # Error
+    ///
+    /// If fail to register, then an error is returned.
+    pub fn register_module_from_bytes(
+        self,
+        mod_name: impl AsRef<str>,
+        bytes: impl AsRef<[u8]>,
+    ) -> WasmEdgeResult<Self> {
+        // load module from bytes
+        let module = Module::from_bytes(self.config.as_ref(), bytes)?;
+
+        // register the named module
+        self.register_module(Some(mod_name.as_ref()), module)
+    }
+
+    /// Registers an [import object](crate::ImportObject) into this vm.
+    ///
+    /// # Arguments
+    ///
+    /// * `import` - The import object to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register, then an error is returned.
+    pub fn register_import_module<T>(&mut self, import: &ImportObject<T>) -> WasmEdgeResult<()>
+    where
+        T: ?Sized + Send + Sync + Clone,
+    {
+        self.store
+            .register_import_module(&mut self.executor, import)?;
+
+        let import_instance = self.store.named_instance(import.name())?;
+        self.named_instances
+            .insert(import.name().into(), import_instance);
+
+        Ok(())
+    }
+
+    /// Auto detect all plugins in WASMEDGE_PLUGIN_PATH
+    ///
+    /// # Error
+    ///
+    /// If fail to register plugin instance, then an error is returned.
+    pub fn auto_detect_plugins(mut self) -> WasmEdgeResult<Self> {
+        for plugin_name in PluginManager::names().iter() {
+            if let Ok(plugin) = PluginManager::find(plugin_name) {
+                for mod_name in plugin.mod_names().iter() {
+                    if let Ok(mod_instance) = plugin.mod_instance(mod_name) {
+                        self.plugin_host_instances.push(mod_instance);
+                        self.executor.inner.register_plugin_instance(
+                            &self.store.inner,
+                            &self.plugin_host_instances.last().unwrap().inner,
+                        )?;
+                    }
+                }
+            }
+        }
+        Ok(self)
+    }
+
+    /// Runs an exported wasm function in a (named or active) [module instance](crate::Instance).
+    ///
+    /// # Arguments
+    ///
+    /// * `mod_name` - The exported name of the module instance, which holds the target function. If `None`, then the active module is used.
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the wasm function, then an error is returned.
+    pub fn run_func(
+        &self,
+        mod_name: Option<&str>,
+        func_name: impl AsRef<str>,
+        args: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        match mod_name {
+            Some(mod_name) => match self.named_instances.get(mod_name) {
+                Some(named_instance) => {
+                    let named_func = named_instance.func(func_name.as_ref())?;
+                    let res = named_func.run(self.executor(), args);
+                    drop(named_func);
+                    res
+                }
+                None => Err(Box::new(WasmEdgeError::Vm(VmError::NotFoundModule(
+                    mod_name.into(),
+                )))),
+            },
+            None => match &self.active_instance {
+                Some(active_instance) => active_instance
+                    .func(func_name.as_ref())?
+                    .run(self.executor(), args),
+                None => Err(Box::new(WasmEdgeError::Vm(VmError::NotFoundActiveModule))),
+            },
+        }
+    }
+
+    /// Runs an exported wasm function in a (named or active) [module instance](crate::Instance) with a timeout setting
+    ///
+    /// # Arguments
+    ///
+    /// * `mod_name` - The exported name of the module instance, which holds the target function. If `None`, then the active module is used.
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// * `timeout` - The maximum execution time of the function to be run.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the wasm function, then an error is returned.
+    #[cfg(all(target_os = "linux", not(target_env = "musl")))]
+    pub fn run_func_with_timeout(
+        &self,
+        mod_name: Option<&str>,
+        func_name: impl AsRef<str>,
+        args: impl IntoIterator<Item = WasmValue>,
+        timeout: std::time::Duration,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        match mod_name {
+            Some(mod_name) => {
+                match self.named_instances.get(mod_name) {
+                    Some(named_instance) => named_instance
+                        .func(func_name.as_ref())?
+                        .run_with_timeout(self.executor(), args, timeout),
+                    None => Err(Box::new(WasmEdgeError::Vm(VmError::NotFoundModule(
+                        mod_name.into(),
+                    )))),
+                }
+            }
+            None => match &self.active_instance {
+                Some(active_instance) => active_instance
+                    .func(func_name.as_ref())?
+                    .run_with_timeout(self.executor(), args, timeout),
+                None => Err(Box::new(WasmEdgeError::Vm(VmError::NotFoundActiveModule))),
+            },
+        }
+    }
+
+    /// Asynchronously runs an exported wasm function in a (named or active) [module instance](crate::Instance).
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - The [AsyncState] to run the wasm function.
+    ///
+    /// * `mod_name` - The exported name of the module instance, which holds the target function. If `None`, then the active module is used.
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the wasm function, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn run_func_async(
+        &self,
+        async_state: &AsyncState,
+        mod_name: Option<&str>,
+        func_name: impl AsRef<str> + Send,
+        args: impl IntoIterator<Item = WasmValue> + Send,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        match mod_name {
+            Some(mod_name) => match self.named_instances.get(mod_name) {
+                Some(named_instance) => {
+                    named_instance
+                        .func(func_name.as_ref())?
+                        .run_async(async_state, self.executor(), args)
+                        .await
+                }
+                None => Err(Box::new(WasmEdgeError::Vm(VmError::NotFoundModule(
+                    mod_name.into(),
+                )))),
+            },
+            None => match self.active_instance.as_ref() {
+                Some(active_instance) => {
+                    active_instance
+                        .func(func_name.as_ref())?
+                        .run_async(async_state, self.executor(), args)
+                        .await
+                }
+                None => Err(Box::new(WasmEdgeError::Vm(VmError::NotFoundActiveModule))),
+            },
+        }
+    }
+
+    /// Asynchronously runs an exported wasm function in a (named or active) [module instance](crate::Instance) with a timeout setting
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - The [AsyncState] to run the wasm function.
+    ///
+    /// * `mod_name` - The exported name of the module instance, which holds the target function. If `None`, then the active module is used.
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// * `timeout` - The maximum execution time of the function to be run.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the wasm function, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux", not(target_env = "musl")))]
+    #[cfg_attr(
+        docsrs,
+        doc(cfg(all(feature = "async", target_os = "linux", not(target_env = "musl"))))
+    )]
+    pub async fn run_func_async_with_timeout(
+        &self,
+        async_state: &AsyncState,
+        mod_name: Option<&str>,
+        func_name: impl AsRef<str> + Send,
+        args: impl IntoIterator<Item = WasmValue> + Send,
+        timeout: std::time::Duration,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        match mod_name {
+            Some(mod_name) => match self.named_instances.get(mod_name) {
+                Some(named_instance) => {
+                    named_instance
+                        .func(func_name.as_ref())?
+                        .run_async_with_timeout(async_state, self.executor(), args, timeout)
+                        .await
+                }
+                None => Err(Box::new(WasmEdgeError::Vm(VmError::NotFoundModule(
+                    mod_name.into(),
+                )))),
+            },
+            None => match self.active_instance.as_ref() {
+                Some(active_instance) => {
+                    active_instance
+                        .func(func_name.as_ref())?
+                        .run_async_with_timeout(async_state, self.executor(), args, timeout)
+                        .await
+                }
+                None => Err(Box::new(WasmEdgeError::Vm(VmError::NotFoundActiveModule))),
+            },
+        }
+    }
+
+    /// Runs an exported wasm function from the given [wasm module](crate::Module).
+    ///
+    /// This method is a shortcut of calling `register_module` and `run_func` in sequence.
+    ///
+    /// # Arguments
+    ///
+    /// * `module` - A [wasm module](crate::Module).
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run, then an error is returned.
+    pub fn run_func_from_module(
+        &mut self,
+        module: Module,
+        func_name: impl AsRef<str>,
+        args: impl IntoIterator<Item = sys::WasmValue>,
+    ) -> WasmEdgeResult<Vec<sys::WasmValue>> {
+        self.active_instance = Some(
+            self.store
+                .register_active_module(&mut self.executor, &module)?,
+        );
+
+        self.run_func(None, func_name, args)
+    }
+
+    /// Runs an exported wasm function from the given [wasm module](crate::Module).
+    ///
+    /// To use this method, turn on the `async` feature.
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - The [AsyncState] to run the wasm function.
+    ///
+    /// * `module` - A [wasm module](crate::Module).
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn run_func_from_module_async<N, A>(
+        &mut self,
+        async_state: &AsyncState,
+        module: Module,
+        func_name: N,
+        args: A,
+    ) -> WasmEdgeResult<Vec<WasmValue>>
+    where
+        N: AsRef<str> + Send,
+        A: IntoIterator<Item = WasmValue> + Send,
+    {
+        self.active_instance = Some(
+            self.store
+                .register_active_module(&mut self.executor, &module)?,
+        );
+
+        self.run_func_async(async_state, None, func_name, args)
+            .await
+    }
+
+    /// Runs an exported wasm function from the given wasm file.
+    ///
+    /// # Arguments
+    ///
+    /// * `file` - A wasm file or an AOT wasm file.
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run, then an error is returned.
+    pub fn run_func_from_file(
+        &mut self,
+        file: impl AsRef<Path>,
+        func_name: impl AsRef<str>,
+        args: impl IntoIterator<Item = sys::WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        // load module from file
+        let module = Module::from_file(self.config.as_ref(), file.as_ref())?;
+
+        self.run_func_from_module(module, func_name.as_ref(), args)
+    }
+
+    /// Asynchronously runs an exported wasm function from the given wasm file.
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - The [AsyncState] to run the wasm function.
+    ///
+    /// * `file` - A wasm file or an AOT wasm file.
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn run_func_from_file_async<P, N, A>(
+        &mut self,
+        async_state: &AsyncState,
+        file: P,
+        func_name: N,
+        args: A,
+    ) -> WasmEdgeResult<Vec<WasmValue>>
+    where
+        P: AsRef<Path>,
+        N: AsRef<str> + Send,
+        A: IntoIterator<Item = WasmValue> + Send,
+    {
+        // load module from file
+        let module = Module::from_file(self.config.as_ref(), file.as_ref())?;
+
+        self.run_func_from_module_async(async_state, module, func_name.as_ref(), args)
+            .await
+    }
+
+    /// Runs an exported wasm function from the given in-memory wasm bytes.
+    ///
+    /// # Arguments
+    ///
+    /// * `bytes` - The in-memory wasm bytes.
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run, then an error is returned.
+    pub fn run_func_from_bytes(
+        &mut self,
+        bytes: &[u8],
+        func_name: impl AsRef<str>,
+        args: impl IntoIterator<Item = sys::WasmValue>,
+    ) -> WasmEdgeResult<Vec<sys::WasmValue>> {
+        // load module from bytes
+        let module = Module::from_bytes(self.config.as_ref(), bytes)?;
+
+        self.run_func_from_module(module, func_name.as_ref(), args)
+    }
+
+    /// Runs an exported wasm function from the given in-memory wasm bytes.
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - The [AsyncState] to run the wasm function.
+    ///
+    /// * `bytes` - The in-memory wasm bytes.
+    ///
+    /// * `func_name` - The exported name of the target wasm function.
+    ///
+    /// * `args` - The arguments to be passed to the target wasm function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn run_func_from_bytes_async<N, A>(
+        &mut self,
+        async_state: &AsyncState,
+        bytes: &[u8],
+        func_name: N,
+        args: A,
+    ) -> WasmEdgeResult<Vec<WasmValue>>
+    where
+        N: AsRef<str> + Send,
+        A: IntoIterator<Item = WasmValue> + Send,
+    {
+        // load module from bytes
+        let module = Module::from_bytes(self.config.as_ref(), bytes)?;
+
+        self.run_func_from_module_async(async_state, module, func_name.as_ref(), args)
+            .await
+    }
+
+    /// Returns a reference to the internal [statistics](crate::Statistics) from this vm.
+    pub fn statistics(&self) -> Option<&Statistics> {
+        self.stat.as_ref()
+    }
+
+    /// Returns a mutable reference to the internal [statistics](crate::Statistics) from this vm.
+    pub fn statistics_mut(&mut self) -> Option<&mut Statistics> {
+        self.stat.as_mut()
+    }
+
+    /// Returns a reference to the internal [executor](crate::Executor) from this vm.
+    pub fn executor(&self) -> &Executor {
+        &self.executor
+    }
+
+    /// Returns a mutable reference to the internal [executor](crate::Executor) from this vm.
+    pub fn executor_mut(&mut self) -> &mut Executor {
+        &mut self.executor
+    }
+
+    /// Returns a reference to the internal [store](crate::Store) from this vm.
+    pub fn store(&self) -> &Store {
+        &self.store
+    }
+
+    /// Returns a mutable reference to the internal [store](crate::Store) from this vm.
+    pub fn store_mut(&mut self) -> &mut Store {
+        &mut self.store
+    }
+
+    /// Returns a reference to the [wasi module instance] from this vm.
+    ///
+    /// To retrieve  the [wasi module instance], a [config](crate::config::Config) with the enabled [wasi](crate::config::HostRegistrationConfigOptions::wasi) option should be given when create this vm.
+    ///
+    pub fn wasi_module(&self) -> Option<&WasiInstance> {
+        match self.builtin_host_instances.get(&HostRegistration::Wasi) {
+            Some(HostRegistrationInstance::Wasi(wasi_instance)) => Some(wasi_instance),
+            _ => None,
+        }
+    }
+
+    /// Returns a mutable reference to the [wasi module instance] from this vm.
+    ///
+    /// To retrieve the [wasi module instance], a [config](crate::config::Config) with the enabled [wasi](crate::config::HostRegistrationConfigOptions::wasi) option should be given when create this vm.
+    ///
+    pub fn wasi_module_mut(&mut self) -> Option<&mut WasiInstance> {
+        match self.builtin_host_instances.get_mut(&HostRegistration::Wasi) {
+            Some(HostRegistrationInstance::Wasi(wasi_instance)) => Some(wasi_instance),
+            _ => None,
+        }
+    }
+
+    /// Returns a reference to the named [module instance](crate::Instance) with the given name from this vm.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The exported name of the target module instance.
+    ///
+    /// # Error
+    ///
+    /// If fail to get the reference to the target module instance, then an error is returned.
+    pub fn named_module(&self, name: impl AsRef<str>) -> WasmEdgeResult<&Instance> {
+        self.named_instances.get(name.as_ref()).ok_or_else(|| {
+            Box::new(WasmEdgeError::Vm(VmError::NotFoundModule(
+                name.as_ref().into(),
+            )))
+        })
+    }
+
+    /// Returns a mutable reference to the named [module instance](crate::Instance) with the given name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The exported name of the target module instance.
+    ///
+    /// # Error
+    ///
+    /// If fail to get the mutable reference to the target module instance, then an error is returned.
+    pub fn named_module_mut(&mut self, name: impl AsRef<str>) -> WasmEdgeResult<&mut Instance> {
+        self.named_instances.get_mut(name.as_ref()).ok_or_else(|| {
+            Box::new(WasmEdgeError::Vm(VmError::NotFoundModule(
+                name.as_ref().into(),
+            )))
+        })
+    }
+
+    /// Returns a reference to the active [module instance](crate::Instance) from this vm.
+    ///
+    /// # Error
+    ///
+    /// If fail to get the reference to the active module instance, then an error is returned.
+    pub fn active_module(&self) -> WasmEdgeResult<&Instance> {
+        self.active_instance
+            .as_ref()
+            .ok_or_else(|| Box::new(WasmEdgeError::Vm(VmError::NotFoundActiveModule)))
+    }
+
+    /// Returns a mutable reference to the active [module instance](crate::Instance) from this vm.
+    ///
+    /// # Error
+    ///
+    /// If fail to get the mutable reference to the active module instance, then an error is returned.
+    pub fn active_module_mut(&mut self) -> WasmEdgeResult<&mut Instance> {
+        self.active_instance
+            .as_mut()
+            .ok_or_else(|| Box::new(WasmEdgeError::Vm(VmError::NotFoundActiveModule)))
+    }
+
+    /// Checks if the vm contains a named module instance.
+    ///
+    /// # Argument
+    ///
+    /// * `mod_name` - The exported name of the target module instance.
+    ///
+    pub fn contains_module(&self, mod_name: impl AsRef<str>) -> bool {
+        self.store.contains(mod_name)
+    }
+
+    /// Returns the count of the named [module instances](crate::Instance) this vm holds.
+    pub fn named_instance_count(&self) -> u32 {
+        self.store.named_instance_count()
+    }
+
+    /// Returns the names of all named [module instances](crate::Instance) this vm holds.
+    pub fn instance_names(&self) -> Vec<String> {
+        self.store.instance_names()
+    }
+}
+
+#[derive(Debug, Clone)]
+enum HostRegistrationInstance {
+    Wasi(WasiInstance),
+}
+
+#[cfg(not(feature = "async"))]
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        config::{
+            CommonConfigOptions, ConfigBuilder, HostRegistrationConfigOptions,
+            StatisticsConfigOptions,
+        },
+        error::HostFuncError,
+        io::WasmVal,
+        params,
+        types::Val,
+        wat2wasm, CallingFrame, Global, GlobalType, ImportObjectBuilder, Memory, MemoryType,
+        Mutability, NeverType, RefType, Table, TableType, ValType, WasmValue,
+    };
+
+    #[ignore]
+    #[test]
+    #[cfg(target_os = "linux")]
+    // To enable this test function, please install `wasi_crypto` plugin first.
+    fn test_vmbuilder() -> Result<(), Box<dyn std::error::Error>> {
+        use crate::{
+            config::{CommonConfigOptions, ConfigBuilder, HostRegistrationConfigOptions},
+            params,
+            plugin::PluginManager,
+            VmBuilder,
+        };
+
+        // load plugins from the default plugin path
+        PluginManager::load(None)?;
+
+        PluginManager::names().iter().for_each(|name| {
+            println!("plugin name: {}", name);
+        });
+
+        let wasm_app_file = "examples/wasmedge-sys/data/test_crypto.wasm";
+
+        let config = ConfigBuilder::new(CommonConfigOptions::default())
+            .with_host_registration_config(HostRegistrationConfigOptions::default().wasi(true))
+            .build()?;
+        assert!(config.wasi_enabled());
+
+        let mut vm = VmBuilder::new()
+            .with_config(config)
+            // .with_plugin_wasi_crypto()
+            .with_plugin(
+                "wasi_crypto",
+                Some(vec![
+                    "wasi_crypto_asymmetric_common",
+                    "wasi_crypto_signatures",
+                    "wasi_crypto_symmetric",
+                ]),
+            )
+            // .with_plugin("wasi_crypto", None)
+            .build()?;
+
+        vm.wasi_module_mut()
+            .expect("Not found wasi module")
+            .initialize(None, None, None);
+
+        vm.register_module_from_file("wasm-app", &wasm_app_file)?
+            .run_func(Some("wasm-app"), "_start", params!())?;
+
+        Ok(())
+    }
+
+    #[test]
+    fn test_vm_run_func_from_file() {
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let mut vm = result.unwrap();
+
+        // register a wasm module from a specified wasm file
+        let file = std::env::current_dir()
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+
+        // run `fib` function from the wasm file
+        let result = vm.run_func_from_file(file, "fib", params!(10));
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns.len(), 1);
+        assert_eq!(returns[0].to_i32(), 89);
+    }
+
+    #[test]
+    fn test_vm_run_func_from_bytes() {
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let mut vm = result.unwrap();
+
+        // register a wasm module from the given in-memory wasm bytes
+        // load wasm module
+        let result = wat2wasm(
+            br#"(module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+        "#,
+        );
+        assert!(result.is_ok());
+        let wasm_bytes = result.unwrap();
+
+        // run `fib` function from the wasm bytes
+        let result = vm.run_func_from_bytes(&wasm_bytes, "fib", params!(10));
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns.len(), 1);
+        assert_eq!(returns[0].to_i32(), 89);
+    }
+
+    #[test]
+    fn test_vm_run_func_from_module() {
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let mut vm = result.unwrap();
+
+        // load wasm module
+        let result = wat2wasm(
+            br#"(module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+        "#,
+        );
+        assert!(result.is_ok());
+        let wasm_bytes = result.unwrap();
+        let result = Module::from_bytes(None, wasm_bytes);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // run `fib` function from the compiled module
+        let result = vm.run_func_from_module(module, "fib", params!(10));
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns.len(), 1);
+        assert_eq!(returns[0].to_i32(), 89);
+    }
+
+    #[test]
+    fn test_vm_run_func_in_named_module_instance() {
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // register a wasm module from the given in-memory wasm bytes
+        // load wasm module
+        let result = wat2wasm(
+            br#"(module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+        "#,
+        );
+        assert!(result.is_ok());
+        let wasm_bytes = result.unwrap();
+        let result = vm.register_module_from_bytes("extern", wasm_bytes);
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // run `fib` function in the named module instance
+        let result = vm.run_func(Some("extern"), "fib", params!(10));
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns.len(), 1);
+        assert_eq!(returns[0].to_i32(), 89);
+    }
+
+    #[test]
+    fn test_vm_run_func_in_active_module_instance() {
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // load wasm module
+        let result = wat2wasm(
+            br#"(module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+        "#,
+        );
+        assert!(result.is_ok());
+        let wasm_bytes = result.unwrap();
+        let result = Module::from_bytes(None, wasm_bytes);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // register the wasm module into vm
+        let result = vm.register_module(None, module);
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // run `fib` function in the active module instance
+        let result = vm.run_func(None, "fib", params!(10));
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns.len(), 1);
+        assert_eq!(returns[0].to_i32(), 89);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_vm_create() {
+        {
+            let result = VmBuilder::new().build();
+            assert!(result.is_ok());
+        }
+
+        {
+            // create a Config
+            let result = ConfigBuilder::new(CommonConfigOptions::default()).build();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+
+            // create a Vm context
+            let result = VmBuilder::new().with_config(config).build();
+            assert!(result.is_ok());
+            let _vm = result.unwrap();
+        }
+    }
+
+    #[test]
+    fn test_vm_wasi_module() {
+        let host_reg_options = HostRegistrationConfigOptions::default().wasi(true);
+        let result = ConfigBuilder::new(CommonConfigOptions::default())
+            .with_host_registration_config(host_reg_options)
+            .build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        // create a vm with the config settings
+        let result = VmBuilder::new().with_config(config).build();
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // get the wasi module
+        let result = vm.wasi_module();
+        assert!(result.is_some());
+        let wasi_instance = result.unwrap();
+
+        assert_eq!(wasi_instance.name(), "wasi_snapshot_preview1");
+    }
+
+    #[test]
+    fn test_vm_statistics() {
+        // set config options related to Statistics
+        let stat_config_options = StatisticsConfigOptions::new()
+            .measure_cost(true)
+            .measure_time(true)
+            .count_instructions(true);
+        // create a Config
+        let result = ConfigBuilder::new(CommonConfigOptions::default())
+            .with_statistics_config(stat_config_options)
+            .build();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        // create a Vm context
+        let result = VmBuilder::new().with_config(config).build();
+        assert!(result.is_ok());
+        let _vm = result.unwrap();
+
+        // get the statistics
+        // let _stat = vm.statistics_mut();
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_vm_register_module_from_file() {
+        {
+            // create a Vm context
+            let result = VmBuilder::new().build();
+            assert!(result.is_ok());
+            let vm = result.unwrap();
+
+            // register a wasm module from a specified wasm file
+            let file = std::env::current_dir()
+                .unwrap()
+                .join("examples/wasmedge-sys/data/fibonacci.wat");
+            let result = vm.register_module_from_file("extern", file);
+            assert!(result.is_ok());
+            let vm = result.unwrap();
+
+            assert!(vm.named_instance_count() >= 1);
+            assert!(vm.instance_names().iter().any(|x| x == "extern"));
+        }
+
+        {
+            // create a Vm context
+            let result = VmBuilder::new().build();
+            assert!(result.is_ok());
+            let vm = result.unwrap();
+
+            // register a wasm module from a specified wasm file
+            let file = std::env::current_dir()
+                .unwrap()
+                .join("examples/wasmedge-sys/data/fibonacci.wat");
+            let result = vm.register_module_from_file("extern", file);
+            assert!(result.is_ok());
+            let vm = result.unwrap();
+
+            assert!(vm.named_instance_count() >= 1);
+            assert!(vm.instance_names().iter().any(|x| x == "extern"));
+        }
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_vm_register_module_from_bytes() {
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // register a wasm module from the given in-memory wasm bytes
+        // load wasm module
+        let result = wat2wasm(
+            br#"(module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+        "#,
+        );
+        assert!(result.is_ok());
+        let wasm_bytes = result.unwrap();
+        let result = vm.register_module_from_bytes("extern", wasm_bytes);
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        assert!(vm.named_instance_count() >= 1);
+        assert!(vm.instance_names().iter().any(|x| x == "extern"));
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_vm_register_import_module() {
+        // create a Const global instance
+        let result = Global::new(
+            GlobalType::new(ValType::F32, Mutability::Const),
+            Val::F32(3.5),
+        );
+        assert!(result.is_ok());
+        let global_const = result.unwrap();
+
+        // create a memory instance
+        let result = MemoryType::new(10, None, false);
+        assert!(result.is_ok());
+        let memory_type = result.unwrap();
+        let result = Memory::new(memory_type);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // create a table instance
+        let result = Table::new(TableType::new(RefType::FuncRef, 5, None));
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // create an ImportModule instance
+        let result = ImportObjectBuilder::new()
+            .with_func::<(i32, i32), i32, NeverType>("add", real_add, None)
+            .expect("failed to add host function")
+            .with_global("global", global_const)
+            .with_memory("mem", memory)
+            .with_table("table", table)
+            .build::<NeverType>("extern-module", None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let mut vm = result.unwrap();
+
+        // register an import module into vm
+        let result = vm.register_import_module(&import);
+        assert!(result.is_ok());
+
+        assert!(vm.named_instance_count() >= 1);
+        assert!(vm.instance_names().iter().any(|x| x == "extern-module"));
+
+        // get active module instance
+        let result = vm.named_module("extern-module");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+        assert!(instance.name().is_some());
+        assert_eq!(instance.name().unwrap(), "extern-module");
+
+        let result = instance.global("global");
+        assert!(result.is_ok());
+        let global = result.unwrap();
+        let ty = global.ty();
+        assert_eq!(*ty, GlobalType::new(ValType::F32, Mutability::Const));
+    }
+
+    #[test]
+    fn test_vm_register_named_module() {
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // load wasm module
+        let result = wat2wasm(
+            br#"(module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+        "#,
+        );
+        assert!(result.is_ok());
+        let wasm_bytes = result.unwrap();
+        let result = Module::from_bytes(None, wasm_bytes);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // register the wasm module into vm
+        let result = vm.register_module(Some("extern"), module);
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // check the exported functions in the "extern" module
+        assert!(vm.named_instance_count() >= 1);
+        let result = vm.named_module("extern");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        assert_eq!(instance.func_count(), 1);
+        let result = instance.func_names();
+        assert!(result.is_some());
+        let func_names = result.unwrap();
+        assert_eq!(func_names, ["fib"]);
+
+        // get host_func
+        let result = instance.func("fib");
+        assert!(result.is_ok());
+        let fib = result.unwrap();
+
+        // check the type of host_func
+        let ty = fib.ty();
+        assert!(ty.args().is_some());
+        assert_eq!(ty.args().unwrap(), [ValType::I32]);
+        assert!(ty.returns().is_some());
+        assert_eq!(ty.returns().unwrap(), [ValType::I32]);
+    }
+
+    #[test]
+    fn test_vm_register_active_module() {
+        // create a Vm context
+        let result = VmBuilder::new().build();
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // load wasm module
+        let result = wat2wasm(
+            br#"(module
+                (type (;0;) (func (param i32) (result i32)))
+                (type (;1;) (func))
+                (func (;0;) (type 0) (param i32) (result i32)
+                  (local i32 i32 i32)
+                  i32.const 1
+                  local.set 1
+                  block  ;; label = @1
+                    local.get 0
+                    i32.const 2
+                    i32.lt_s
+                    br_if 0 (;@1;)
+                    local.get 0
+                    i32.const -1
+                    i32.add
+                    local.tee 1
+                    i32.const 7
+                    i32.and
+                    local.set 2
+                    block  ;; label = @2
+                      block  ;; label = @3
+                        local.get 0
+                        i32.const -2
+                        i32.add
+                        i32.const 7
+                        i32.ge_u
+                        br_if 0 (;@3;)
+                        i32.const 1
+                        local.set 0
+                        i32.const 1
+                        local.set 1
+                        br 1 (;@2;)
+                      end
+                      local.get 1
+                      i32.const -8
+                      i32.and
+                      local.set 3
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      loop  ;; label = @3
+                        local.get 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.tee 1
+                        local.get 0
+                        i32.add
+                        local.tee 0
+                        local.get 1
+                        i32.add
+                        local.set 1
+                        local.get 3
+                        i32.const -8
+                        i32.add
+                        local.tee 3
+                        br_if 0 (;@3;)
+                      end
+                    end
+                    local.get 2
+                    i32.eqz
+                    br_if 0 (;@1;)
+                    local.get 1
+                    local.set 3
+                    loop  ;; label = @2
+                      local.get 3
+                      local.get 0
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      local.set 0
+                      local.get 1
+                      local.set 3
+                      local.get 2
+                      i32.const -1
+                      i32.add
+                      local.tee 2
+                      br_if 0 (;@2;)
+                    end
+                  end
+                  local.get 1)
+                (func (;1;) (type 1))
+                (func (;2;) (type 1)
+                  call 1
+                  call 1)
+                (func (;3;) (type 0) (param i32) (result i32)
+                  local.get 0
+                  call 0
+                  call 2)
+                (table (;0;) 1 1 funcref)
+                (memory (;0;) 16)
+                (global (;0;) (mut i32) (i32.const 1048576))
+                (export "memory" (memory 0))
+                (export "fib" (func 3)))
+        "#,
+        );
+        assert!(result.is_ok());
+        let wasm_bytes = result.unwrap();
+        let result = Module::from_bytes(None, wasm_bytes);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // register the wasm module into vm
+        let result = vm.register_module(None, module);
+        assert!(result.is_ok());
+        let vm = result.unwrap();
+
+        // check the exported functions in the "extern" module
+        let result = vm.active_module();
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        assert_eq!(instance.func_count(), 1);
+        let result = instance.func_names();
+        assert!(result.is_some());
+        let func_names = result.unwrap();
+        assert_eq!(func_names, ["fib"]);
+
+        // get host_func
+        let result = instance.func("fib");
+        assert!(result.is_ok());
+        let fib = result.unwrap();
+
+        // check the type of host_func
+        let ty = fib.ty();
+        assert!(ty.args().is_some());
+        assert_eq!(ty.args().unwrap(), [ValType::I32]);
+        assert!(ty.returns().is_some());
+        assert_eq!(ty.returns().unwrap(), [ValType::I32]);
+    }
+
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+        _data: *mut std::os::raw::c_void,
+    ) -> std::result::Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sdk/wasi.rs.html b/src/wasmedge_sdk/wasi.rs.html new file mode 100644 index 000000000..e114994a9 --- /dev/null +++ b/src/wasmedge_sdk/wasi.rs.html @@ -0,0 +1,339 @@ +wasi.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+
//! Defines wasi module instance.
+
+/// Represents a wasi module instance.
+#[cfg(not(feature = "async"))]
+#[derive(Debug, Clone)]
+pub struct WasiInstance {
+    pub(crate) inner: wasmedge_sys::WasiModule,
+}
+#[cfg(not(feature = "async"))]
+impl WasiInstance {
+    /// Returns the name of this exported [module instance](crate::Instance).
+    ///
+    /// If this [module instance](crate::Instance) is an active [instance](crate::Instance), return None.
+    pub fn name(&self) -> &str {
+        self.inner.name()
+    }
+
+    /// Initializes the WASI host module with the given parameters.
+    ///
+    /// # Arguments
+    ///
+    /// * `args` - The commandline arguments. The first argument is the program name.
+    ///
+    /// * `envs` - The environment variables in the format `ENV_VAR_NAME=VALUE`.
+    ///
+    /// * `preopens` - The directories to pre-open. The required format is `DIR1:DIR2`.
+    pub fn initialize(
+        &mut self,
+        args: Option<Vec<&str>>,
+        envs: Option<Vec<&str>>,
+        preopens: Option<Vec<&str>>,
+    ) {
+        self.inner.init_wasi(args, envs, preopens);
+    }
+
+    /// Returns the WASI exit code.
+    ///
+    /// The WASI exit code can be accessed after running the "_start" function of a `wasm32-wasi` program.
+    pub fn exit_code(&self) -> u32 {
+        self.inner.exit_code()
+    }
+
+    /// Returns the native handler from the mapped FD/Handler.
+    ///
+    /// # Argument
+    ///
+    /// * `fd` - The WASI mapped Fd.
+    ///
+    /// # Error
+    ///
+    /// If fail to get the native handler, then an error is returned.
+    pub fn native_handler(&self, fd: i32) -> crate::WasmEdgeResult<u64> {
+        self.inner.get_native_handler(fd)
+    }
+}
+
+#[cfg(all(feature = "async", target_os = "linux"))]
+#[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+pub mod r#async {
+
+    /// The state of an asynchronous task.
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub type AsyncState = wasmedge_sys::r#async::fiber::AsyncState;
+
+    /// Represents a wasi module instance for the `async` scenarios.
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    #[derive(Debug, Clone)]
+    pub struct WasiInstance(pub(crate) wasmedge_sys::r#async::AsyncWasiModule);
+    impl WasiInstance {
+        /// Returns the WASI exit code.
+        ///
+        /// The WASI exit code can be accessed after running the "_start" function of a `wasm32-wasi` program.
+        pub fn exit_code(&self) -> u32 {
+            self.0.exit_code()
+        }
+    }
+
+    /// Represents a wasi context for the `async` scenarios.
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    #[derive(Debug)]
+    pub struct WasiContext {
+        pub(crate) inner: async_wasi::WasiCtx,
+    }
+    impl WasiContext {
+        /// Creates a wasi context with the specified argumentes, environment variables, and preopened directories.
+        ///
+        /// # Arguments
+        ///
+        /// * `args` - The commandline arguments. The first argument is the program name.
+        ///
+        /// * `envs` - The environment variables to use.
+        ///
+        /// * `preopens` - The directories to pre-open. The first element of the pair is the host directory, while the second is the guest directory.
+        pub fn new(
+            args: Option<Vec<&str>>,
+            envs: Option<Vec<(&str, &str)>>,
+            preopens: Option<Vec<(&str, &str)>>,
+        ) -> Self {
+            let mut inner = async_wasi::WasiCtx::new();
+
+            if let Some(args) = args {
+                inner.push_args(args.iter().map(|x| x.to_string()).collect());
+            }
+            if let Some(envs) = envs {
+                inner.push_envs(envs.iter().map(|(k, v)| format!("{}={}", k, v)).collect());
+            }
+            if let Some(preopens) = preopens {
+                for (host_dir, guest_dir) in preopens {
+                    inner.push_preopen(
+                        std::path::PathBuf::from(host_dir),
+                        std::path::PathBuf::from(guest_dir),
+                    )
+                }
+            }
+
+            Self { inner }
+        }
+
+        /// Creates a wasi context with the specified argumentes, environment variables, and preopened directories.
+        ///
+        /// # Arguments
+        ///
+        /// * `args` - The commandline arguments. The first argument is the program name.
+        ///
+        /// * `envs` - The environment variables to use.
+        ///
+        /// * `preopens` - The directories to pre-open. The first element of the pair is the host directory, while the second is the guest directory.
+        pub fn generate<S: Into<String>>(
+            args: Option<Vec<S>>,
+            envs: Option<Vec<(S, S)>>,
+            preopens: Option<Vec<(S, S)>>,
+        ) -> Self {
+            let mut inner = async_wasi::WasiCtx::new();
+
+            if let Some(args) = args {
+                inner.push_args(args.into_iter().map(|x| x.into()).collect());
+            }
+            if let Some(envs) = envs {
+                inner.push_envs(
+                    envs.into_iter()
+                        .map(|(k, v)| format!("{}={}", k.into(), v.into()))
+                        .collect(),
+                );
+            }
+            if let Some(preopens) = preopens {
+                for (host_dir, guest_dir) in preopens {
+                    inner.push_preopen(
+                        std::path::PathBuf::from(host_dir.into()),
+                        std::path::PathBuf::from(guest_dir.into()),
+                    )
+                }
+            }
+
+            Self { inner }
+        }
+
+        /// Returns the WASI exit code.
+        ///
+        /// The WASI exit code can be accessed after running the "_start" function of a `wasm32-wasi` program.
+        pub fn exit_code(&self) -> u32 {
+            self.inner.exit_code
+        }
+    }
+    impl Default for WasiContext {
+        fn default() -> Self {
+            Self::new(None, None, None)
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/__w/wasmedge-rust-sdk/wasmedge-rust-sdk/target/debug/build/wasmedge-sys-5960b901b582150d/out/wasmedge.rs.html b/src/wasmedge_sys/__w/wasmedge-rust-sdk/wasmedge-rust-sdk/target/debug/build/wasmedge-sys-5960b901b582150d/out/wasmedge.rs.html new file mode 100644 index 000000000..64681cf6c --- /dev/null +++ b/src/wasmedge_sys/__w/wasmedge-rust-sdk/wasmedge-rust-sdk/target/debug/build/wasmedge-sys-5960b901b582150d/out/wasmedge.rs.html @@ -0,0 +1,6 @@ +wasmedge.rs - source
1
+2
+3
+
/* automatically generated by rust-bindgen 0.69.1 */
+
+pub const __bool_true_false_are_defined : u32 = 1 ; pub const true_ : u32 = 1 ; pub const false_ : u32 = 0 ; pub const _STDINT_H : u32 = 1 ; pub const _FEATURES_H : u32 = 1 ; pub const _DEFAULT_SOURCE : u32 = 1 ; pub const __GLIBC_USE_ISOC2X : u32 = 0 ; pub const __USE_ISOC11 : u32 = 1 ; pub const __USE_ISOC99 : u32 = 1 ; pub const __USE_ISOC95 : u32 = 1 ; pub const __USE_POSIX_IMPLICITLY : u32 = 1 ; pub const _POSIX_SOURCE : u32 = 1 ; pub const _POSIX_C_SOURCE : u32 = 200809 ; pub const __USE_POSIX : u32 = 1 ; pub const __USE_POSIX2 : u32 = 1 ; pub const __USE_POSIX199309 : u32 = 1 ; pub const __USE_POSIX199506 : u32 = 1 ; pub const __USE_XOPEN2K : u32 = 1 ; pub const __USE_XOPEN2K8 : u32 = 1 ; pub const _ATFILE_SOURCE : u32 = 1 ; pub const __WORDSIZE : u32 = 64 ; pub const __WORDSIZE_TIME64_COMPAT32 : u32 = 1 ; pub const __SYSCALL_WORDSIZE : u32 = 64 ; pub const __TIMESIZE : u32 = 64 ; pub const __USE_MISC : u32 = 1 ; pub const __USE_ATFILE : u32 = 1 ; pub const __USE_FORTIFY_LEVEL : u32 = 0 ; pub const __GLIBC_USE_DEPRECATED_GETS : u32 = 0 ; pub const __GLIBC_USE_DEPRECATED_SCANF : u32 = 0 ; pub const _STDC_PREDEF_H : u32 = 1 ; pub const __STDC_IEC_559__ : u32 = 1 ; pub const __STDC_IEC_60559_BFP__ : u32 = 201404 ; pub const __STDC_IEC_559_COMPLEX__ : u32 = 1 ; pub const __STDC_IEC_60559_COMPLEX__ : u32 = 201404 ; pub const __STDC_ISO_10646__ : u32 = 201706 ; pub const __GNU_LIBRARY__ : u32 = 6 ; pub const __GLIBC__ : u32 = 2 ; pub const __GLIBC_MINOR__ : u32 = 35 ; pub const _SYS_CDEFS_H : u32 = 1 ; pub const __glibc_c99_flexarr_available : u32 = 1 ; pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI : u32 = 0 ; pub const __HAVE_GENERIC_SELECTION : u32 = 1 ; pub const __GLIBC_USE_LIB_EXT2 : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_BFP_EXT : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_EXT : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X : u32 = 0 ; pub const __GLIBC_USE_IEC_60559_TYPES_EXT : u32 = 0 ; pub const _BITS_TYPES_H : u32 = 1 ; pub const _BITS_TYPESIZES_H : u32 = 1 ; pub const __OFF_T_MATCHES_OFF64_T : u32 = 1 ; pub const __INO_T_MATCHES_INO64_T : u32 = 1 ; pub const __RLIM_T_MATCHES_RLIM64_T : u32 = 1 ; pub const __STATFS_MATCHES_STATFS64 : u32 = 1 ; pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 : u32 = 1 ; pub const __FD_SETSIZE : u32 = 1024 ; pub const _BITS_TIME64_H : u32 = 1 ; pub const _BITS_WCHAR_H : u32 = 1 ; pub const _BITS_STDINT_INTN_H : u32 = 1 ; pub const _BITS_STDINT_UINTN_H : u32 = 1 ; pub const INT8_MIN : i32 = - 128 ; pub const INT16_MIN : i32 = - 32768 ; pub const INT32_MIN : i32 = - 2147483648 ; pub const INT8_MAX : u32 = 127 ; pub const INT16_MAX : u32 = 32767 ; pub const INT32_MAX : u32 = 2147483647 ; pub const UINT8_MAX : u32 = 255 ; pub const UINT16_MAX : u32 = 65535 ; pub const UINT32_MAX : u32 = 4294967295 ; pub const INT_LEAST8_MIN : i32 = - 128 ; pub const INT_LEAST16_MIN : i32 = - 32768 ; pub const INT_LEAST32_MIN : i32 = - 2147483648 ; pub const INT_LEAST8_MAX : u32 = 127 ; pub const INT_LEAST16_MAX : u32 = 32767 ; pub const INT_LEAST32_MAX : u32 = 2147483647 ; pub const UINT_LEAST8_MAX : u32 = 255 ; pub const UINT_LEAST16_MAX : u32 = 65535 ; pub const UINT_LEAST32_MAX : u32 = 4294967295 ; pub const INT_FAST8_MIN : i32 = - 128 ; pub const INT_FAST16_MIN : i64 = - 9223372036854775808 ; pub const INT_FAST32_MIN : i64 = - 9223372036854775808 ; pub const INT_FAST8_MAX : u32 = 127 ; pub const INT_FAST16_MAX : u64 = 9223372036854775807 ; pub const INT_FAST32_MAX : u64 = 9223372036854775807 ; pub const UINT_FAST8_MAX : u32 = 255 ; pub const UINT_FAST16_MAX : i32 = - 1 ; pub const UINT_FAST32_MAX : i32 = - 1 ; pub const INTPTR_MIN : i64 = - 9223372036854775808 ; pub const INTPTR_MAX : u64 = 9223372036854775807 ; pub const UINTPTR_MAX : i32 = - 1 ; pub const PTRDIFF_MIN : i64 = - 9223372036854775808 ; pub const PTRDIFF_MAX : u64 = 9223372036854775807 ; pub const SIG_ATOMIC_MIN : i32 = - 2147483648 ; pub const SIG_ATOMIC_MAX : u32 = 2147483647 ; pub const SIZE_MAX : i32 = - 1 ; pub const WINT_MIN : u32 = 0 ; pub const WINT_MAX : u32 = 4294967295 ; pub const WASMEDGE_VERSION : & [u8 ; 7] = b"0.13.5\0" ; pub const WASMEDGE_VERSION_MAJOR : u32 = 0 ; pub const WASMEDGE_VERSION_MINOR : u32 = 13 ; pub const WASMEDGE_VERSION_PATCH : u32 = 5 ; pub const WasmEdge_Plugin_CurrentAPIVersion : u32 = 2 ; pub type __u_char = :: std :: os :: raw :: c_uchar ; pub type __u_short = :: std :: os :: raw :: c_ushort ; pub type __u_int = :: std :: os :: raw :: c_uint ; pub type __u_long = :: std :: os :: raw :: c_ulong ; pub type __int8_t = :: std :: os :: raw :: c_schar ; pub type __uint8_t = :: std :: os :: raw :: c_uchar ; pub type __int16_t = :: std :: os :: raw :: c_short ; pub type __uint16_t = :: std :: os :: raw :: c_ushort ; pub type __int32_t = :: std :: os :: raw :: c_int ; pub type __uint32_t = :: std :: os :: raw :: c_uint ; pub type __int64_t = :: std :: os :: raw :: c_long ; pub type __uint64_t = :: std :: os :: raw :: c_ulong ; pub type __int_least8_t = __int8_t ; pub type __uint_least8_t = __uint8_t ; pub type __int_least16_t = __int16_t ; pub type __uint_least16_t = __uint16_t ; pub type __int_least32_t = __int32_t ; pub type __uint_least32_t = __uint32_t ; pub type __int_least64_t = __int64_t ; pub type __uint_least64_t = __uint64_t ; pub type __quad_t = :: std :: os :: raw :: c_long ; pub type __u_quad_t = :: std :: os :: raw :: c_ulong ; pub type __intmax_t = :: std :: os :: raw :: c_long ; pub type __uintmax_t = :: std :: os :: raw :: c_ulong ; pub type __dev_t = :: std :: os :: raw :: c_ulong ; pub type __uid_t = :: std :: os :: raw :: c_uint ; pub type __gid_t = :: std :: os :: raw :: c_uint ; pub type __ino_t = :: std :: os :: raw :: c_ulong ; pub type __ino64_t = :: std :: os :: raw :: c_ulong ; pub type __mode_t = :: std :: os :: raw :: c_uint ; pub type __nlink_t = :: std :: os :: raw :: c_ulong ; pub type __off_t = :: std :: os :: raw :: c_long ; pub type __off64_t = :: std :: os :: raw :: c_long ; pub type __pid_t = :: std :: os :: raw :: c_int ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct __fsid_t { pub __val : [:: std :: os :: raw :: c_int ; 2usize] , } # [test] fn bindgen_test_layout___fsid_t () { const UNINIT : :: std :: mem :: MaybeUninit < __fsid_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < __fsid_t > () , 8usize , concat ! ("Size of: " , stringify ! (__fsid_t))) ; assert_eq ! (:: std :: mem :: align_of :: < __fsid_t > () , 4usize , concat ! ("Alignment of " , stringify ! (__fsid_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . __val) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (__fsid_t) , "::" , stringify ! (__val))) ; } pub type __clock_t = :: std :: os :: raw :: c_long ; pub type __rlim_t = :: std :: os :: raw :: c_ulong ; pub type __rlim64_t = :: std :: os :: raw :: c_ulong ; pub type __id_t = :: std :: os :: raw :: c_uint ; pub type __time_t = :: std :: os :: raw :: c_long ; pub type __useconds_t = :: std :: os :: raw :: c_uint ; pub type __suseconds_t = :: std :: os :: raw :: c_long ; pub type __suseconds64_t = :: std :: os :: raw :: c_long ; pub type __daddr_t = :: std :: os :: raw :: c_int ; pub type __key_t = :: std :: os :: raw :: c_int ; pub type __clockid_t = :: std :: os :: raw :: c_int ; pub type __timer_t = * mut :: std :: os :: raw :: c_void ; pub type __blksize_t = :: std :: os :: raw :: c_long ; pub type __blkcnt_t = :: std :: os :: raw :: c_long ; pub type __blkcnt64_t = :: std :: os :: raw :: c_long ; pub type __fsblkcnt_t = :: std :: os :: raw :: c_ulong ; pub type __fsblkcnt64_t = :: std :: os :: raw :: c_ulong ; pub type __fsfilcnt_t = :: std :: os :: raw :: c_ulong ; pub type __fsfilcnt64_t = :: std :: os :: raw :: c_ulong ; pub type __fsword_t = :: std :: os :: raw :: c_long ; pub type __ssize_t = :: std :: os :: raw :: c_long ; pub type __syscall_slong_t = :: std :: os :: raw :: c_long ; pub type __syscall_ulong_t = :: std :: os :: raw :: c_ulong ; pub type __loff_t = __off64_t ; pub type __caddr_t = * mut :: std :: os :: raw :: c_char ; pub type __intptr_t = :: std :: os :: raw :: c_long ; pub type __socklen_t = :: std :: os :: raw :: c_uint ; pub type __sig_atomic_t = :: std :: os :: raw :: c_int ; pub type int_least8_t = __int_least8_t ; pub type int_least16_t = __int_least16_t ; pub type int_least32_t = __int_least32_t ; pub type int_least64_t = __int_least64_t ; pub type uint_least8_t = __uint_least8_t ; pub type uint_least16_t = __uint_least16_t ; pub type uint_least32_t = __uint_least32_t ; pub type uint_least64_t = __uint_least64_t ; pub type int_fast8_t = :: std :: os :: raw :: c_schar ; pub type int_fast16_t = :: std :: os :: raw :: c_long ; pub type int_fast32_t = :: std :: os :: raw :: c_long ; pub type int_fast64_t = :: std :: os :: raw :: c_long ; pub type uint_fast8_t = :: std :: os :: raw :: c_uchar ; pub type uint_fast16_t = :: std :: os :: raw :: c_ulong ; pub type uint_fast32_t = :: std :: os :: raw :: c_ulong ; pub type uint_fast64_t = :: std :: os :: raw :: c_ulong ; pub type intmax_t = __intmax_t ; pub type uintmax_t = __uintmax_t ; pub const WasmEdge_Proposal_ImportExportMutGlobals : WasmEdge_Proposal = 0 ; pub const WasmEdge_Proposal_NonTrapFloatToIntConversions : WasmEdge_Proposal = 1 ; pub const WasmEdge_Proposal_SignExtensionOperators : WasmEdge_Proposal = 2 ; pub const WasmEdge_Proposal_MultiValue : WasmEdge_Proposal = 3 ; pub const WasmEdge_Proposal_BulkMemoryOperations : WasmEdge_Proposal = 4 ; pub const WasmEdge_Proposal_ReferenceTypes : WasmEdge_Proposal = 5 ; pub const WasmEdge_Proposal_SIMD : WasmEdge_Proposal = 6 ; pub const WasmEdge_Proposal_TailCall : WasmEdge_Proposal = 7 ; pub const WasmEdge_Proposal_MultiMemories : WasmEdge_Proposal = 8 ; pub const WasmEdge_Proposal_Annotations : WasmEdge_Proposal = 9 ; pub const WasmEdge_Proposal_Memory64 : WasmEdge_Proposal = 10 ; pub const WasmEdge_Proposal_ExceptionHandling : WasmEdge_Proposal = 11 ; pub const WasmEdge_Proposal_ExtendedConst : WasmEdge_Proposal = 12 ; pub const WasmEdge_Proposal_Threads : WasmEdge_Proposal = 13 ; pub const WasmEdge_Proposal_FunctionReferences : WasmEdge_Proposal = 14 ; pub type WasmEdge_Proposal = :: std :: os :: raw :: c_uint ; pub const WasmEdge_HostRegistration_Wasi : WasmEdge_HostRegistration = 0 ; pub type WasmEdge_HostRegistration = :: std :: os :: raw :: c_uint ; pub const WasmEdge_CompilerOptimizationLevel_O0 : WasmEdge_CompilerOptimizationLevel = 0 ; pub const WasmEdge_CompilerOptimizationLevel_O1 : WasmEdge_CompilerOptimizationLevel = 1 ; pub const WasmEdge_CompilerOptimizationLevel_O2 : WasmEdge_CompilerOptimizationLevel = 2 ; pub const WasmEdge_CompilerOptimizationLevel_O3 : WasmEdge_CompilerOptimizationLevel = 3 ; pub const WasmEdge_CompilerOptimizationLevel_Os : WasmEdge_CompilerOptimizationLevel = 4 ; pub const WasmEdge_CompilerOptimizationLevel_Oz : WasmEdge_CompilerOptimizationLevel = 5 ; pub type WasmEdge_CompilerOptimizationLevel = :: std :: os :: raw :: c_uint ; pub const WasmEdge_CompilerOutputFormat_Native : WasmEdge_CompilerOutputFormat = 0 ; pub const WasmEdge_CompilerOutputFormat_Wasm : WasmEdge_CompilerOutputFormat = 1 ; pub type WasmEdge_CompilerOutputFormat = :: std :: os :: raw :: c_uint ; pub const WasmEdge_ErrCategory_WASM : WasmEdge_ErrCategory = 0 ; pub const WasmEdge_ErrCategory_UserLevelError : WasmEdge_ErrCategory = 1 ; pub type WasmEdge_ErrCategory = :: std :: os :: raw :: c_uint ; pub const WasmEdge_ErrCode_Success : WasmEdge_ErrCode = 0 ; pub const WasmEdge_ErrCode_Terminated : WasmEdge_ErrCode = 1 ; pub const WasmEdge_ErrCode_RuntimeError : WasmEdge_ErrCode = 2 ; pub const WasmEdge_ErrCode_CostLimitExceeded : WasmEdge_ErrCode = 3 ; pub const WasmEdge_ErrCode_WrongVMWorkflow : WasmEdge_ErrCode = 4 ; pub const WasmEdge_ErrCode_FuncNotFound : WasmEdge_ErrCode = 5 ; pub const WasmEdge_ErrCode_AOTDisabled : WasmEdge_ErrCode = 6 ; pub const WasmEdge_ErrCode_Interrupted : WasmEdge_ErrCode = 7 ; pub const WasmEdge_ErrCode_NotValidated : WasmEdge_ErrCode = 8 ; pub const WasmEdge_ErrCode_UserDefError : WasmEdge_ErrCode = 9 ; pub const WasmEdge_ErrCode_IllegalPath : WasmEdge_ErrCode = 32 ; pub const WasmEdge_ErrCode_ReadError : WasmEdge_ErrCode = 33 ; pub const WasmEdge_ErrCode_UnexpectedEnd : WasmEdge_ErrCode = 34 ; pub const WasmEdge_ErrCode_MalformedMagic : WasmEdge_ErrCode = 35 ; pub const WasmEdge_ErrCode_MalformedVersion : WasmEdge_ErrCode = 36 ; pub const WasmEdge_ErrCode_MalformedSection : WasmEdge_ErrCode = 37 ; pub const WasmEdge_ErrCode_SectionSizeMismatch : WasmEdge_ErrCode = 38 ; pub const WasmEdge_ErrCode_LengthOutOfBounds : WasmEdge_ErrCode = 39 ; pub const WasmEdge_ErrCode_JunkSection : WasmEdge_ErrCode = 40 ; pub const WasmEdge_ErrCode_IncompatibleFuncCode : WasmEdge_ErrCode = 41 ; pub const WasmEdge_ErrCode_IncompatibleDataCount : WasmEdge_ErrCode = 42 ; pub const WasmEdge_ErrCode_DataCountRequired : WasmEdge_ErrCode = 43 ; pub const WasmEdge_ErrCode_MalformedImportKind : WasmEdge_ErrCode = 44 ; pub const WasmEdge_ErrCode_MalformedExportKind : WasmEdge_ErrCode = 45 ; pub const WasmEdge_ErrCode_ExpectedZeroByte : WasmEdge_ErrCode = 46 ; pub const WasmEdge_ErrCode_InvalidMut : WasmEdge_ErrCode = 47 ; pub const WasmEdge_ErrCode_TooManyLocals : WasmEdge_ErrCode = 48 ; pub const WasmEdge_ErrCode_MalformedValType : WasmEdge_ErrCode = 49 ; pub const WasmEdge_ErrCode_MalformedElemType : WasmEdge_ErrCode = 50 ; pub const WasmEdge_ErrCode_MalformedRefType : WasmEdge_ErrCode = 51 ; pub const WasmEdge_ErrCode_MalformedUTF8 : WasmEdge_ErrCode = 52 ; pub const WasmEdge_ErrCode_IntegerTooLarge : WasmEdge_ErrCode = 53 ; pub const WasmEdge_ErrCode_IntegerTooLong : WasmEdge_ErrCode = 54 ; pub const WasmEdge_ErrCode_IllegalOpCode : WasmEdge_ErrCode = 55 ; pub const WasmEdge_ErrCode_ENDCodeExpected : WasmEdge_ErrCode = 56 ; pub const WasmEdge_ErrCode_IllegalGrammar : WasmEdge_ErrCode = 57 ; pub const WasmEdge_ErrCode_SharedMemoryNoMax : WasmEdge_ErrCode = 58 ; pub const WasmEdge_ErrCode_IntrinsicsTableNotFound : WasmEdge_ErrCode = 59 ; pub const WasmEdge_ErrCode_InvalidAlignment : WasmEdge_ErrCode = 64 ; pub const WasmEdge_ErrCode_TypeCheckFailed : WasmEdge_ErrCode = 65 ; pub const WasmEdge_ErrCode_InvalidLabelIdx : WasmEdge_ErrCode = 66 ; pub const WasmEdge_ErrCode_InvalidLocalIdx : WasmEdge_ErrCode = 67 ; pub const WasmEdge_ErrCode_InvalidFuncTypeIdx : WasmEdge_ErrCode = 68 ; pub const WasmEdge_ErrCode_InvalidFuncIdx : WasmEdge_ErrCode = 69 ; pub const WasmEdge_ErrCode_InvalidTableIdx : WasmEdge_ErrCode = 70 ; pub const WasmEdge_ErrCode_InvalidMemoryIdx : WasmEdge_ErrCode = 71 ; pub const WasmEdge_ErrCode_InvalidGlobalIdx : WasmEdge_ErrCode = 72 ; pub const WasmEdge_ErrCode_InvalidElemIdx : WasmEdge_ErrCode = 73 ; pub const WasmEdge_ErrCode_InvalidDataIdx : WasmEdge_ErrCode = 74 ; pub const WasmEdge_ErrCode_InvalidRefIdx : WasmEdge_ErrCode = 75 ; pub const WasmEdge_ErrCode_ConstExprRequired : WasmEdge_ErrCode = 76 ; pub const WasmEdge_ErrCode_DupExportName : WasmEdge_ErrCode = 77 ; pub const WasmEdge_ErrCode_ImmutableGlobal : WasmEdge_ErrCode = 78 ; pub const WasmEdge_ErrCode_InvalidResultArity : WasmEdge_ErrCode = 79 ; pub const WasmEdge_ErrCode_MultiTables : WasmEdge_ErrCode = 80 ; pub const WasmEdge_ErrCode_MultiMemories : WasmEdge_ErrCode = 81 ; pub const WasmEdge_ErrCode_InvalidLimit : WasmEdge_ErrCode = 82 ; pub const WasmEdge_ErrCode_InvalidMemPages : WasmEdge_ErrCode = 83 ; pub const WasmEdge_ErrCode_InvalidStartFunc : WasmEdge_ErrCode = 84 ; pub const WasmEdge_ErrCode_InvalidLaneIdx : WasmEdge_ErrCode = 85 ; pub const WasmEdge_ErrCode_ModuleNameConflict : WasmEdge_ErrCode = 96 ; pub const WasmEdge_ErrCode_IncompatibleImportType : WasmEdge_ErrCode = 97 ; pub const WasmEdge_ErrCode_UnknownImport : WasmEdge_ErrCode = 98 ; pub const WasmEdge_ErrCode_DataSegDoesNotFit : WasmEdge_ErrCode = 99 ; pub const WasmEdge_ErrCode_ElemSegDoesNotFit : WasmEdge_ErrCode = 100 ; pub const WasmEdge_ErrCode_WrongInstanceAddress : WasmEdge_ErrCode = 128 ; pub const WasmEdge_ErrCode_WrongInstanceIndex : WasmEdge_ErrCode = 129 ; pub const WasmEdge_ErrCode_InstrTypeMismatch : WasmEdge_ErrCode = 130 ; pub const WasmEdge_ErrCode_FuncSigMismatch : WasmEdge_ErrCode = 131 ; pub const WasmEdge_ErrCode_DivideByZero : WasmEdge_ErrCode = 132 ; pub const WasmEdge_ErrCode_IntegerOverflow : WasmEdge_ErrCode = 133 ; pub const WasmEdge_ErrCode_InvalidConvToInt : WasmEdge_ErrCode = 134 ; pub const WasmEdge_ErrCode_TableOutOfBounds : WasmEdge_ErrCode = 135 ; pub const WasmEdge_ErrCode_MemoryOutOfBounds : WasmEdge_ErrCode = 136 ; pub const WasmEdge_ErrCode_Unreachable : WasmEdge_ErrCode = 137 ; pub const WasmEdge_ErrCode_UninitializedElement : WasmEdge_ErrCode = 138 ; pub const WasmEdge_ErrCode_UndefinedElement : WasmEdge_ErrCode = 139 ; pub const WasmEdge_ErrCode_IndirectCallTypeMismatch : WasmEdge_ErrCode = 140 ; pub const WasmEdge_ErrCode_HostFuncError : WasmEdge_ErrCode = 141 ; pub const WasmEdge_ErrCode_RefTypeMismatch : WasmEdge_ErrCode = 142 ; pub const WasmEdge_ErrCode_UnalignedAtomicAccess : WasmEdge_ErrCode = 143 ; pub const WasmEdge_ErrCode_ExpectSharedMemory : WasmEdge_ErrCode = 144 ; pub type WasmEdge_ErrCode = :: std :: os :: raw :: c_uint ; pub const WasmEdge_ValType_I32 : WasmEdge_ValType = 127 ; pub const WasmEdge_ValType_I64 : WasmEdge_ValType = 126 ; pub const WasmEdge_ValType_F32 : WasmEdge_ValType = 125 ; pub const WasmEdge_ValType_F64 : WasmEdge_ValType = 124 ; pub const WasmEdge_ValType_V128 : WasmEdge_ValType = 123 ; pub const WasmEdge_ValType_FuncRef : WasmEdge_ValType = 112 ; pub const WasmEdge_ValType_ExternRef : WasmEdge_ValType = 111 ; pub type WasmEdge_ValType = :: std :: os :: raw :: c_uint ; pub const WasmEdge_NumType_I32 : WasmEdge_NumType = 127 ; pub const WasmEdge_NumType_I64 : WasmEdge_NumType = 126 ; pub const WasmEdge_NumType_F32 : WasmEdge_NumType = 125 ; pub const WasmEdge_NumType_F64 : WasmEdge_NumType = 124 ; pub const WasmEdge_NumType_V128 : WasmEdge_NumType = 123 ; pub type WasmEdge_NumType = :: std :: os :: raw :: c_uint ; pub const WasmEdge_RefType_FuncRef : WasmEdge_RefType = 112 ; pub const WasmEdge_RefType_ExternRef : WasmEdge_RefType = 111 ; pub type WasmEdge_RefType = :: std :: os :: raw :: c_uint ; pub const WasmEdge_Mutability_Const : WasmEdge_Mutability = 0 ; pub const WasmEdge_Mutability_Var : WasmEdge_Mutability = 1 ; pub type WasmEdge_Mutability = :: std :: os :: raw :: c_uint ; pub const WasmEdge_ExternalType_Function : WasmEdge_ExternalType = 0 ; pub const WasmEdge_ExternalType_Table : WasmEdge_ExternalType = 1 ; pub const WasmEdge_ExternalType_Memory : WasmEdge_ExternalType = 2 ; pub const WasmEdge_ExternalType_Global : WasmEdge_ExternalType = 3 ; pub type WasmEdge_ExternalType = :: std :: os :: raw :: c_uint ; pub type uint128_t = u128 ; pub type int128_t = i128 ; # [doc = " WasmEdge WASM value struct."] # [repr (C)] # [repr (align (16))] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_Value { pub Value : uint128_t , pub Type : WasmEdge_ValType , } # [test] fn bindgen_test_layout_WasmEdge_Value () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_Value > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_Value > () , 32usize , concat ! ("Size of: " , stringify ! (WasmEdge_Value))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_Value > () , 16usize , concat ! ("Alignment of " , stringify ! (WasmEdge_Value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Value) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Value) , "::" , stringify ! (Value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Type) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Value) , "::" , stringify ! (Type))) ; } # [doc = " WasmEdge string struct."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_String { pub Length : u32 , pub Buf : * const :: std :: os :: raw :: c_char , } # [test] fn bindgen_test_layout_WasmEdge_String () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_String > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_String > () , 16usize , concat ! ("Size of: " , stringify ! (WasmEdge_String))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_String > () , 8usize , concat ! ("Alignment of " , stringify ! (WasmEdge_String))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Length) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_String) , "::" , stringify ! (Length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Buf) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_String) , "::" , stringify ! (Buf))) ; } # [doc = " WasmEdge result struct."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_Result { pub Code : u32 , } # [test] fn bindgen_test_layout_WasmEdge_Result () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_Result > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_Result > () , 4usize , concat ! ("Size of: " , stringify ! (WasmEdge_Result))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_Result > () , 4usize , concat ! ("Alignment of " , stringify ! (WasmEdge_Result))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Code) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Result) , "::" , stringify ! (Code))) ; } # [doc = " Struct of WASM limit."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_Limit { # [doc = " Boolean to describe has max value or not."] pub HasMax : bool , # [doc = " Boolean to describe is shared memory or not."] pub Shared : bool , # [doc = " Minimum value."] pub Min : u32 , # [doc = " Maximum value. Will be ignored if the `HasMax` is false."] pub Max : u32 , } # [test] fn bindgen_test_layout_WasmEdge_Limit () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_Limit > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_Limit > () , 12usize , concat ! ("Size of: " , stringify ! (WasmEdge_Limit))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_Limit > () , 4usize , concat ! ("Alignment of " , stringify ! (WasmEdge_Limit))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . HasMax) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Limit) , "::" , stringify ! (HasMax))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Shared) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Limit) , "::" , stringify ! (Shared))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Min) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Limit) , "::" , stringify ! (Min))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Max) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_Limit) , "::" , stringify ! (Max))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ConfigureContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_StatisticsContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ASTModuleContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_FunctionTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_MemoryTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_TableTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_GlobalTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ImportTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ExportTypeContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_CompilerContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_LoaderContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ValidatorContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ExecutorContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_StoreContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ModuleInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_FunctionInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_TableInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_MemoryInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_GlobalInstanceContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_CallingFrameContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_Async { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_VMContext { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_PluginContext { _unused : [u8 ; 0] , } # [doc = " No option value."] pub const WasmEdge_ProgramOptionType_None : WasmEdge_ProgramOptionType = 0 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Toggle : WasmEdge_ProgramOptionType = 1 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Int8 : WasmEdge_ProgramOptionType = 2 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Int16 : WasmEdge_ProgramOptionType = 3 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Int32 : WasmEdge_ProgramOptionType = 4 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Int64 : WasmEdge_ProgramOptionType = 5 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_UInt8 : WasmEdge_ProgramOptionType = 6 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_UInt16 : WasmEdge_ProgramOptionType = 7 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_UInt32 : WasmEdge_ProgramOptionType = 8 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_UInt64 : WasmEdge_ProgramOptionType = 9 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Float : WasmEdge_ProgramOptionType = 10 ; # [doc = " Boolean value."] pub const WasmEdge_ProgramOptionType_Double : WasmEdge_ProgramOptionType = 11 ; # [doc = " WasmEdge_String."] pub const WasmEdge_ProgramOptionType_String : WasmEdge_ProgramOptionType = 12 ; # [doc = " Type of option value."] pub type WasmEdge_ProgramOptionType = :: std :: os :: raw :: c_uint ; # [doc = " Program option for plugins."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ProgramOption { pub Name : * const :: std :: os :: raw :: c_char , pub Description : * const :: std :: os :: raw :: c_char , pub Type : WasmEdge_ProgramOptionType , pub Storage : * mut :: std :: os :: raw :: c_void , pub DefaultValue : * const :: std :: os :: raw :: c_void , } # [test] fn bindgen_test_layout_WasmEdge_ProgramOption () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_ProgramOption > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_ProgramOption > () , 40usize , concat ! ("Size of: " , stringify ! (WasmEdge_ProgramOption))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_ProgramOption > () , 8usize , concat ! ("Alignment of " , stringify ! (WasmEdge_ProgramOption))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (Name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Description) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (Description))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Type) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (Type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Storage) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (Storage))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . DefaultValue) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ProgramOption) , "::" , stringify ! (DefaultValue))) ; } # [doc = " Module descriptor for plugins."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_ModuleDescriptor { pub Name : * const :: std :: os :: raw :: c_char , pub Description : * const :: std :: os :: raw :: c_char , pub Create : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * const WasmEdge_ModuleDescriptor) -> * mut WasmEdge_ModuleInstanceContext > , } # [test] fn bindgen_test_layout_WasmEdge_ModuleDescriptor () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_ModuleDescriptor > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_ModuleDescriptor > () , 24usize , concat ! ("Size of: " , stringify ! (WasmEdge_ModuleDescriptor))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_ModuleDescriptor > () , 8usize , concat ! ("Alignment of " , stringify ! (WasmEdge_ModuleDescriptor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ModuleDescriptor) , "::" , stringify ! (Name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Description) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ModuleDescriptor) , "::" , stringify ! (Description))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Create) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_ModuleDescriptor) , "::" , stringify ! (Create))) ; } # [doc = " Version data for plugins."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_PluginVersionData { pub Major : u32 , pub Minor : u32 , pub Patch : u32 , pub Build : u32 , } # [test] fn bindgen_test_layout_WasmEdge_PluginVersionData () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_PluginVersionData > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_PluginVersionData > () , 16usize , concat ! ("Size of: " , stringify ! (WasmEdge_PluginVersionData))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_PluginVersionData > () , 4usize , concat ! ("Alignment of " , stringify ! (WasmEdge_PluginVersionData))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Major) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginVersionData) , "::" , stringify ! (Major))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Minor) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginVersionData) , "::" , stringify ! (Minor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Patch) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginVersionData) , "::" , stringify ! (Patch))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Build) as usize - ptr as usize } , 12usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginVersionData) , "::" , stringify ! (Build))) ; } # [doc = " Plugin descriptor for plugins."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct WasmEdge_PluginDescriptor { pub Name : * const :: std :: os :: raw :: c_char , pub Description : * const :: std :: os :: raw :: c_char , pub APIVersion : u32 , pub Version : WasmEdge_PluginVersionData , pub ModuleCount : u32 , pub ProgramOptionCount : u32 , pub ModuleDescriptions : * mut WasmEdge_ModuleDescriptor , pub ProgramOptions : * mut WasmEdge_ProgramOption , } # [test] fn bindgen_test_layout_WasmEdge_PluginDescriptor () { const UNINIT : :: std :: mem :: MaybeUninit < WasmEdge_PluginDescriptor > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < WasmEdge_PluginDescriptor > () , 64usize , concat ! ("Size of: " , stringify ! (WasmEdge_PluginDescriptor))) ; assert_eq ! (:: std :: mem :: align_of :: < WasmEdge_PluginDescriptor > () , 8usize , concat ! ("Alignment of " , stringify ! (WasmEdge_PluginDescriptor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (Name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Description) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (Description))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . APIVersion) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (APIVersion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . Version) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (Version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ModuleCount) as usize - ptr as usize } , 36usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (ModuleCount))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ProgramOptionCount) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (ProgramOptionCount))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ModuleDescriptions) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (ModuleDescriptions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ProgramOptions) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (WasmEdge_PluginDescriptor) , "::" , stringify ! (ProgramOptions))) ; } extern "C" { # [doc = " Get the version string of the WasmEdge C API.\n\n The returned string must __NOT__ be destroyed.\n\n \\returns NULL-terminated C string of version."] pub fn WasmEdge_VersionGet () -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [doc = " Get the major version value of the WasmEdge C API.\n\n \\returns Value of the major version."] pub fn WasmEdge_VersionGetMajor () -> u32 ; } extern "C" { # [doc = " Get the minor version value of the WasmEdge C API.\n\n \\returns Value of the minor version."] pub fn WasmEdge_VersionGetMinor () -> u32 ; } extern "C" { # [doc = " Get the patch version value of the WasmEdge C API.\n\n \\returns Value of the patch version."] pub fn WasmEdge_VersionGetPatch () -> u32 ; } extern "C" { # [doc = " Set the logging system to filter to error level."] pub fn WasmEdge_LogSetErrorLevel () ; } extern "C" { # [doc = " Set the logging system to filter to debug level."] pub fn WasmEdge_LogSetDebugLevel () ; } extern "C" { # [doc = " Set the logging system off."] pub fn WasmEdge_LogOff () ; } extern "C" { # [doc = " Generate the I32 WASM value.\n\n \\param Val the I32 value.\n\n \\returns WasmEdge_Value struct with the I32 value."] pub fn WasmEdge_ValueGenI32 (Val : i32) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the I64 WASM value.\n\n \\param Val the I64 value.\n\n \\returns WasmEdge_Value struct with the I64 value."] pub fn WasmEdge_ValueGenI64 (Val : i64) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the F32 WASM value.\n\n \\param Val the F32 value.\n\n \\returns WasmEdge_Value struct with the F32 value."] pub fn WasmEdge_ValueGenF32 (Val : f32) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the F64 WASM value.\n\n \\param Val the F64 value.\n\n \\returns WasmEdge_Value struct with the F64 value."] pub fn WasmEdge_ValueGenF64 (Val : f64) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the V128 WASM value.\n\n \\param Val the V128 value.\n\n \\returns WasmEdge_Value struct with the V128 value."] pub fn WasmEdge_ValueGenV128 (Val : int128_t) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the NULL reference WASM value.\n\n The values generated by this function are only meaningful when the\n `WasmEdge_Proposal_BulkMemoryOperations` or the\n `WasmEdge_Proposal_ReferenceTypes` turns on in configuration.\n\n \\param T the reference type.\n\n \\returns WasmEdge_Value struct with the NULL reference."] pub fn WasmEdge_ValueGenNullRef (T : WasmEdge_RefType) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the function reference WASM value.\n\n The values generated by this function are only meaningful when the\n `WasmEdge_Proposal_BulkMemoryOperations` or the\n `WasmEdge_Proposal_ReferenceTypes` turns on in configuration.\n\n \\param Cxt the function instance context to convert to the reference.\n\n \\returns WasmEdge_Value struct with the function reference."] pub fn WasmEdge_ValueGenFuncRef (Cxt : * const WasmEdge_FunctionInstanceContext) -> WasmEdge_Value ; } extern "C" { # [doc = " Generate the function reference WASM value.\n\n The values generated by this function are only meaningful when the\n `WasmEdge_Proposal_ReferenceTypes` turns on in configuration.\n\n \\param Ref the reference to the external object.\n\n \\returns WasmEdge_Value struct with the external reference."] pub fn WasmEdge_ValueGenExternRef (Ref : * mut :: std :: os :: raw :: c_void) -> WasmEdge_Value ; } extern "C" { # [doc = " Retrieve the I32 value from the WASM value.\n\n \\param Val the WasmEdge_Value struct.\n\n \\returns I32 value in the input struct."] pub fn WasmEdge_ValueGetI32 (Val : WasmEdge_Value) -> i32 ; } extern "C" { # [doc = " Retrieve the I64 value from the WASM value.\n\n \\param Val the WasmEdge_Value struct.\n\n \\returns I64 value in the input struct."] pub fn WasmEdge_ValueGetI64 (Val : WasmEdge_Value) -> i64 ; } extern "C" { # [doc = " Retrieve the F32 value from the WASM value.\n\n \\param Val the WasmEdge_Value struct.\n\n \\returns F32 value in the input struct."] pub fn WasmEdge_ValueGetF32 (Val : WasmEdge_Value) -> f32 ; } extern "C" { # [doc = " Retrieve the F64 value from the WASM value.\n\n \\param Val the WasmEdge_Value struct.\n\n \\returns F64 value in the input struct."] pub fn WasmEdge_ValueGetF64 (Val : WasmEdge_Value) -> f64 ; } extern "C" { # [doc = " Retrieve the V128 value from the WASM value.\n\n \\param Val the WasmEdge_Value struct.\n\n \\returns V128 value in the input struct."] pub fn WasmEdge_ValueGetV128 (Val : WasmEdge_Value) -> int128_t ; } extern "C" { # [doc = " Specify the WASM value is a null reference or not.\n\n \\param Val the WasmEdge_Value struct.\n\n \\returns true if the value is a null reference, false if not."] pub fn WasmEdge_ValueIsNullRef (Val : WasmEdge_Value) -> bool ; } extern "C" { # [doc = " Retrieve the function instance context from the WASM value.\n\n \\param Val the WasmEdge_Value struct.\n\n \\returns pointer to function instance context in the input struct."] pub fn WasmEdge_ValueGetFuncRef (Val : WasmEdge_Value) -> * const WasmEdge_FunctionInstanceContext ; } extern "C" { # [doc = " Retrieve the external reference from the WASM value.\n\n \\param Val the WasmEdge_Value struct.\n\n \\returns external reference in the input struct."] pub fn WasmEdge_ValueGetExternRef (Val : WasmEdge_Value) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { # [doc = " Creation of the WasmEdge_String with the C string.\n\n The caller owns the object and should call `WasmEdge_StringDelete` to\n destroy it. This function only supports the C string with NULL termination.\n If the input string may have `\\0` character, please use the\n `WasmEdge_StringCreateByBuffer` instead.\n\n \\param Str the NULL-terminated C string to copy into the WasmEdge_String\n object.\n\n \\returns string object. Length will be 0 and Buf will be NULL if failed or\n the input string is a NULL."] pub fn WasmEdge_StringCreateByCString (Str : * const :: std :: os :: raw :: c_char) -> WasmEdge_String ; } extern "C" { # [doc = " Creation of the WasmEdge_String with the buffer and its length.\n\n The caller owns the object and should call `WasmEdge_StringDelete` to\n destroy it.\n\n \\param Buf the buffer to copy into the WasmEdge_String object.\n \\param Len the buffer length.\n\n \\returns string object. Length will be 0 and Buf will be NULL if failed or\n the input buffer is a NULL."] pub fn WasmEdge_StringCreateByBuffer (Buf : * const :: std :: os :: raw :: c_char , Len : u32) -> WasmEdge_String ; } extern "C" { # [doc = " Create the WasmEdge_String wraps to the buffer.\n\n This function creates a `WasmEdge_String` object which wraps to the input\n buffer. The caller should guarantee the life cycle of the input buffer, and\n should __NOT__ call the `WasmEdge_StringDelete`.\n\n \\param Buf the buffer to copy into the WasmEdge_String object.\n \\param Len the buffer length.\n\n \\returns string object refer to the input buffer with its length."] pub fn WasmEdge_StringWrap (Buf : * const :: std :: os :: raw :: c_char , Len : u32) -> WasmEdge_String ; } extern "C" { # [doc = " Compare the two WasmEdge_String objects.\n\n \\param Str1 the first WasmEdge_String object to compare.\n \\param Str2 the second WasmEdge_String object to compare.\n\n \\returns true if the content of two WasmEdge_String objects are the same,\n false if not."] pub fn WasmEdge_StringIsEqual (Str1 : WasmEdge_String , Str2 : WasmEdge_String) -> bool ; } extern "C" { # [doc = " Copy the content of WasmEdge_String object to the buffer.\n\n This function copy at most `Len` characters from the `WasmEdge_String`\n object to the destination buffer. If the string length is less than `Len`\n characters long, the remainder of the buffer is filled with `\\0' characters.\n Otherwise, the destination is not terminated.\n\n \\param Str the source WasmEdge_String object to copy.\n \\param Buf the buffer to fill the string content.\n \\param Len the buffer length.\n\n \\returns the copied length of string."] pub fn WasmEdge_StringCopy (Str : WasmEdge_String , Buf : * mut :: std :: os :: raw :: c_char , Len : u32) -> u32 ; } extern "C" { # [doc = " Deletion of the WasmEdge_String.\n\n After calling this function, the resources in the WasmEdge_String object\n will be released and the object should __NOT__ be used.\n\n \\param Str the WasmEdge_String object to destroy."] pub fn WasmEdge_StringDelete (Str : WasmEdge_String) ; } extern "C" { # [doc = " Check the result is a success or not.\n\n \\param Res the WasmEdge_Result struct.\n\n \\returns true if the error code is WasmEdge_Result_Success or\n WasmEdge_Result_Terminate, false for others."] pub fn WasmEdge_ResultOK (Res : WasmEdge_Result) -> bool ; } extern "C" { # [doc = " Generate the result with code.\n\n \\param Category the WasmEdge_ErrCategory to specify the error category.\n \\param Code the 24-bit length error code. The data exceeds 24 bits will be\n stripped.\n\n \\returns WasmEdge_Result struct with the given data."] pub fn WasmEdge_ResultGen (Category : WasmEdge_ErrCategory , Code : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Get the result code.\n\n \\param Res the WasmEdge_Result struct.\n\n \\returns result code (24-bit size data) in the WasmEdge_Result struct."] pub fn WasmEdge_ResultGetCode (Res : WasmEdge_Result) -> u32 ; } extern "C" { # [doc = " Get the error category.\n\n \\param Res the WasmEdge_Result struct.\n\n \\returns error category in the WasmEdge_Result struct."] pub fn WasmEdge_ResultGetCategory (Res : WasmEdge_Result) -> WasmEdge_ErrCategory ; } extern "C" { # [doc = " Get the result message.\n\n The returned string must __NOT__ be destroyed.\n If the error category of the result is __NOT__ `WasmEdge_ErrCategory_WASM`,\n the message will always be \"user defined error code\".\n\n \\param Res the WasmEdge_Result struct.\n\n \\returns NULL-terminated C string of the corresponding error message."] pub fn WasmEdge_ResultGetMessage (Res : WasmEdge_Result) -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [doc = " Compare the two WasmEdge_Limit objects.\n\n \\param Lim1 the first WasmEdge_Limit object to compare.\n \\param Lim2 the second WasmEdge_Limit object to compare.\n\n \\returns true if the content of two WasmEdge_Limit objects are the same,\n false if not."] pub fn WasmEdge_LimitIsEqual (Lim1 : WasmEdge_Limit , Lim2 : WasmEdge_Limit) -> bool ; } extern "C" { # [doc = " Creation of the WasmEdge_ConfigureContext.\n\n The caller owns the object and should call `WasmEdge_ConfigureDelete` to\n destroy it.\n\n \\returns pointer to the context, NULL if failed."] pub fn WasmEdge_ConfigureCreate () -> * mut WasmEdge_ConfigureContext ; } extern "C" { # [doc = " Add a proposal setting into the WasmEdge_ConfigureContext.\n\n For turning on a specific WASM proposal in VM, loader, or compiler contexts,\n etc., you can set the proposal value into the WasmEdge_ConfigureContext and\n create the VM, loader, or compiler contexts, etc. with this context.\n\n ```c\n WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();\n WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_BulkMemoryOperations);\n WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_ReferenceTypes);\n WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_SIMD);\n WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);\n ```\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to add the proposal value.\n \\param Prop the proposal value."] pub fn WasmEdge_ConfigureAddProposal (Cxt : * mut WasmEdge_ConfigureContext , Prop : WasmEdge_Proposal) ; } extern "C" { # [doc = " Remove a proposal setting in the WasmEdge_ConfigureContext.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to remove the proposal.\n \\param Prop the proposal value."] pub fn WasmEdge_ConfigureRemoveProposal (Cxt : * mut WasmEdge_ConfigureContext , Prop : WasmEdge_Proposal) ; } extern "C" { # [doc = " Check if a proposal setting exists in the WasmEdge_ConfigureContext or not.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to check the proposal value.\n \\param Prop the proposal value.\n\n \\returns true if the proposal setting exists, false if not."] pub fn WasmEdge_ConfigureHasProposal (Cxt : * const WasmEdge_ConfigureContext , Prop : WasmEdge_Proposal) -> bool ; } extern "C" { # [doc = " Add a built-in host registration setting into WasmEdge_ConfigureContext.\n\n For turning on the Wasi support in `WasmEdge_VMContext`, you can set the\n built-in host registration value into the `WasmEdge_ConfigureContext` and\n create VM with this context.\n\n ```c\n WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();\n WasmEdge_ConfigureAddHostRegistration(Conf, WasmEdge_HostRegistration_Wasi);\n WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);\n ```\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to add built-in host registration.\n \\param Host the built-in host registration value."] pub fn WasmEdge_ConfigureAddHostRegistration (Cxt : * mut WasmEdge_ConfigureContext , Host : WasmEdge_HostRegistration) ; } extern "C" { # [doc = " Remove a built-in host registration setting in the\n WasmEdge_ConfigureContext.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to remove the host\n pre-registration.\n \\param Host the built-in host registration value."] pub fn WasmEdge_ConfigureRemoveHostRegistration (Cxt : * mut WasmEdge_ConfigureContext , Host : WasmEdge_HostRegistration) ; } extern "C" { # [doc = " Check if a built-in host registration setting exists in the\n WasmEdge_ConfigureContext or not.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to check the host pre-registration.\n \\param Host the built-in host registration value.\n\n \\returns true if the built-in host registration setting exists, false if\n not."] pub fn WasmEdge_ConfigureHasHostRegistration (Cxt : * const WasmEdge_ConfigureContext , Host : WasmEdge_HostRegistration) -> bool ; } extern "C" { # [doc = " Set the page limit of memory instances.\n\n Limit the page count (64KiB per page) in memory instances.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the maximum page count.\n \\param Page the maximum page count."] pub fn WasmEdge_ConfigureSetMaxMemoryPage (Cxt : * mut WasmEdge_ConfigureContext , Page : u32) ; } extern "C" { # [doc = " Get the setting of the page limit of memory instances.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the maximum page count\n setting.\n\n \\returns the page count limitation value."] pub fn WasmEdge_ConfigureGetMaxMemoryPage (Cxt : * const WasmEdge_ConfigureContext) -> u32 ; } extern "C" { # [doc = " Set the force interpreter mode execution option.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the boolean value.\n \\param IsForceInterpreter the boolean value to determine to forcibly run\n WASM in interpreter mode or not."] pub fn WasmEdge_ConfigureSetForceInterpreter (Cxt : * mut WasmEdge_ConfigureContext , IsForceInterpreter : bool) ; } extern "C" { # [doc = " Get the force interpreter mode execution option.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the boolean value.\n\n \\returns the boolean value to determine to forcibly run WASM in interpreter\n mode or not."] pub fn WasmEdge_ConfigureIsForceInterpreter (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the option of enabling/disabling AF_UNIX support in the WASI socket.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the boolean value.\n \\param EnableAFUNIX the boolean value to determine to enable\n the AF_UNIX support in the WASI socket or not."] pub fn WasmEdge_ConfigureSetAllowAFUNIX (Cxt : * mut WasmEdge_ConfigureContext , EnableAFUNIX : bool) ; } extern "C" { # [doc = " Get the AllowAFUNIX option.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the boolean value.\n\n \\returns the boolean value to determine to enable AF_UNIX support in the\n WASI socket or not."] pub fn WasmEdge_ConfigureIsAllowAFUNIX (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the optimization level of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the optimization level.\n \\param Level the AOT compiler optimization level."] pub fn WasmEdge_ConfigureCompilerSetOptimizationLevel (Cxt : * mut WasmEdge_ConfigureContext , Level : WasmEdge_CompilerOptimizationLevel) ; } extern "C" { # [doc = " Get the optimization level of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the optimization level.\n\n \\returns the AOT compiler optimization level."] pub fn WasmEdge_ConfigureCompilerGetOptimizationLevel (Cxt : * const WasmEdge_ConfigureContext) -> WasmEdge_CompilerOptimizationLevel ; } extern "C" { # [doc = " Set the output binary format of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the output binary format.\n \\param Format the AOT compiler output binary format."] pub fn WasmEdge_ConfigureCompilerSetOutputFormat (Cxt : * mut WasmEdge_ConfigureContext , Format : WasmEdge_CompilerOutputFormat) ; } extern "C" { # [doc = " Get the output binary format of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the output binary format.\n\n \\returns the AOT compiler output binary format."] pub fn WasmEdge_ConfigureCompilerGetOutputFormat (Cxt : * const WasmEdge_ConfigureContext) -> WasmEdge_CompilerOutputFormat ; } extern "C" { # [doc = " Set the dump IR option of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the boolean value.\n \\param IsDump the boolean value to determine to dump IR or not when\n compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerSetDumpIR (Cxt : * mut WasmEdge_ConfigureContext , IsDump : bool) ; } extern "C" { # [doc = " Get the dump IR option of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the boolean value.\n\n \\returns the boolean value to determine to dump IR or not when compilation\n in AOT compiler."] pub fn WasmEdge_ConfigureCompilerIsDumpIR (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the generic binary option of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the boolean value.\n \\param IsGeneric the boolean value to determine to generate the generic\n binary or not when compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerSetGenericBinary (Cxt : * mut WasmEdge_ConfigureContext , IsGeneric : bool) ; } extern "C" { # [doc = " Get the generic binary option of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the boolean value.\n\n \\returns the boolean value to determine to generate the generic binary or\n not when compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerIsGenericBinary (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the interruptible option of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the boolean value.\n \\param IsInterruptible the boolean value to determine to generate\n interruptible binary or not when compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerSetInterruptible (Cxt : * mut WasmEdge_ConfigureContext , IsInterruptible : bool) ; } extern "C" { # [doc = " Get the interruptible option of the AOT compiler.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the boolean value.\n\n \\returns the boolean value to determine to generate interruptible binary or\n not when compilation in AOT compiler."] pub fn WasmEdge_ConfigureCompilerIsInterruptible (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the instruction counting option for the statistics.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the boolean value.\n \\param IsCount the boolean value to determine to support instruction\n counting when execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsSetInstructionCounting (Cxt : * mut WasmEdge_ConfigureContext , IsCount : bool) ; } extern "C" { # [doc = " Get the instruction counting option for the statistics.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the boolean value.\n\n \\returns the boolean value to determine to support instruction counting when\n execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsIsInstructionCounting (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the cost measuring option for the statistics.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the boolean value.\n \\param IsMeasure the boolean value to determine to support cost measuring\n when execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsSetCostMeasuring (Cxt : * mut WasmEdge_ConfigureContext , IsMeasure : bool) ; } extern "C" { # [doc = " Get the cost measuring option for the statistics.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the boolean value.\n\n \\returns the boolean value to determine to support cost measuring when\n execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsIsCostMeasuring (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Set the time measuring option for the statistics.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to set the boolean value.\n \\param IsMeasure the boolean value to determine to support time when\n execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsSetTimeMeasuring (Cxt : * mut WasmEdge_ConfigureContext , IsMeasure : bool) ; } extern "C" { # [doc = " Get the time measuring option for the statistics.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to get the boolean value.\n\n \\returns the boolean value to determine to support time measuring when\n execution or not after compilation by the AOT compiler."] pub fn WasmEdge_ConfigureStatisticsIsTimeMeasuring (Cxt : * const WasmEdge_ConfigureContext) -> bool ; } extern "C" { # [doc = " Deletion of the WasmEdge_ConfigureContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ConfigureContext to destroy."] pub fn WasmEdge_ConfigureDelete (Cxt : * mut WasmEdge_ConfigureContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_StatisticsContext.\n\n The caller owns the object and should call `WasmEdge_StatisticsDelete` to\n destroy it.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_StatisticsCreate () -> * mut WasmEdge_StatisticsContext ; } extern "C" { # [doc = " Get the instruction count in execution.\n\n \\param Cxt the WasmEdge_StatisticsContext to get data.\n\n \\returns the instruction count in total execution."] pub fn WasmEdge_StatisticsGetInstrCount (Cxt : * const WasmEdge_StatisticsContext) -> u64 ; } extern "C" { # [doc = " Get the instruction count per second in execution.\n\n \\param Cxt the WasmEdge_StatisticsContext to get data.\n\n \\returns the instruction count per second."] pub fn WasmEdge_StatisticsGetInstrPerSecond (Cxt : * const WasmEdge_StatisticsContext) -> f64 ; } extern "C" { # [doc = " Get the total cost in execution.\n\n \\param Cxt the WasmEdge_StatisticsContext to get data.\n\n \\returns the total cost."] pub fn WasmEdge_StatisticsGetTotalCost (Cxt : * const WasmEdge_StatisticsContext) -> u64 ; } extern "C" { # [doc = " Set the costs of instructions.\n\n \\param Cxt the WasmEdge_StatisticsContext to set the cost table.\n \\param CostArr the cost table array.\n \\param Len the length of the cost table array."] pub fn WasmEdge_StatisticsSetCostTable (Cxt : * mut WasmEdge_StatisticsContext , CostArr : * mut u64 , Len : u32) ; } extern "C" { # [doc = " Set the cost limit in execution.\n\n The WASM execution will be aborted if the instruction costs exceeded the\n limit and the ErrCode::Value::CostLimitExceeded will be returned.\n\n \\param Cxt the WasmEdge_StatisticsContext to set the cost table.\n \\param Limit the cost limit."] pub fn WasmEdge_StatisticsSetCostLimit (Cxt : * mut WasmEdge_StatisticsContext , Limit : u64) ; } extern "C" { # [doc = " Clear all data in the WasmEdge_StatisticsContext.\n\n \\param Cxt the WasmEdge_StatisticsContext to clear."] pub fn WasmEdge_StatisticsClear (Cxt : * mut WasmEdge_StatisticsContext) ; } extern "C" { # [doc = " Deletion of the WasmEdge_StatisticsContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_StatisticsContext to destroy."] pub fn WasmEdge_StatisticsDelete (Cxt : * mut WasmEdge_StatisticsContext) ; } extern "C" { # [doc = " Get the length of imports list of the AST module.\n\n \\param Cxt the WasmEdge_ASTModuleContext.\n\n \\returns length of the imports list."] pub fn WasmEdge_ASTModuleListImportsLength (Cxt : * const WasmEdge_ASTModuleContext) -> u32 ; } extern "C" { # [doc = " List the imports of the AST module.\n\n If the `Imports` buffer length is smaller than the result of the imports\n list size, the overflowed return values will be discarded.\n\n \\param Cxt the WasmEdge_ASTModuleContext.\n \\param [out] Imports the import type contexts buffer. Can be NULL if import\n types are not needed.\n \\param Len the buffer length.\n\n \\returns actual exported function list size."] pub fn WasmEdge_ASTModuleListImports (Cxt : * const WasmEdge_ASTModuleContext , Imports : * mut * const WasmEdge_ImportTypeContext , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the length of exports list of the AST module.\n\n \\param Cxt the WasmEdge_ASTModuleContext.\n\n \\returns length of the exports list."] pub fn WasmEdge_ASTModuleListExportsLength (Cxt : * const WasmEdge_ASTModuleContext) -> u32 ; } extern "C" { # [doc = " List the exports of the AST module.\n\n If the `Exports` buffer length is smaller than the result of the exports\n list size, the overflowed return values will be discarded.\n\n \\param Cxt the WasmEdge_ASTModuleContext.\n \\param [out] Exports the export type contexts buffer. Can be NULL if export\n types are not needed.\n \\param Len the buffer length.\n\n \\returns actual exported function list size."] pub fn WasmEdge_ASTModuleListExports (Cxt : * const WasmEdge_ASTModuleContext , Exports : * mut * const WasmEdge_ExportTypeContext , Len : u32) -> u32 ; } extern "C" { # [doc = " Deletion of the WasmEdge_ASTModuleContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_ASTModuleContext to destroy."] pub fn WasmEdge_ASTModuleDelete (Cxt : * mut WasmEdge_ASTModuleContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_FunctionTypeContext.\n\n The caller owns the object and should call `WasmEdge_FunctionTypeDelete` to\n destroy it.\n\n \\param ParamList the value types list of parameters. NULL if the length is\n 0.\n \\param ParamLen the ParamList buffer length.\n \\param ReturnList the value types list of returns. NULL if the length is 0.\n \\param ReturnLen the ReturnList buffer length.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_FunctionTypeCreate (ParamList : * const WasmEdge_ValType , ParamLen : u32 , ReturnList : * const WasmEdge_ValType , ReturnLen : u32) -> * mut WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Get the parameter types list length from the WasmEdge_FunctionTypeContext.\n\n \\param Cxt the WasmEdge_FunctionTypeContext.\n\n \\returns the parameter types list length."] pub fn WasmEdge_FunctionTypeGetParametersLength (Cxt : * const WasmEdge_FunctionTypeContext) -> u32 ; } extern "C" { # [doc = " Get the parameter types list from the WasmEdge_FunctionTypeContext.\n\n If the `List` buffer length is smaller than the length of the parameter type\n list, the overflowed values will be discarded.\n\n \\param Cxt the WasmEdge_FunctionTypeContext.\n \\param [out] List the WasmEdge_ValType buffer to fill the parameter value\n types.\n \\param Len the value type buffer length.\n\n \\returns the actual parameter types list length."] pub fn WasmEdge_FunctionTypeGetParameters (Cxt : * const WasmEdge_FunctionTypeContext , List : * mut WasmEdge_ValType , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the return types list length from the WasmEdge_FunctionTypeContext.\n\n \\param Cxt the WasmEdge_FunctionTypeContext.\n\n \\returns the return types list length."] pub fn WasmEdge_FunctionTypeGetReturnsLength (Cxt : * const WasmEdge_FunctionTypeContext) -> u32 ; } extern "C" { # [doc = " Get the return types list from the WasmEdge_FunctionTypeContext.\n\n If the `List` buffer length is smaller than the length of the return type\n list, the overflowed values will be discarded.\n\n \\param Cxt the WasmEdge_FunctionTypeContext.\n \\param [out] List the WasmEdge_ValType buffer to fill the return value\n types.\n \\param Len the value type buffer length.\n\n \\returns the actual return types list length."] pub fn WasmEdge_FunctionTypeGetReturns (Cxt : * const WasmEdge_FunctionTypeContext , List : * mut WasmEdge_ValType , Len : u32) -> u32 ; } extern "C" { # [doc = " Deletion of the WasmEdge_FunctionTypeContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_FunctionTypeContext to destroy."] pub fn WasmEdge_FunctionTypeDelete (Cxt : * mut WasmEdge_FunctionTypeContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_TableTypeContext.\n\n The caller owns the object and should call `WasmEdge_TableTypeDelete` to\n destroy it.\n\n \\param RefType the reference type of the table type.\n \\param Limit the limit struct of the table type.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_TableTypeCreate (RefType : WasmEdge_RefType , Limit : WasmEdge_Limit) -> * mut WasmEdge_TableTypeContext ; } extern "C" { # [doc = " Get the reference type from a table type.\n\n \\param Cxt the WasmEdge_TableTypeContext.\n\n \\returns the reference type of the table type."] pub fn WasmEdge_TableTypeGetRefType (Cxt : * const WasmEdge_TableTypeContext) -> WasmEdge_RefType ; } extern "C" { # [doc = " Get the limit from a table type.\n\n \\param Cxt the WasmEdge_TableTypeContext.\n\n \\returns the limit struct of the table type."] pub fn WasmEdge_TableTypeGetLimit (Cxt : * const WasmEdge_TableTypeContext) -> WasmEdge_Limit ; } extern "C" { # [doc = " Deletion of the WasmEdge_TableTypeContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_TableTypeContext to destroy."] pub fn WasmEdge_TableTypeDelete (Cxt : * mut WasmEdge_TableTypeContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_MemoryTypeContext.\n\n The caller owns the object and should call `WasmEdge_MemoryTypeDelete` to\n destroy it.\n\n \\param Limit the limit struct of the memory type.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_MemoryTypeCreate (Limit : WasmEdge_Limit) -> * mut WasmEdge_MemoryTypeContext ; } extern "C" { # [doc = " Get the limit from a memory type.\n\n \\param Cxt the WasmEdge_MemoryTypeContext.\n\n \\returns the limit struct of the memory type."] pub fn WasmEdge_MemoryTypeGetLimit (Cxt : * const WasmEdge_MemoryTypeContext) -> WasmEdge_Limit ; } extern "C" { # [doc = " Deletion of the WasmEdge_MemoryTypeContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_MemoryTypeContext to destroy."] pub fn WasmEdge_MemoryTypeDelete (Cxt : * mut WasmEdge_MemoryTypeContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_GlobalTypeContext.\n\n The caller owns the object and should call `WasmEdge_GlobalTypeDelete` to\n destroy it.\n\n \\param ValType the value type of the global type.\n \\param Mut the mutation of the global type.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_GlobalTypeCreate (ValType : WasmEdge_ValType , Mut : WasmEdge_Mutability) -> * mut WasmEdge_GlobalTypeContext ; } extern "C" { # [doc = " Get the value type from a global type.\n\n \\param Cxt the WasmEdge_GlobalTypeContext.\n\n \\returns the value type of the global type."] pub fn WasmEdge_GlobalTypeGetValType (Cxt : * const WasmEdge_GlobalTypeContext) -> WasmEdge_ValType ; } extern "C" { # [doc = " Get the mutability from a global type.\n\n \\param Cxt the WasmEdge_GlobalTypeContext.\n\n \\returns the mutability of the global type."] pub fn WasmEdge_GlobalTypeGetMutability (Cxt : * const WasmEdge_GlobalTypeContext) -> WasmEdge_Mutability ; } extern "C" { # [doc = " Deletion of the WasmEdge_GlobalTypeContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_GlobalTypeContext to destroy."] pub fn WasmEdge_GlobalTypeDelete (Cxt : * mut WasmEdge_GlobalTypeContext) ; } extern "C" { # [doc = " Get the external type from an import type.\n\n \\param Cxt the WasmEdge_ImportTypeContext.\n\n \\returns the external type of the import type."] pub fn WasmEdge_ImportTypeGetExternalType (Cxt : * const WasmEdge_ImportTypeContext) -> WasmEdge_ExternalType ; } extern "C" { # [doc = " Get the module name from an import type.\n\n The returned string object is linked to the module name of the import type,\n and the caller should __NOT__ call the `WasmEdge_StringDelete`.\n\n \\param Cxt the WasmEdge_ImportTypeContext.\n\n \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_ImportTypeGetModuleName (Cxt : * const WasmEdge_ImportTypeContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the external name from an import type.\n\n The returned string object is linked to the external name of the import\n type, and the caller should __NOT__ call the `WasmEdge_StringDelete`.\n\n \\param Cxt the WasmEdge_ImportTypeContext.\n\n \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_ImportTypeGetExternalName (Cxt : * const WasmEdge_ImportTypeContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the external value (which is function type) from an import type.\n\n The import type context should be the one queried from the AST module\n context, or this function will cause unexpected error.\n The function type context links to the function type in the import type\n context and the AST module context. The caller should __NOT__ call the\n `WasmEdge_FunctionTypeDelete`.\n\n \\param ASTCxt the WasmEdge_ASTModuleContext.\n \\param Cxt the WasmEdge_ImportTypeContext which queried from the `ASTCxt`.\n\n \\returns the function type. NULL if failed or the external type of the\n import type is not `WasmEdge_ExternalType_Function`."] pub fn WasmEdge_ImportTypeGetFunctionType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ImportTypeContext) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Get the external value (which is table type) from an import type.\n\n The import type context should be the one queried from the AST module\n context, or this function will cause unexpected error.\n The table type context links to the table type in the import type context\n and the AST module context. The caller should __NOT__ call the\n `WasmEdge_TableTypeDelete`.\n\n \\param ASTCxt the WasmEdge_ASTModuleContext.\n \\param Cxt the WasmEdge_ImportTypeContext which queried from the `ASTCxt`.\n\n \\returns the table type. NULL if failed or the external type of the import\n type is not `WasmEdge_ExternalType_Table`."] pub fn WasmEdge_ImportTypeGetTableType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ImportTypeContext) -> * const WasmEdge_TableTypeContext ; } extern "C" { # [doc = " Get the external value (which is memory type) from an import type.\n\n The import type context should be the one queried from the AST module\n context, or this function will cause unexpected error.\n The memory type context links to the memory type in the import type context\n and the AST module context. The caller should __NOT__ call the\n `WasmEdge_MemoryTypeDelete`.\n\n \\param ASTCxt the WasmEdge_ASTModuleContext.\n \\param Cxt the WasmEdge_ImportTypeContext which queried from the `ASTCxt`.\n\n \\returns the memory type. NULL if failed or the external type of the import\n type is not `WasmEdge_ExternalType_Memory`."] pub fn WasmEdge_ImportTypeGetMemoryType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ImportTypeContext) -> * const WasmEdge_MemoryTypeContext ; } extern "C" { # [doc = " Get the external value (which is global type) from an import type.\n\n The import type context should be the one queried from the AST module\n context, or this function will cause unexpected error.\n The global type context links to the global type in the import type context\n and the AST module context. The caller should __NOT__ call the\n `WasmEdge_GlobalTypeDelete`.\n\n \\param ASTCxt the WasmEdge_ASTModuleContext.\n \\param Cxt the WasmEdge_ImportTypeContext which queried from the `ASTCxt`.\n\n \\returns the global type. NULL if failed or the external type of the import\n type is not `WasmEdge_ExternalType_Global`."] pub fn WasmEdge_ImportTypeGetGlobalType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ImportTypeContext) -> * const WasmEdge_GlobalTypeContext ; } extern "C" { # [doc = " Get the external type from an export type.\n\n \\param Cxt the WasmEdge_ExportTypeContext.\n\n \\returns the external type of the export type."] pub fn WasmEdge_ExportTypeGetExternalType (Cxt : * const WasmEdge_ExportTypeContext) -> WasmEdge_ExternalType ; } extern "C" { # [doc = " Get the external name from an export type.\n\n The returned string object is linked to the external name of the export\n type, and the caller should __NOT__ call the `WasmEdge_StringDelete`.\n\n \\param Cxt the WasmEdge_ExportTypeContext.\n\n \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_ExportTypeGetExternalName (Cxt : * const WasmEdge_ExportTypeContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the external value (which is function type) from an export type.\n\n The export type context should be the one queried from the AST module\n context, or this function will cause unexpected error.\n The function type context links to the function type in the export type\n context and the AST module context. The caller should __NOT__ call the\n `WasmEdge_FunctionTypeDelete`.\n\n \\param ASTCxt the WasmEdge_ASTModuleContext.\n \\param Cxt the WasmEdge_ExportTypeContext which queried from the `ASTCxt`.\n\n \\returns the function type. NULL if failed or the external type of the\n export type is not `WasmEdge_ExternalType_Function`."] pub fn WasmEdge_ExportTypeGetFunctionType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ExportTypeContext) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Get the external value (which is table type) from an export type.\n\n The export type context should be the one queried from the AST module\n context, or this function will cause unexpected error.\n The table type context links to the table type in the export type context\n and the AST module context. The caller should __NOT__ call the\n `WasmEdge_TableTypeDelete`.\n\n \\param ASTCxt the WasmEdge_ASTModuleContext.\n \\param Cxt the WasmEdge_ExportTypeContext which queried from the `ASTCxt`.\n\n \\returns the table type. NULL if failed or the external type of the export\n type is not `WasmEdge_ExternalType_Table`."] pub fn WasmEdge_ExportTypeGetTableType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ExportTypeContext) -> * const WasmEdge_TableTypeContext ; } extern "C" { # [doc = " Get the external value (which is memory type) from an export type.\n\n The export type context should be the one queried from the AST module\n context, or this function will cause unexpected error.\n The memory type context links to the memory type in the export type context\n and the AST module context. The caller should __NOT__ call the\n `WasmEdge_MemoryTypeDelete`.\n\n \\param ASTCxt the WasmEdge_ASTModuleContext.\n \\param Cxt the WasmEdge_ExportTypeContext which queried from the `ASTCxt`.\n\n \\returns the memory type. NULL if failed or the external type of the export\n type is not `WasmEdge_ExternalType_Memory`."] pub fn WasmEdge_ExportTypeGetMemoryType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ExportTypeContext) -> * const WasmEdge_MemoryTypeContext ; } extern "C" { # [doc = " Get the external value (which is global type) from an export type.\n\n The export type context should be the one queried from the AST module\n context, or this function will cause unexpected error.\n The global type context links to the global type in the export type context\n and the AST module context. The caller should __NOT__ call the\n `WasmEdge_GlobalTypeDelete`.\n\n \\param ASTCxt the WasmEdge_ASTModuleContext.\n \\param Cxt the WasmEdge_ExportTypeContext which queried from the `ASTCxt`.\n\n \\returns the global type. NULL if failed or the external type of the export\n type is not `WasmEdge_ExternalType_Global`."] pub fn WasmEdge_ExportTypeGetGlobalType (ASTCxt : * const WasmEdge_ASTModuleContext , Cxt : * const WasmEdge_ExportTypeContext) -> * const WasmEdge_GlobalTypeContext ; } extern "C" { # [doc = " Creation of the WasmEdge_CompilerContext.\n\n The caller owns the object and should call `WasmEdge_CompilerDelete` to\n delete it.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_CompilerCreate (ConfCxt : * const WasmEdge_ConfigureContext) -> * mut WasmEdge_CompilerContext ; } extern "C" { # [doc = " Compile the input WASM from the file path.\n\n The compiler compiles the WASM from file path for the ahead-of-time mode and\n store the result to the output file path.\n\n \\param Cxt the WasmEdge_CompilerContext.\n \\param InPath the input WASM file path.\n \\param OutPath the output WASM file path.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_CompilerCompile (Cxt : * mut WasmEdge_CompilerContext , InPath : * const :: std :: os :: raw :: c_char , OutPath : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Compile the input WASM from the given buffer.\n\n The compiler compiles the WASM from the given buffer for the\n ahead-of-time mode and store the result to the output file path.\n\n \\param Cxt the WasmEdge_CompilerContext.\n \\param InBuffer the input WASM binary buffer.\n \\param InBufferLen the length of the input WASM binary buffer.\n \\param OutPath the output WASM file path.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_CompilerCompileFromBuffer (Cxt : * mut WasmEdge_CompilerContext , InBuffer : * const u8 , InBufferLen : u64 , OutPath : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_CompilerContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_CompilerContext to destroy."] pub fn WasmEdge_CompilerDelete (Cxt : * mut WasmEdge_CompilerContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_LoaderContext.\n\n The caller owns the object and should call `WasmEdge_LoaderDelete` to\n destroy it.\n\n \\param ConfCxt the WasmEdge_ConfigureContext as the configuration of Loader.\n NULL for the default configuration.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_LoaderCreate (ConfCxt : * const WasmEdge_ConfigureContext) -> * mut WasmEdge_LoaderContext ; } extern "C" { # [doc = " Load and parse the WASM module from a WASM file into a\n WasmEdge_ASTModuleContext.\n\n Load and parse the WASM module from the file path, and return a\n `WasmEdge_ASTModuleContext` as the result. The caller owns the\n `WasmEdge_ASTModuleContext` object and should call\n `WasmEdge_ASTModuleDelete` to destroy it.\n\n \\param Cxt the WasmEdge_LoaderContext.\n \\param [out] Module the output WasmEdge_ASTModuleContext if succeeded.\n \\param Path the NULL-terminated C string of the WASM file path.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_LoaderParseFromFile (Cxt : * mut WasmEdge_LoaderContext , Module : * mut * mut WasmEdge_ASTModuleContext , Path : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Load and parse the WASM module from a buffer into WasmEdge_ASTModuleContext.\n\n Load and parse the WASM module from a buffer, and return a\n WasmEdge_ASTModuleContext as the result. The caller owns the\n WasmEdge_ASTModuleContext object and should call `WasmEdge_ASTModuleDelete`\n to destroy it.\n\n \\param Cxt the WasmEdge_LoaderContext.\n \\param [out] Module the output WasmEdge_ASTModuleContext if succeeded.\n \\param Buf the buffer of WASM binary.\n \\param BufLen the length of the buffer.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_LoaderParseFromBuffer (Cxt : * mut WasmEdge_LoaderContext , Module : * mut * mut WasmEdge_ASTModuleContext , Buf : * const u8 , BufLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_LoaderContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_LoaderContext to destroy."] pub fn WasmEdge_LoaderDelete (Cxt : * mut WasmEdge_LoaderContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_ValidatorContext.\n\n The caller owns the object and should call `WasmEdge_ValidatorDelete` to\n destroy it.\n\n \\param ConfCxt the WasmEdge_ConfigureContext as the configuration of\n Validator. NULL for the default configuration.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ValidatorCreate (ConfCxt : * const WasmEdge_ConfigureContext) -> * mut WasmEdge_ValidatorContext ; } extern "C" { # [doc = " Validate the WasmEdge AST Module.\n\n \\param Cxt the WasmEdge_ValidatorContext.\n \\param ASTCxt the WasmEdge_ASTModuleContext to validate.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_ValidatorValidate (Cxt : * mut WasmEdge_ValidatorContext , ASTCxt : * const WasmEdge_ASTModuleContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_ValidatorContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_ValidatorContext to destroy."] pub fn WasmEdge_ValidatorDelete (Cxt : * mut WasmEdge_ValidatorContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_ExecutorContext.\n\n The caller owns the object and should call `WasmEdge_ExecutorDelete` to\n delete it.\n\n \\param ConfCxt the WasmEdge_ConfigureContext as the configuration of\n Executor. NULL for the default configuration.\n \\param StatCxt the WasmEdge_StatisticsContext as the statistics object set\n into Executor. The statistics will refer to this context, and the life cycle\n should be guaranteed until the executor context is deleted. NULL for not\n doing the statistics.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ExecutorCreate (ConfCxt : * const WasmEdge_ConfigureContext , StatCxt : * mut WasmEdge_StatisticsContext) -> * mut WasmEdge_ExecutorContext ; } extern "C" { # [doc = " Instantiate an AST Module into a module instance.\n\n Instantiate an AST Module, and return an instantiated module instance\n context as the result. The caller owns the object and should call\n `WasmEdge_ModuleInstanceDelete` to destroy it. Developers can use the\n `WasmEdge_ModuleInstanceListFunction`,\n `WasmEdge_ModuleInstanceFindFunction`, etc. APIs to retrieve the exported\n instances from the result module instance.\n\n \\param Cxt the WasmEdge_ExecutorContext to instantiate the module.\n \\param [out] ModuleCxt the output WasmEdge_ModuleInstanceContext if\n succeeded.\n \\param StoreCxt the WasmEdge_StoreContext to link the imports.\n \\param ASTCxt the WasmEdge AST Module context generated by loader or\n compiler.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_ExecutorInstantiate (Cxt : * mut WasmEdge_ExecutorContext , ModuleCxt : * mut * mut WasmEdge_ModuleInstanceContext , StoreCxt : * mut WasmEdge_StoreContext , ASTCxt : * const WasmEdge_ASTModuleContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate an AST Module into a named module instance and link into store.\n\n Instantiate an AST Module with the module name, return the instantiated\n module instance context as the result, and also register the module instance\n to the store. The caller owns the object and should call\n `WasmEdge_ModuleInstanceDelete` to destroy it.\n Developers can use the `WasmEdge_ModuleInstanceListFunction`,\n `WasmEdge_ModuleInstanceFindFunction`, etc. APIs to retrieve the exported\n instances from the result module instance.\n After calling this function, the output module instance will also be\n registered into the store, and the other modules can import the exported\n instances for linking when instantiation. Developers SHOULD guarantee the\n life cycle of this output module instance, or the error will occur when in\n execution after the module instance being destroyed if it has been imported\n by other modules. That is, developers have the responsibility to delete the\n output module instance even though the store being destroyed. When the\n module instance is deleted, it will be unregistered to the store\n automatically.\n\n \\param Cxt the WasmEdge_ExecutorContext to instantiate the module.\n \\param [out] ModuleCxt the output WasmEdge_ModuleInstanceContext if\n succeeded.\n \\param StoreCxt the WasmEdge_StoreContext to link the imports.\n \\param ASTCxt the WasmEdge AST Module context generated by loader or\n compiler.\n \\param ModuleName the module name WasmEdge_String for all exported\n instances.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_ExecutorRegister (Cxt : * mut WasmEdge_ExecutorContext , ModuleCxt : * mut * mut WasmEdge_ModuleInstanceContext , StoreCxt : * mut WasmEdge_StoreContext , ASTCxt : * const WasmEdge_ASTModuleContext , ModuleName : WasmEdge_String) -> WasmEdge_Result ; } extern "C" { # [doc = " Register a module instance into a store with exporting its module name.\n\n Register an existing module into the store with its module name.\n After calling this function, the existing module instance will be registered\n into the store, and the other modules can import the exported instances for\n linking when instantiation. Developers SHOULD guarantee the life cycle of\n this existing module instance, or the error will occur when in execution\n after the module instance being destroyed if it has been imported by other\n modules. When the module instance is deleted, it will be unregistered to the\n store automatically.\n\n \\param Cxt the WasmEdge_ExecutorContext to instantiate the module.\n \\param StoreCxt the WasmEdge_StoreContext to store the instantiated module.\n \\param ImportCxt the WasmEdge_ModuleInstanceContext to register.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_ExecutorRegisterImport (Cxt : * mut WasmEdge_ExecutorContext , StoreCxt : * mut WasmEdge_StoreContext , ImportCxt : * const WasmEdge_ModuleInstanceContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Invoke a WASM function by the function instance.\n\n After instantiating a WASM module, developers can get the function instance\n context from the module instance. Then developers can invoke the function\n through this API.\n\n \\param Cxt the WasmEdge_ExecutorContext.\n \\param FuncCxt the function instance context to invoke.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n \\param [out] Returns the WasmEdge_Value buffer to fill the return values.\n \\param ReturnLen the return buffer length.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_ExecutorInvoke (Cxt : * mut WasmEdge_ExecutorContext , FuncCxt : * const WasmEdge_FunctionInstanceContext , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Asynchronous invoke a WASM function by the function instance.\n\n After instantiating a WASM module, developers can get the function instance\n context from the module instance. Then developers can invoke the function\n asynchronously through this API.\n\n \\param Cxt the WasmEdge_ExecutorContext.\n \\param FuncCxt the function instance context to invoke.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n\n \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call\n `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_ExecutorAsyncInvoke (Cxt : * mut WasmEdge_ExecutorContext , FuncCxt : * const WasmEdge_FunctionInstanceContext , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Deletion of the WasmEdge_ExecutorContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_ExecutorContext to destroy."] pub fn WasmEdge_ExecutorDelete (Cxt : * mut WasmEdge_ExecutorContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_StoreContext.\n\n The caller owns the object and should call `WasmEdge_StoreDelete` to destroy\n it.\n The store is the linker for multiple WASM module instances. The store will\n not own any module instance registered into it, and the module instances\n will automatically be unregistered if they are destroyed.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_StoreCreate () -> * mut WasmEdge_StoreContext ; } extern "C" { # [doc = " Get the module instance context by the module name.\n\n After registering a WASM module, developers can call this function to find\n and get the registered module instance context by the module name.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_StoreContext.\n \\param Name the module name WasmEdge_String.\n\n \\returns pointer to the module instance context. NULL if not found."] pub fn WasmEdge_StoreFindModule (Cxt : * const WasmEdge_StoreContext , Name : WasmEdge_String) -> * const WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the length of registered module list in store.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_StoreContext.\n\n \\returns length of registered named module list."] pub fn WasmEdge_StoreListModuleLength (Cxt : * const WasmEdge_StoreContext) -> u32 ; } extern "C" { # [doc = " List the registered module names.\n\n This function will list all registered module names.\n The returned module names filled into the `Names` array are linked to the\n registered module names in the store context, and the caller should __NOT__\n call the `WasmEdge_StringDelete`.\n If the `Names` buffer length is smaller than the result of the registered\n named module list size, the overflowed return values will be discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_StoreContext.\n \\param [out] Names the output names WasmEdge_String buffer of named modules.\n \\param Len the buffer length.\n\n \\returns actual registered named module list size."] pub fn WasmEdge_StoreListModule (Cxt : * const WasmEdge_StoreContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Deletion of the WasmEdge_StoreContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n If there are module instances registered into this store context, they will\n be automatically un-link to this store context.\n\n \\param Cxt the WasmEdge_StoreContext to destroy."] pub fn WasmEdge_StoreDelete (Cxt : * mut WasmEdge_StoreContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_ModuleInstanceContext.\n\n Create a module instance context with exported module name for host\n instances. Developer can use this API to create a module instance for\n collecting host functions, tables, memories, and globals.\n The caller owns the object and should call `WasmEdge_ModuleInstanceDelete`\n to destroy it.\n\n \\param ModuleName the module name WasmEdge_String of this host module to\n import.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ModuleInstanceCreate (ModuleName : WasmEdge_String) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Creation of the WasmEdge_ModuleInstanceContext with host data.\n\n Create a module instance context with exported module name, host data, and\n host data finalizer for host instances. Developer can use this API to create\n a module instance for collecting host functions, tables, memories, and\n globals. When this created module instance being destroyed, the host data\n finalizer will be invoked. The caller owns the object and should call\n `WasmEdge_ModuleInstanceDelete` to destroy it.\n\n \\param ModuleName the module name WasmEdge_String of this host module to\n import.\n \\param HostData the host data to set into the module instance. When calling\n the finalizer, this pointer will become the argument of the finalizer\n function.\n \\param Finalizer the function to finalize the host data.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ModuleInstanceCreateWithData (ModuleName : WasmEdge_String , HostData : * mut :: std :: os :: raw :: c_void , Finalizer : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void) >) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Creation of the WasmEdge_ModuleInstanceContext for the WASI specification.\n\n This function will create a WASI host module that contains the WASI host\n functions and initialize it. The caller owns the object and should call\n `WasmEdge_ModuleInstanceDelete` to destroy it.\n\n \\param Args the command line arguments. The first argument suggests being\n the program name. NULL if the length is 0.\n \\param ArgLen the length of the command line arguments.\n \\param Envs the environment variables in the format `ENV=VALUE`. NULL if the\n length is 0.\n \\param EnvLen the length of the environment variables.\n \\param Preopens the directory paths to preopen. String format in\n `GUEST_PATH:HOST_PATH` means the path mapping, or the same path will be\n mapped. NULL if the length is 0.\n \\param PreopenLen the length of the directory paths to preopen.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_ModuleInstanceCreateWASI (Args : * const * const :: std :: os :: raw :: c_char , ArgLen : u32 , Envs : * const * const :: std :: os :: raw :: c_char , EnvLen : u32 , Preopens : * const * const :: std :: os :: raw :: c_char , PreopenLen : u32) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Initialize the WasmEdge_ModuleInstanceContext for the WASI specification.\n\n This function will initialize the WASI host module with the parameters.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object.\n \\param Args the command line arguments. The first argument suggests being\n the program name. NULL if the length is 0.\n \\param ArgLen the length of the command line arguments.\n \\param Envs the environment variables in the format `ENV=VALUE`. NULL if the\n length is 0.\n \\param EnvLen the length of the environment variables.\n \\param Preopens the directory paths to preopen. String format in\n `GUEST_PATH:HOST_PATH` means the path mapping, or the same path will be\n mapped. NULL if the length is 0.\n \\param PreopenLen the length of the directory paths to preopen."] pub fn WasmEdge_ModuleInstanceInitWASI (Cxt : * mut WasmEdge_ModuleInstanceContext , Args : * const * const :: std :: os :: raw :: c_char , ArgLen : u32 , Envs : * const * const :: std :: os :: raw :: c_char , EnvLen : u32 , Preopens : * const * const :: std :: os :: raw :: c_char , PreopenLen : u32) ; } extern "C" { # [doc = " Get the WASI exit code.\n\n This function will return the exit code after running the \"_start\" function\n of a `wasm32-wasi` program.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object.\n\n \\returns the exit code after executing the \"_start\" function. Return\n `EXIT_FAILURE` if the `Cxt` is NULL or not a WASI host module."] pub fn WasmEdge_ModuleInstanceWASIGetExitCode (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " Get the native handler from the WASI mapped FD/Handler.\n\n This function will return the raw FD/Handler from a given mapped Fd\n or Handler.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object.\n \\param Fd the WASI mapped Fd.\n \\param [out] NativeHandler the raw Fd/Handler.\n\n \\returns the error code. Return `0` if the Native Handler is found.\n Return `1` if the `Cxt` is `NULL`.\n Return `2` if the given mapped Fd/handler is not found."] pub fn WasmEdge_ModuleInstanceWASIGetNativeHandler (Cxt : * const WasmEdge_ModuleInstanceContext , Fd : i32 , NativeHandler : * mut u64) -> u32 ; } extern "C" { # [doc = " Initialize the WasmEdge_ModuleInstanceContext for the wasmedge_process\n specification.\n\n This function will initialize the wasmedge_process host module with the\n parameters.\n\n \\param AllowedCmds the allowed commands white list. NULL if the\n length is 0.\n \\param CmdsLen the length of the allowed commands white list.\n \\param AllowAll the boolean value to allow all commands. `false` is\n suggested. If this value is `true`, the allowed commands white list will not\n be recorded and all commands can be executed by wasmedge_process."] pub fn WasmEdge_ModuleInstanceInitWasmEdgeProcess (AllowedCmds : * const * const :: std :: os :: raw :: c_char , CmdsLen : u32 , AllowAll : bool) ; } extern "C" { # [doc = " Get the export module name of a module instance.\n\n The returned string object is linked to the module name of the module\n instance, and the caller should __NOT__ call the `WasmEdge_StringDelete`.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n\n \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_ModuleInstanceGetModuleName (Cxt : * const WasmEdge_ModuleInstanceContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the host data set into the module instance when creating.\n\n The returned data is owned by the module instance, and will be passed into\n the finalizer when deleting this module instance.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n\n \\returns host data. NULL if the module instance context is NULL or no host\n data set into the module instance."] pub fn WasmEdge_ModuleInstanceGetHostData (Cxt : * const WasmEdge_ModuleInstanceContext) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { # [doc = " Get the exported function instance context of a module instance.\n\n The result function instance context links to the function instance in the\n module instance context and owned by the module instance context, and the\n caller should __NOT__ call the `WasmEdge_FunctionInstanceDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n \\param Name the function name WasmEdge_String.\n\n \\returns pointer to the function instance context. NULL if not found."] pub fn WasmEdge_ModuleInstanceFindFunction (Cxt : * const WasmEdge_ModuleInstanceContext , Name : WasmEdge_String) -> * mut WasmEdge_FunctionInstanceContext ; } extern "C" { # [doc = " Get the exported table instance context of a module instance.\n\n The result table instance context links to the table instance in the module\n instance context and owned by the module instance context, and the caller\n should __NOT__ call the `WasmEdge_TableInstanceDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n \\param Name the table name WasmEdge_String.\n\n \\returns pointer to the table instance context. NULL if not found."] pub fn WasmEdge_ModuleInstanceFindTable (Cxt : * const WasmEdge_ModuleInstanceContext , Name : WasmEdge_String) -> * mut WasmEdge_TableInstanceContext ; } extern "C" { # [doc = " Get the exported memory instance context of a module instance.\n\n The result memory instance context links to the memory instance in the\n module instance context and owned by the module instance context, and the\n caller should __NOT__ call the `WasmEdge_MemoryInstanceDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n \\param Name the memory name WasmEdge_String.\n\n \\returns pointer to the memory instance context. NULL if not found."] pub fn WasmEdge_ModuleInstanceFindMemory (Cxt : * const WasmEdge_ModuleInstanceContext , Name : WasmEdge_String) -> * mut WasmEdge_MemoryInstanceContext ; } extern "C" { # [doc = " Get the exported global instance context of a module instance.\n\n The result global instance context links to the global instance in the\n module instance context and owned by the module instance context, and the\n caller should __NOT__ call the `WasmEdge_GlobalInstanceDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n \\param Name the global name WasmEdge_String.\n\n \\returns pointer to the global instance context. NULL if not found."] pub fn WasmEdge_ModuleInstanceFindGlobal (Cxt : * const WasmEdge_ModuleInstanceContext , Name : WasmEdge_String) -> * mut WasmEdge_GlobalInstanceContext ; } extern "C" { # [doc = " Get the length of exported function list of a module instance.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n\n \\returns length of the exported function list."] pub fn WasmEdge_ModuleInstanceListFunctionLength (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " List the exported function names of a module instance.\n\n The returned function names filled into the `Names` array are linked to the\n exported names of functions of the module instance context, and the caller\n should __NOT__ call the `WasmEdge_StringDelete`.\n If the `Names` buffer length is smaller than the result of the exported\n function list size, the overflowed return values will be discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n \\param [out] Names the output WasmEdge_String buffer of the function names.\n \\param Len the buffer length.\n\n \\returns actual exported function list size."] pub fn WasmEdge_ModuleInstanceListFunction (Cxt : * const WasmEdge_ModuleInstanceContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the length of exported table list of a module instance.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n\n \\returns length of the exported table list."] pub fn WasmEdge_ModuleInstanceListTableLength (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " List the exported table names of a module instance.\n\n The returned table names filled into the `Names` array are linked to the\n exported names of tables of the module instance context, and the caller\n should __NOT__ call the `WasmEdge_StringDelete`.\n If the `Names` buffer length is smaller than the result of the exported\n table list size, the overflowed return values will be discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n \\param [out] Names the output WasmEdge_String buffer of the table names.\n \\param Len the buffer length.\n\n \\returns actual exported table list size."] pub fn WasmEdge_ModuleInstanceListTable (Cxt : * const WasmEdge_ModuleInstanceContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the length of exported memory list of a module instance.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n\n \\returns length of the exported memory list."] pub fn WasmEdge_ModuleInstanceListMemoryLength (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " List the exported memory names of a module instance.\n\n The returned memory names filled into the `Names` array are linked to the\n exported names of memories of the module instance context, and the caller\n should __NOT__ call the `WasmEdge_StringDelete`.\n If the `Names` buffer length is smaller than the result of the exported\n memory list size, the overflowed return values will be discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n \\param [out] Names the output WasmEdge_String buffer of the memory names.\n \\param Len the buffer length.\n\n \\returns actual exported memory list size."] pub fn WasmEdge_ModuleInstanceListMemory (Cxt : * const WasmEdge_ModuleInstanceContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the length of exported global list of a module instance.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n\n \\returns length of the exported global list."] pub fn WasmEdge_ModuleInstanceListGlobalLength (Cxt : * const WasmEdge_ModuleInstanceContext) -> u32 ; } extern "C" { # [doc = " List the exported global names of a module instance.\n\n The returned global names filled into the `Names` array are linked to the\n exported names of globals of the module instance context, and the caller\n should __NOT__ call the `WasmEdge_StringDelete`.\n If the `Names` buffer length is smaller than the result of the exported\n global list size, the overflowed return values will be discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext.\n \\param [out] Names the output WasmEdge_String buffer of the global names.\n \\param Len the buffer length.\n\n \\returns actual exported global list size."] pub fn WasmEdge_ModuleInstanceListGlobal (Cxt : * const WasmEdge_ModuleInstanceContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Add a function instance context into a WasmEdge_ModuleInstanceContext.\n\n Export and move the ownership of the function instance into the module\n instance. The caller should __NOT__ access or destroy the function instance\n context after calling this function.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext to add the function instance.\n \\param Name the export function name WasmEdge_String.\n \\param FuncCxt the WasmEdge_FunctionInstanceContext to add."] pub fn WasmEdge_ModuleInstanceAddFunction (Cxt : * mut WasmEdge_ModuleInstanceContext , Name : WasmEdge_String , FuncCxt : * mut WasmEdge_FunctionInstanceContext) ; } extern "C" { # [doc = " Add a table instance context into a WasmEdge_ModuleInstanceContext.\n\n Export and move the ownership of the table instance into the module\n instance. The caller should __NOT__ access or destroy the table instance\n context after calling this function.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext to add the table instance.\n \\param Name the export table name WasmEdge_String.\n \\param TableCxt the WasmEdge_TableInstanceContext to add."] pub fn WasmEdge_ModuleInstanceAddTable (Cxt : * mut WasmEdge_ModuleInstanceContext , Name : WasmEdge_String , TableCxt : * mut WasmEdge_TableInstanceContext) ; } extern "C" { # [doc = " Add a memory instance context into a WasmEdge_ModuleInstanceContext.\n\n Export and move the ownership of the memory instance into the module\n instance. The caller should __NOT__ access or destroy the memory instance\n context after calling this function.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext to add the memory instance.\n \\param Name the export memory name WasmEdge_String.\n \\param MemoryCxt the WasmEdge_MemoryInstanceContext to add."] pub fn WasmEdge_ModuleInstanceAddMemory (Cxt : * mut WasmEdge_ModuleInstanceContext , Name : WasmEdge_String , MemoryCxt : * mut WasmEdge_MemoryInstanceContext) ; } extern "C" { # [doc = " Add a global instance context into a WasmEdge_ModuleInstanceContext.\n\n Export and move the ownership of the global instance into the module\n instance. The caller should __NOT__ access or destroy the global instance\n context after calling this function.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext to add the global instance.\n \\param Name the export global name WasmEdge_String.\n \\param GlobalCxt the WasmEdge_GlobalInstanceContext to add."] pub fn WasmEdge_ModuleInstanceAddGlobal (Cxt : * mut WasmEdge_ModuleInstanceContext , Name : WasmEdge_String , GlobalCxt : * mut WasmEdge_GlobalInstanceContext) ; } extern "C" { # [doc = " Deletion of the WasmEdge_ModuleInstanceContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n If the module instance has been registered into one or more store contexts,\n it will be automatically unregistered.\n\n \\param Cxt the WasmEdge_ModuleInstanceContext to destroy."] pub fn WasmEdge_ModuleInstanceDelete (Cxt : * mut WasmEdge_ModuleInstanceContext) ; } pub type WasmEdge_HostFunc_t = :: std :: option :: Option < unsafe extern "C" fn (Data : * mut :: std :: os :: raw :: c_void , CallFrameCxt : * const WasmEdge_CallingFrameContext , Params : * const WasmEdge_Value , Returns : * mut WasmEdge_Value) -> WasmEdge_Result > ; extern "C" { # [doc = " Creation of the WasmEdge_FunctionInstanceContext for host functions.\n\n The caller owns the object and should call `WasmEdge_FunctionInstanceDelete`\n to destroy it if the returned object is not added into a\n `WasmEdge_ModuleInstanceContext`. The following is an example to create a\n host function context.\n ```c\n WasmEdge_Result FuncAdd(void *Data,\n                         const WasmEdge_CallingFrameContext *CallFrameCxt,\n                         const WasmEdge_Value *In, WasmEdge_Value *Out) {\n   // Function to return A + B.\n   int32_t A = WasmEdge_ValueGetI32(In[0]);\n   int32_t B = WasmEdge_ValueGetI32(In[1]);\n   Out[0] = WasmEdge_ValueGenI32(A + B);\n   // Return execution status\n   return WasmEdge_Result_Success;\n }\n\n enum WasmEdge_ValType Params[2] = {WasmEdge_ValType_I32,\n                                    WasmEdge_ValType_I32};\n enum WasmEdge_ValType Returns[1] = {WasmEdge_ValType_I32};\n WasmEdge_FunctionTypeContext *FuncType =\n     WasmEdge_FunctionTypeCreate(Params, 2, Returns, 1);\n WasmEdge_FunctionInstanceContext *HostFunc =\n     WasmEdge_FunctionInstanceCreate(FuncType, FuncAdd, NULL, 0);\n WasmEdge_FunctionTypeDelete(FuncType);\n ...\n ```\n\n \\param Type the function type context to describe the host function\n signature.\n \\param HostFunc the host function pointer. The host function signature must\n be as following:\n ```c\n typedef WasmEdge_Result (*WasmEdge_HostFunc_t)(\n     void *Data,\n     const WasmEdge_CallingFrameContext *CallFrameCxt,\n     const WasmEdge_Value *Params,\n     WasmEdge_Value *Returns);\n ```\n The `Params` is the input parameters array with length guaranteed to be the\n same as the parameter types in the `Type`. The `Returns` is the output\n results array with length guaranteed to be the same as the result types in\n the `Type`. The return value is `WasmEdge_Result` for the execution status.\n \\param Data the additional object, such as the pointer to a data structure,\n to set to this host function context. The caller should guarantee the life\n cycle of the object. NULL if the additional data object is not needed.\n \\param Cost the function cost in statistics. Pass 0 if the calculation is\n not needed.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_FunctionInstanceCreate (Type : * const WasmEdge_FunctionTypeContext , HostFunc : WasmEdge_HostFunc_t , Data : * mut :: std :: os :: raw :: c_void , Cost : u64) -> * mut WasmEdge_FunctionInstanceContext ; } pub type WasmEdge_WrapFunc_t = :: std :: option :: Option < unsafe extern "C" fn (This : * mut :: std :: os :: raw :: c_void , Data : * mut :: std :: os :: raw :: c_void , CallFrameCxt : * const WasmEdge_CallingFrameContext , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result > ; extern "C" { # [doc = " Creation of the WasmEdge_FunctionInstanceContext for host functions.\n\n This function is for the languages which cannot pass the function pointer of\n the host function into this shared library directly. The caller owns the\n object and should call `WasmEdge_FunctionInstanceDelete` to destroy it if\n the returned object is not added into a `WasmEdge_ModuleInstanceContext`.\n The following is an example to create a host function context for other\n languages.\n ```c\n // `RealFunc` is the pointer to the function in other languages.\n\n WasmEdge_Result FuncAddWrap(\n     void *This, void *Data,\n     const WasmEdge_CallingFrameContext *CallFrameCxt,\n     const WasmEdge_Value *In, const uint32_t InLen, WasmEdge_Value *Out,\n     const uint32_t OutLen) {\n   // Wrapper function of host function to return A + B.\n\n   // `This` is the same as `RealFunc`.\n   int32_t A = WasmEdge_ValueGetI32(In[0]);\n   int32_t B = WasmEdge_ValueGetI32(In[1]);\n\n   // Call the function of `This` in the host language ...\n   int32_t Result = ...;\n\n   Out[0] = Result;\n   // Return the execution status.\n   return WasmEdge_Result_Success;\n }\n\n enum WasmEdge_ValType Params[2] = {WasmEdge_ValType_I32,\n                                    WasmEdge_ValType_I32};\n enum WasmEdge_ValType Returns[1] = {WasmEdge_ValType_I32};\n WasmEdge_FunctionTypeContext *FuncType =\n     WasmEdge_FunctionTypeCreate(Params, 2, Returns, 1);\n WasmEdge_FunctionInstanceContext *HostFunc =\n     WasmEdge_FunctionInstanceCreateBinding(\n         FuncType, FuncAddWrap, RealFunc, NULL, 0);\n WasmEdge_FunctionTypeDelete(FuncType);\n ...\n ```\n\n \\param Type the function type context to describe the host function\n signature.\n \\param WrapFunc the wrapper function pointer. The wrapper function signature\n must be as following:\n ```c\n typedef WasmEdge_Result (*WasmEdge_WrapFunc_t)(\n     void *This,\n     void *Data,\n     WasmEdge_CallingFrameContext *FrameCxt,\n     const WasmEdge_Value *Params,\n     const uint32_t ParamLen,\n     WasmEdge_Value *Returns,\n     const uint32_t ReturnLen);\n ```\n The `This` is the pointer the same as the `Binding` parameter of this\n function. The `Params` is the input parameters array with length guaranteed\n to be the same as the parameter types in the `Type`, and the `ParamLen` is\n the length of the array. The `Returns` is the output results array with\n length guaranteed to be the same as the result types in the `Type`, and the\n `ReturnLen` is the length of the array. The return value is\n `WasmEdge_Result` for the execution status.\n \\param Binding the `this` pointer of the host function target or the\n function indexing maintained by the caller which can specify the host\n function. When invoking the host function, this pointer will be the first\n argument of the wrapper function.\n \\param Data the additional object, such as the pointer to a data structure,\n to set to this host function context. The caller should guarantee the life\n cycle of the object. NULL if the additional data object is not needed.\n \\param Cost the function cost in statistics. Pass 0 if the calculation is\n not needed.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_FunctionInstanceCreateBinding (Type : * const WasmEdge_FunctionTypeContext , WrapFunc : WasmEdge_WrapFunc_t , Binding : * mut :: std :: os :: raw :: c_void , Data : * mut :: std :: os :: raw :: c_void , Cost : u64) -> * mut WasmEdge_FunctionInstanceContext ; } extern "C" { # [doc = " Get the function data field of the function instance.\n\n The function data is passed when creating the FunctionInstance.\n\n \\param Cxt the WasmEdge_FunctionInstanceContext.\n\n \\returns pointer to Data, NULL if failed."] pub fn WasmEdge_FunctionInstanceGetData (Cxt : * const WasmEdge_FunctionInstanceContext) -> * const :: std :: os :: raw :: c_void ; } extern "C" { # [doc = " Get the function type context of the function instance.\n\n The function type context links to the function type in the function\n instance context and owned by the context. The caller should __NOT__ call\n the `WasmEdge_FunctionTypeDelete`.\n\n \\param Cxt the WasmEdge_FunctionInstanceContext.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_FunctionInstanceGetFunctionType (Cxt : * const WasmEdge_FunctionInstanceContext) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Deletion of the WasmEdge_FunctionInstanceContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_FunctionInstanceContext to destroy."] pub fn WasmEdge_FunctionInstanceDelete (Cxt : * mut WasmEdge_FunctionInstanceContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_TableInstanceContext.\n\n The caller owns the object and should call `WasmEdge_TableInstanceDelete` to\n destroy it if the returned object is not added into a\n `WasmEdge_ModuleInstanceContext`.\n\n \\param TabType the table type context to initialize the table instance\n context.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_TableInstanceCreate (TabType : * const WasmEdge_TableTypeContext) -> * mut WasmEdge_TableInstanceContext ; } extern "C" { # [doc = " Get the table type context from a table instance.\n\n The table type context links to the table type in the table instance context\n and owned by the context. The caller should __NOT__ call the\n `WasmEdge_TableTypeDelete`.\n\n \\param Cxt the WasmEdge_TableInstanceContext.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_TableInstanceGetTableType (Cxt : * const WasmEdge_TableInstanceContext) -> * const WasmEdge_TableTypeContext ; } extern "C" { # [doc = " Get the reference value in a table instance.\n\n \\param Cxt the WasmEdge_TableInstanceContext.\n \\param [out] Data the result reference value.\n \\param Offset the reference value offset (index) in the table instance.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_TableInstanceGetData (Cxt : * const WasmEdge_TableInstanceContext , Data : * mut WasmEdge_Value , Offset : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Set the reference value into a table instance.\n\n \\param Cxt the WasmEdge_TableInstanceContext.\n \\param Data the reference value to set into the table instance.\n \\param Offset the reference value offset (index) in the table instance.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_TableInstanceSetData (Cxt : * mut WasmEdge_TableInstanceContext , Data : WasmEdge_Value , Offset : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Get the size of a table instance.\n\n \\param Cxt the WasmEdge_TableInstanceContext.\n\n \\returns the size of the table instance."] pub fn WasmEdge_TableInstanceGetSize (Cxt : * const WasmEdge_TableInstanceContext) -> u32 ; } extern "C" { # [doc = " Grow a table instance with a size.\n\n \\param Cxt the WasmEdge_TableInstanceContext.\n \\param Size the count of reference values to grow in the table instance.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_TableInstanceGrow (Cxt : * mut WasmEdge_TableInstanceContext , Size : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_TableInstanceContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_TableInstanceContext to destroy."] pub fn WasmEdge_TableInstanceDelete (Cxt : * mut WasmEdge_TableInstanceContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_MemoryInstanceContext.\n\n The caller owns the object and should call `WasmEdge_MemoryInstanceDelete`\n to destroy it if the returned object is not added into a\n `WasmEdge_ModuleInstanceContext`.\n\n \\param MemType the memory type context to initialize the memory instance\n context.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_MemoryInstanceCreate (MemType : * const WasmEdge_MemoryTypeContext) -> * mut WasmEdge_MemoryInstanceContext ; } extern "C" { # [doc = " Get the memory type context from a memory instance.\n\n The memory type context links to the memory type in the memory instance\n context and owned by the context. The caller should __NOT__ call the\n `WasmEdge_MemoryTypeDelete`.\n\n \\param Cxt the WasmEdge_MemoryInstanceContext.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_MemoryInstanceGetMemoryType (Cxt : * const WasmEdge_MemoryInstanceContext) -> * const WasmEdge_MemoryTypeContext ; } extern "C" { # [doc = " Copy the data to the output buffer from a memory instance.\n\n \\param Cxt the WasmEdge_MemoryInstanceContext.\n \\param [out] Data the result data buffer of copying destination.\n \\param Offset the data start offset in the memory instance.\n \\param Length the requested data length. If the `Offset + Length` is larger\n than the data size in the memory instance, this function will failed.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_MemoryInstanceGetData (Cxt : * const WasmEdge_MemoryInstanceContext , Data : * mut u8 , Offset : u32 , Length : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Copy the data into a memory instance from the input buffer.\n\n \\param Cxt the WasmEdge_MemoryInstanceContext.\n \\param Data the data buffer to copy.\n \\param Offset the data start offset in the memory instance.\n \\param Length the data buffer length. If the `Offset + Length` is larger\n than the data size in the memory instance, this function will failed.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_MemoryInstanceSetData (Cxt : * mut WasmEdge_MemoryInstanceContext , Data : * const u8 , Offset : u32 , Length : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Get the data pointer in a memory instance.\n\n \\param Cxt the WasmEdge_MemoryInstanceContext.\n \\param Offset the data start offset in the memory instance.\n \\param Length the requested data length. If the `Offset + Length` is larger\n than the data size in the memory instance, this function will return NULL.\n\n \\returns the pointer to data with the start offset. NULL if failed."] pub fn WasmEdge_MemoryInstanceGetPointer (Cxt : * mut WasmEdge_MemoryInstanceContext , Offset : u32 , Length : u32) -> * mut u8 ; } extern "C" { # [doc = " Get the const data pointer in a const memory instance.\n\n \\param Cxt the WasmEdge_MemoryInstanceContext.\n \\param Offset the data start offset in the memory instance.\n \\param Length the requested data length. If the `Offset + Length` is larger\n than the data size in the memory instance, this function will return NULL.\n\n \\returns the pointer to data with the start offset. NULL if failed."] pub fn WasmEdge_MemoryInstanceGetPointerConst (Cxt : * const WasmEdge_MemoryInstanceContext , Offset : u32 , Length : u32) -> * const u8 ; } extern "C" { # [doc = " Get the current page size (64 KiB of each page) of a memory instance.\n\n \\param Cxt the WasmEdge_MemoryInstanceContext.\n\n \\returns the page size of the memory instance."] pub fn WasmEdge_MemoryInstanceGetPageSize (Cxt : * const WasmEdge_MemoryInstanceContext) -> u32 ; } extern "C" { # [doc = " Grow a memory instance with a page size.\n\n \\param Cxt the WasmEdge_MemoryInstanceContext.\n \\param Page the page count to grow in the memory instance.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_MemoryInstanceGrowPage (Cxt : * mut WasmEdge_MemoryInstanceContext , Page : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_MemoryInstanceContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_MemoryInstanceContext to destroy."] pub fn WasmEdge_MemoryInstanceDelete (Cxt : * mut WasmEdge_MemoryInstanceContext) ; } extern "C" { # [doc = " Creation of the WasmEdge_GlobalInstanceContext.\n\n The caller owns the object and should call `WasmEdge_GlobalInstanceDelete`\n to destroy it if the returned object is not added into a\n `WasmEdge_ModuleInstanceContext`.\n\n \\param GlobType the global type context to initialize the global instance\n context.\n \\param Value the initial value with its value type of the global instance.\n This function will fail if the value type of `GlobType` and `Value` are not\n the same.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_GlobalInstanceCreate (GlobType : * const WasmEdge_GlobalTypeContext , Value : WasmEdge_Value) -> * mut WasmEdge_GlobalInstanceContext ; } extern "C" { # [doc = " Get the global type context from a global instance.\n\n The global type context links to the global type in the global instance\n context and owned by the context. The caller should __NOT__ call the\n `WasmEdge_GlobalTypeDelete`.\n\n \\param Cxt the WasmEdge_GlobalInstanceContext.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_GlobalInstanceGetGlobalType (Cxt : * const WasmEdge_GlobalInstanceContext) -> * const WasmEdge_GlobalTypeContext ; } extern "C" { # [doc = " Get the value from a global instance.\n\n \\param Cxt the WasmEdge_GlobalInstanceContext.\n\n \\returns the current value of the global instance."] pub fn WasmEdge_GlobalInstanceGetValue (Cxt : * const WasmEdge_GlobalInstanceContext) -> WasmEdge_Value ; } extern "C" { # [doc = " Set the value from a global instance.\n\n This function will do nothing if the global context is set as the `Const`\n mutation or the value type not matched.\n\n \\param Cxt the WasmEdge_GlobalInstanceContext.\n \\param Value the value to set into the global context."] pub fn WasmEdge_GlobalInstanceSetValue (Cxt : * mut WasmEdge_GlobalInstanceContext , Value : WasmEdge_Value) ; } extern "C" { # [doc = " Deletion of the WasmEdge_GlobalInstanceContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_GlobalInstanceContext to destroy."] pub fn WasmEdge_GlobalInstanceDelete (Cxt : * mut WasmEdge_GlobalInstanceContext) ; } extern "C" { # [doc = " Get the executor context from the current calling frame.\n\n \\param Cxt the WasmEdge_CallingFrameContext.\n\n \\returns the executor context, NULL if the Cxt is NULL."] pub fn WasmEdge_CallingFrameGetExecutor (Cxt : * const WasmEdge_CallingFrameContext) -> * mut WasmEdge_ExecutorContext ; } extern "C" { # [doc = " Get the module instance of the current calling frame.\n\n When a WASM function is executing and start to call a host function, a frame\n with the module instance which the WASM function belongs to will be pushed\n onto the stack. And therefore the calling frame context will record that\n module instance.\n So in one case that the module instance will be `NULL`: developers execute\n the function instance which is a host function and not added into a module\n instance.\n\n \\param Cxt the WasmEdge_CallingFrameContext.\n\n \\returns the module instance of the current calling frame."] pub fn WasmEdge_CallingFrameGetModuleInstance (Cxt : * const WasmEdge_CallingFrameContext) -> * const WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the memory instance by index from the module instance of the current\n calling frame.\n\n By default, a WASM module only have one memory instance after instantiation.\n Therefore, developers can use:\n   `WasmEdge_CallingFrameGetMemoryInstance(Cxt, 0)`\n to get the memory instance in host function body.\n This extension is for the WASM multiple memories proposal. After enabling\n the proposal, there may be greater than 1 memory instances in a WASM module.\n So developers can use this function to access the memory instances which are\n not in 0 index.\n\n \\param Cxt the WasmEdge_CallingFrameContext.\n \\param Idx the index of memory instance in the module instance.\n\n \\returns the memory instance, NULL if not found."] pub fn WasmEdge_CallingFrameGetMemoryInstance (Cxt : * const WasmEdge_CallingFrameContext , Idx : u32) -> * mut WasmEdge_MemoryInstanceContext ; } extern "C" { # [doc = " Wait a WasmEdge_Async execution.\n\n \\param Cxt the WasmEdge_ASync."] pub fn WasmEdge_AsyncWait (Cxt : * const WasmEdge_Async) ; } extern "C" { # [doc = " Wait a WasmEdge_Async execution with timeout.\n\n \\param Cxt the WasmEdge_ASync.\n \\param Milliseconds times to wait.\n\n \\returns Result of waiting, true for execution ended, false for timeout\n occurred."] pub fn WasmEdge_AsyncWaitFor (Cxt : * const WasmEdge_Async , Milliseconds : u64) -> bool ; } extern "C" { # [doc = " Cancel a WasmEdge_Async execution.\n\n \\param Cxt the WasmEdge_ASync."] pub fn WasmEdge_AsyncCancel (Cxt : * mut WasmEdge_Async) ; } extern "C" { # [doc = " Wait and get the return list length of the WasmEdge_Async execution.\n\n This function will wait until the execution finished and return the return\n value list length of the executed function. This function will return 0 if\n the `Cxt` is NULL, the execution was failed, or the execution was canceled.\n Developers can call the `WasmEdge_AsyncGet` to get the execution status and\n the return values.\n\n \\param Cxt the WasmEdge_ASync.\n\n \\returns the return list length of the executed function."] pub fn WasmEdge_AsyncGetReturnsLength (Cxt : * const WasmEdge_Async) -> u32 ; } extern "C" { # [doc = " Wait and get the result of WasmEdge_Async execution.\n\n This function will wait until the execution finished and return the\n execution status and the return values.\n If the `Returns` buffer length is smaller than the arity of the function,\n the overflowed return values will be discarded.\n\n \\param Cxt the WasmEdge_ASync.\n \\param [out] Returns the WasmEdge_Value buffer to fill the return values.\n \\param ReturnLen the return buffer length.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_AsyncGet (Cxt : * const WasmEdge_Async , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Deletion of the WasmEdge_Async.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_ASync to destroy."] pub fn WasmEdge_AsyncDelete (Cxt : * mut WasmEdge_Async) ; } extern "C" { # [doc = " Creation of the WasmEdge_VMContext.\n\n The caller owns the object and should call `WasmEdge_VMDelete` to destroy\n it.\n\n \\param ConfCxt the WasmEdge_ConfigureContext as the configuration of VM.\n NULL for the default configuration.\n \\param StoreCxt the WasmEdge_StoreContext as the external WASM store of VM.\n The instantiation and execution will refer to this store context, and the\n life cycle should be ensured until the VM context is deleted. NULL for the\n default store owned by `WasmEdge_VMContext`.\n\n \\returns pointer to context, NULL if failed."] pub fn WasmEdge_VMCreate (ConfCxt : * const WasmEdge_ConfigureContext , StoreCxt : * mut WasmEdge_StoreContext) -> * mut WasmEdge_VMContext ; } extern "C" { # [doc = " Register and instantiate WASM into the store in VM from a WASM file.\n\n Load a WASM file from the path, and register all exported instances and\n instantiate them into the store into the VM with their exported name and\n module name.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext which contains the store.\n \\param ModuleName the WasmEdge_String of module name for all exported\n instances.\n \\param Path the NULL-terminated C string of the WASM file path.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMRegisterModuleFromFile (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , Path : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Register and instantiate WASM into the store in VM from a buffer.\n\n Load a WASM module from a buffer, and register all exported instances and\n instantiate them into the store into the VM with their exported name and\n module name.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext which contains the store.\n \\param ModuleName the WasmEdge_String of module name for all exported\n instances.\n \\param Buf the buffer of WASM binary.\n \\param BufLen the length of the buffer.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMRegisterModuleFromBuffer (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , Buf : * const u8 , BufLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate and register an AST Module into a named module instance in VM.\n\n Load from the AST Module, and register all exported instances and\n instantiate them into the store in VM with their exported name and module\n name.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext which contains the store.\n \\param ModuleName the WasmEdge_String of module name for all exported\n instances.\n \\param ASTCxt the WasmEdge AST Module context generated by loader or\n compiler.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMRegisterModuleFromASTModule (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , ASTCxt : * const WasmEdge_ASTModuleContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Register a module instance into the store in VM with exporting its module\n name.\n\n After calling this function, the existing module instance will be registered\n into the store context in this VM, and the other modules can import the\n exported instances for linking when instantiation. Developers SHOULD\n guarantee the life cycle of this existing module instance, or the error will\n occur when in execution after the module instance being destroyed if it has\n been imported by other modules. That is, developers should call the\n `WasmEdge_ModuleInstanceDelete` if this existing module instance will not be\n used anymore or after the deletion of this VM. When the module instance is\n deleted, it will be unregistered to the store context in this VM\n automatically.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext which contains the store.\n \\param ImportCxt the WasmEdge_ModuleInstanceContext to register.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMRegisterModuleFromImport (Cxt : * mut WasmEdge_VMContext , ImportCxt : * const WasmEdge_ModuleInstanceContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the WASM module from a WASM file and invoke a function by name.\n\n This is the function to invoke a WASM function rapidly.\n Load and instantiate the WASM module from the file path, and then invoke a\n function by name and parameters. If the `Returns` buffer length is smaller\n than the arity of the function, the overflowed return values will be\n discarded.\n After calling this function, a new module instance is instantiated, and the\n old one will be destroyed.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param Path the NULL-terminated C string of the WASM file path.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n \\param [out] Returns the WasmEdge_Value buffer to fill the return values.\n \\param ReturnLen the return buffer length.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMRunWasmFromFile (Cxt : * mut WasmEdge_VMContext , Path : * const :: std :: os :: raw :: c_char , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the WASM module from a buffer and invoke a function by name.\n\n This is the function to invoke a WASM function rapidly.\n Load and instantiate the WASM module from a buffer, and then invoke a\n function by name and parameters. If the `Returns` buffer length is smaller\n than the arity of the function, the overflowed return values will be\n discarded.\n After calling this function, a new module instance is instantiated, and the\n old one will be destroyed.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param Buf the buffer of WASM binary.\n \\param BufLen the length of the buffer.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n \\param [out] Returns the WasmEdge_Value buffer to fill the return values.\n \\param ReturnLen the return buffer length.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMRunWasmFromBuffer (Cxt : * mut WasmEdge_VMContext , Buf : * const u8 , BufLen : u32 , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the WASM module from a WasmEdge AST Module and invoke a function\n by name.\n\n This is the function to invoke a WASM function rapidly.\n Load and instantiate the WASM module from the WasmEdge AST Module, and then\n invoke the function by name and parameters. If the `Returns` buffer length\n is smaller than the arity of the function, the overflowed return values will\n be discarded.\n After calling this function, a new module instance is instantiated, and the\n old one will be destroyed.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param ASTCxt the WasmEdge AST Module context generated by loader or\n compiler.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n \\param [out] Returns the WasmEdge_Value buffer to fill the return values.\n \\param ReturnLen the return buffer length.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMRunWasmFromASTModule (Cxt : * mut WasmEdge_VMContext , ASTCxt : * const WasmEdge_ASTModuleContext , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the WASM module from a WASM file and asynchronous invoke a\n function by name.\n\n This is the function to invoke a WASM function rapidly.\n Load and instantiate the WASM module from the file path, and then invoke a\n function by name and parameters. If the `Returns` buffer length is smaller\n than the arity of the function, the overflowed return values will be\n discarded.\n After calling this function, a new module instance is instantiated, and the\n old one will be destroyed.\n\n The caller owns the object and should call `WasmEdge_AsyncDelete` to destroy\n it.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param Path the NULL-terminated C string of the WASM file path.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n\n \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call\n `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncRunWasmFromFile (Cxt : * mut WasmEdge_VMContext , Path : * const :: std :: os :: raw :: c_char , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Instantiate the WASM module from a buffer and asynchronous invoke a function\n by name.\n\n This is the function to invoke a WASM function rapidly.\n Load and instantiate the WASM module from a buffer, and then invoke a\n function by name and parameters. If the `Returns` buffer length is smaller\n than the arity of the function, the overflowed return values will be\n discarded.\n After calling this function, a new module instance is instantiated, and the\n old one will be destroyed.\n\n The caller owns the object and should call `WasmEdge_AsyncDelete` to destroy\n it.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param Buf the buffer of WASM binary.\n \\param BufLen the length of the buffer.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n\n \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call\n `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncRunWasmFromBuffer (Cxt : * mut WasmEdge_VMContext , Buf : * const u8 , BufLen : u32 , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Instantiate the WASM module from a WasmEdge AST Module and asynchronous\n invoke a function by name.\n\n This is the function to invoke a WASM function rapidly.\n Load and instantiate the WASM module from the WasmEdge AST Module, and then\n invoke the function by name and parameters. If the `Returns` buffer length\n is smaller than the arity of the function, the overflowed return values will\n be discarded.\n After calling this function, a new module instance is instantiated, and the\n old one will be destroyed.\n\n The caller owns the object and should call `WasmEdge_AsyncDelete` to destroy\n it.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param ASTCxt the WasmEdge AST Module context generated by loader or\n compiler.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n\n \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call\n `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncRunWasmFromASTModule (Cxt : * mut WasmEdge_VMContext , ASTCxt : * const WasmEdge_ASTModuleContext , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Load the WASM module from a WASM file.\n\n This is the first step to invoke a WASM function step by step.\n Load and parse the WASM module from the file path. You can then call\n `WasmEdge_VMValidate` for the next step.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param Path the NULL-terminated C string of the WASM file path.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMLoadWasmFromFile (Cxt : * mut WasmEdge_VMContext , Path : * const :: std :: os :: raw :: c_char) -> WasmEdge_Result ; } extern "C" { # [doc = " Load the WASM module from a buffer.\n\n This is the first step to invoke a WASM function step by step.\n Load and parse the WASM module from a buffer. You can then call\n `WasmEdge_VMValidate` for the next step.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param Buf the buffer of WASM binary.\n \\param BufLen the length of the buffer.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMLoadWasmFromBuffer (Cxt : * mut WasmEdge_VMContext , Buf : * const u8 , BufLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Load the WASM module from loaded WasmEdge AST Module.\n\n This is the first step to invoke a WASM function step by step.\n Copy the loaded WasmEdge AST Module context into VM. The VM context has no\n dependency on the input AST Module context. You can then call\n `WasmEdge_VMValidate` for the next step.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param ASTCxt the WasmEdge AST Module context generated by loader or\n compiler.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMLoadWasmFromASTModule (Cxt : * mut WasmEdge_VMContext , ASTCxt : * const WasmEdge_ASTModuleContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Validate the WASM module loaded into the VM context.\n\n This is the second step to invoke a WASM function step by step.\n After loading a WASM module into VM context, You can call this function to\n validate it. And you can then call `WasmEdge_VMInstantiate` for the next\n step. Note that only validated WASM modules can be instantiated in the VM\n context.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMValidate (Cxt : * mut WasmEdge_VMContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Instantiate the validated WASM module in the VM context.\n\n This is the third step to invoke a WASM function step by step.\n After validating a WASM module in the VM context, You can call this function\n to instantiate it. And you can then call `WasmEdge_VMExecute` for invoking\n the exported function in this WASM module.\n After calling this function, a new module instance is instantiated, and the\n old one will be destroyed.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMInstantiate (Cxt : * mut WasmEdge_VMContext) -> WasmEdge_Result ; } extern "C" { # [doc = " Invoke a WASM function by name.\n\n This is the final step to invoke a WASM function step by step.\n After instantiating a WASM module in the VM context, the WASM module is\n registered into the store in the VM context as an anonymous module. Then you\n can repeatedly call this function to invoke the exported WASM functions by\n their names until the VM context is reset or a new WASM module is registered\n or loaded. For calling the functions in registered WASM modules with module\n names, please use `WasmEdge_VMExecuteRegistered` instead. If the `Returns`\n buffer length is smaller than the arity of the function, the overflowed\n return values will be discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n \\param [out] Returns the WasmEdge_Value buffer to fill the return values.\n \\param ReturnLen the return buffer length.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMExecute (Cxt : * mut WasmEdge_VMContext , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Invoke a WASM function by its module name and function name.\n\n After registering a WASM module in the VM context, you can repeatedly call\n this function to invoke exported WASM functions by their module names and\n function names until the VM context is reset. If the `Returns` buffer length\n is smaller than the arity of the function, the overflowed return values will\n be discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param ModuleName the module name WasmEdge_String.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n \\param [out] Returns the WasmEdge_Value buffer to fill the return values.\n \\param ReturnLen the return buffer length.\n\n \\returns WasmEdge_Result. Call `WasmEdge_ResultGetMessage` for the error\n message."] pub fn WasmEdge_VMExecuteRegistered (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32 , Returns : * mut WasmEdge_Value , ReturnLen : u32) -> WasmEdge_Result ; } extern "C" { # [doc = " Asynchronous invoke a WASM function by name.\n\n This is the final step to invoke a WASM function step by step.\n After instantiating a WASM module in the VM context, the WASM module is\n registered into the store in the VM context as an anonymous module. Then you\n can repeatedly call this function to invoke the exported WASM functions by\n their names until the VM context is reset or a new WASM module is registered\n or loaded. For calling the functions in registered WASM modules with module\n names, please use `WasmEdge_VMAsyncExecuteRegistered` instead.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n\n \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call\n `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncExecute (Cxt : * mut WasmEdge_VMContext , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Asynchronous invoke a WASM function by its module name and function name.\n\n After registering a WASM module in the VM context, you can repeatedly call\n this function to invoke exported WASM functions by their module names and\n function names until the VM context is reset.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param ModuleName the module name WasmEdge_String.\n \\param FuncName the function name WasmEdge_String.\n \\param Params the WasmEdge_Value buffer with the parameter values.\n \\param ParamLen the parameter buffer length.\n\n \\returns WasmEdge_Async. Call `WasmEdge_AsyncGet` for the result, and call\n `WasmEdge_AsyncDelete` to destroy this object."] pub fn WasmEdge_VMAsyncExecuteRegistered (Cxt : * mut WasmEdge_VMContext , ModuleName : WasmEdge_String , FuncName : WasmEdge_String , Params : * const WasmEdge_Value , ParamLen : u32) -> * mut WasmEdge_Async ; } extern "C" { # [doc = " Get the function type by function name.\n\n After instantiating a WASM module in the VM context, the WASM module is\n registered into the store in the VM context as an anonymous module. Then you\n can call this function to get the function type by the exported function\n name until the VM context is reset or a new WASM module is registered or\n loaded. For getting the function type of functions in registered WASM\n modules with module names, please use `WasmEdge_VMGetFunctionTypeRegistered`\n instead.\n The returned function type context are linked to the context owned by the VM\n context, and the caller should __NOT__ call the\n `WasmEdge_FunctionTypeDelete` to destroy it.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param FuncName the function name WasmEdge_String.\n\n \\returns the function type. NULL if the function not found."] pub fn WasmEdge_VMGetFunctionType (Cxt : * const WasmEdge_VMContext , FuncName : WasmEdge_String) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Get the function type by function name.\n\n After registering a WASM module in the VM context, you can call this\n function to get the function type by the functions' exported module names\n and function names until the VM context is reset.\n The returned function type context are linked to the context owned by the VM\n context, and the caller should __NOT__ call the\n `WasmEdge_FunctionTypeDelete` to destroy it.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param ModuleName the module name WasmEdge_String.\n \\param FuncName the function name WasmEdge_String.\n\n \\returns the function type. NULL if the function not found."] pub fn WasmEdge_VMGetFunctionTypeRegistered (Cxt : * const WasmEdge_VMContext , ModuleName : WasmEdge_String , FuncName : WasmEdge_String) -> * const WasmEdge_FunctionTypeContext ; } extern "C" { # [doc = " Reset of WasmEdge_VMContext.\n\n After calling this function, the statistics, loaded module, the instantiated\n instances, and the registered instances except the WASI and plug-ins will\n all be cleared.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext to reset."] pub fn WasmEdge_VMCleanup (Cxt : * mut WasmEdge_VMContext) ; } extern "C" { # [doc = " Get the length of exported function list.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns length of exported function list."] pub fn WasmEdge_VMGetFunctionListLength (Cxt : * const WasmEdge_VMContext) -> u32 ; } extern "C" { # [doc = " Get the exported function list.\n\n The returned function names filled into the `Names` array link to the\n exported names of functions owned by the vm context, and the caller should\n __NOT__ call the `WasmEdge_StringDelete` to destroy them.\n The function type contexts filled into the `FuncTypes` array of the\n corresponding function names link to the context owned by the VM context.\n The caller should __NOT__ call the `WasmEdge_FunctionTypeDelete` to destroy\n them.\n If the `Names` and `FuncTypes` buffer lengths are smaller than the result of\n the exported function list size, the overflowed return values will be\n discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param [out] Names the output names WasmEdge_String buffer of exported\n functions. Can be NULL if names are not needed.\n \\param [out] FuncTypes the function type contexts buffer. Can be NULL if\n function types are not needed.\n \\param Len the buffer length.\n\n \\returns actual exported function list size."] pub fn WasmEdge_VMGetFunctionList (Cxt : * const WasmEdge_VMContext , Names : * mut WasmEdge_String , FuncTypes : * mut * const WasmEdge_FunctionTypeContext , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the module instance corresponding to the WasmEdge_HostRegistration\n settings.\n\n When creating the VM context with a configuration, the built-in host module\n will be registered according to the `WasmEdge_HostRegistration` settings\n added into the `WasmEdge_ConfigureContext`. You can call this function to\n get the `WasmEdge_ModuleInstanceContext` corresponding to the settings. The\n module instance context links to the context owned by the VM context. The\n caller should __NOT__ call the `WasmEdge_ModuleInstanceDelete`.\n\n ```c\n WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();\n WasmEdge_ConfigureAddHostRegistration(Conf, WasmEdge_HostRegistration_Wasi);\n WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);\n WasmEdge_ModuleInstanceContext *WasiMod =\n     WasmEdge_VMGetImportModuleContext(VM, WasmEdge_HostRegistration_Wasi);\n ```\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param Reg the host registration value to get the import module.\n\n \\returns pointer to the module instance context. NULL if not found."] pub fn WasmEdge_VMGetImportModuleContext (Cxt : * const WasmEdge_VMContext , Reg : WasmEdge_HostRegistration) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the current instantiated module in VM.\n\n After instantiating a module instance into the VM, developers can call this\n API to get the module instance to retrieve the exported instances. The\n module instance context links to the context owned by the VM context. The\n caller should __NOT__ call the `WasmEdge_ModuleInstanceDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns pointer to the module instance context. NULL if not found."] pub fn WasmEdge_VMGetActiveModule (Cxt : * const WasmEdge_VMContext) -> * const WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the registered module in VM by the module name.\n\n After registering a WASM module into the VM context, developers can call\n this function to get the module instance by the module name. The returned\n module instance context links to the context owned by the VM context, and\n the caller should __NOT__ call the `WasmEdge_ModuleInstanceDelete` to\n destroy it.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param ModuleName the module name WasmEdge_String.\n\n \\returns pointer to the module instance context. NULL if not found."] pub fn WasmEdge_VMGetRegisteredModule (Cxt : * const WasmEdge_VMContext , ModuleName : WasmEdge_String) -> * const WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Get the length of registered module list in the WasmEdge_VMContext.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns length of registered module list."] pub fn WasmEdge_VMListRegisteredModuleLength (Cxt : * const WasmEdge_VMContext) -> u32 ; } extern "C" { # [doc = " List the registered module names in the WasmEdge_VMContext.\n\n This function will list all registered module names.\n The returned module names filled into the `Names` array are linked to the\n registered module names in the VM context, and the caller should __NOT__\n call the `WasmEdge_StringDelete`.\n If the `Names` buffer length is smaller than the result of the registered\n named module list size, the overflowed return values will be discarded.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param [out] Names the output names WasmEdge_String buffer of the registered\n modules.\n \\param Len the buffer length.\n\n \\returns actual registered module list size."] pub fn WasmEdge_VMListRegisteredModule (Cxt : * const WasmEdge_VMContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Get the store context used in the WasmEdge_VMContext.\n\n The returned store context links to the store in the VM context and owned by\n the VM context. This function will return NULL if error occurs. The caller\n should __NOT__ call the `WasmEdge_StoreDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns pointer to the store context."] pub fn WasmEdge_VMGetStoreContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_StoreContext ; } extern "C" { # [doc = " Get the loader context used in the WasmEdge_VMContext.\n\n The returned loader context links to the loader in the VM context and owned\n by the VM context. This function will return NULL if error occurs. The\n caller should __NOT__ call the `WasmEdge_LoaderDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns pointer to the loader context."] pub fn WasmEdge_VMGetLoaderContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_LoaderContext ; } extern "C" { # [doc = " Get the validator context used in the WasmEdge_VMContext.\n\n The returned validator context links to the validator in the VM context and\n owned by the VM context. This function will return NULL if error occurs. The\n caller should __NOT__ call the `WasmEdge_ValidatorDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns pointer to the validator context."] pub fn WasmEdge_VMGetValidatorContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_ValidatorContext ; } extern "C" { # [doc = " Get the executor context used in the WasmEdge_VMContext.\n\n The returned executor context links to the executor in the VM context and\n owned by the VM context. This function will return NULL if error occurs. The\n caller should __NOT__ call the `WasmEdge_ExecutorDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns pointer to the executor context."] pub fn WasmEdge_VMGetExecutorContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_ExecutorContext ; } extern "C" { # [doc = " Get the statistics context used in the WasmEdge_VMContext.\n\n The statistics context links to the statistics in the VM context and owned\n by the VM context. The caller should __NOT__ call the\n `WasmEdge_StatisticsDelete`.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n\n \\returns pointer to the statistics context."] pub fn WasmEdge_VMGetStatisticsContext (Cxt : * mut WasmEdge_VMContext) -> * mut WasmEdge_StatisticsContext ; } extern "C" { # [doc = " Deletion of the WasmEdge_VMContext.\n\n After calling this function, the context will be destroyed and should\n __NOT__ be used.\n\n \\param Cxt the WasmEdge_VMContext to destroy."] pub fn WasmEdge_VMDelete (Cxt : * mut WasmEdge_VMContext) ; } extern "C" { # [doc = " Entrypoint for the compiler tool.\n\n This function provides an entrypoint to the WasmEdge AOT compiler tool with\n the command line arguments.\n\n \\param Argc the argument count.\n \\param Argv the argument vector.\n\n \\returns the execution status."] pub fn WasmEdge_Driver_Compiler (Argc : :: std :: os :: raw :: c_int , Argv : * mut * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } extern "C" { # [doc = " Entrypoint for the runtime tool.\n\n This function provides an entrypoint to the WasmEdge runtime tool with the\n command line arguments.\n\n \\param Argc the argument count.\n \\param Argv the argument vector.\n\n \\returns the execution status."] pub fn WasmEdge_Driver_Tool (Argc : :: std :: os :: raw :: c_int , Argv : * mut * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } extern "C" { # [doc = " Entrypoint for the unified tool.\n\n This function provides an entrypoint to the WasmEdge unified tool with the\n command line arguments.\n\n \\param Argc the argument count.\n \\param Argv the argument vector.\n\n \\returns the execution status."] pub fn WasmEdge_Driver_UniTool (Argc : :: std :: os :: raw :: c_int , Argv : * mut * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } extern "C" { # [doc = " Load plugins with the default search paths.\n\n The default paths are:\n   1. The environment variable \"WASMEDGE_PLUGIN_PATH\".\n   2. The \"../plugin/\" directory related to the WasmEdge installation path.\n   3. The \"wasmedge/\" directory under the library path if the WasmEdge is\n      installed under the \"/usr\"."] pub fn WasmEdge_PluginLoadWithDefaultPaths () ; } extern "C" { # [doc = " Load the plugin with the given file or directory.\n\n For the given file path, this function will load the plug-in.\n For the given directory path, this function will load the plug-ins under the\n directory recursively.\n\n \\param Path the path to plug-in file or directory."] pub fn WasmEdge_PluginLoadFromPath (Path : * const :: std :: os :: raw :: c_char) ; } extern "C" { # [doc = " Get the length of loaded plug-in list.\n\n \\returns length of loaded plug-in list."] pub fn WasmEdge_PluginListPluginsLength () -> u32 ; } extern "C" { # [doc = " List the loaded plug-ins with their names.\n\n The returned plug-in names filled into the `Names` array are owned by the\n internal WasmEdge plug-in storage, and the caller should __NOT__ call the\n `WasmEdge_StringDelete`.\n If the `Names` buffer length is smaller than the result of the loaded\n plug-in list size, the overflowed return values will be discarded.\n\n \\param [out] Names the output WasmEdge_String buffer of the function names.\n \\param Len the buffer length.\n\n \\returns actual loaded plug-in list size."] pub fn WasmEdge_PluginListPlugins (Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Find the loaded plug-in context by name.\n\n After loading the plug-ins from default paths or the given path, developers\n can use this API to retrieve the plug-in context by name. Then developers\n can create the module instance from the plug-in contexts.\n\n \\param Name the plug-in name WasmEdge_String.\n\n \\returns pointer to the plug-in context. NULL if the plug-in not found."] pub fn WasmEdge_PluginFind (Name : WasmEdge_String) -> * const WasmEdge_PluginContext ; } extern "C" { # [doc = " Get the plug-in name of the plug-in context.\n\n The returned string object is linked to the plug-in name of the plug-in\n context, and the caller should __NOT__ call the `WasmEdge_StringDelete`.\n\n \\param Cxt the WasmEdge_PluginContext.\n\n \\returns string object. Length will be 0 and Buf will be NULL if failed."] pub fn WasmEdge_PluginGetPluginName (Cxt : * const WasmEdge_PluginContext) -> WasmEdge_String ; } extern "C" { # [doc = " Get the length of module list in the plug-in context.\n\n There may be several modules in a plug-in. Developers can use this function\n to get the length of the module list in a plug-in.\n\n \\param Cxt the WasmEdge_PluginContext to get the length of the module list.\n\n \\returns length of module list."] pub fn WasmEdge_PluginListModuleLength (Cxt : * const WasmEdge_PluginContext) -> u32 ; } extern "C" { # [doc = " List the modules in the plug-in context with their names.\n\n The returned module names filled into the `Names` array are owned by the\n internal WasmEdge plug-in storage, and the caller should __NOT__ call the\n `WasmEdge_StringDelete`.\n If the `Names` buffer length is smaller than the result of the loaded\n plug-in list size, the overflowed return values will be discarded.\n\n \\param Cxt the WasmEdge_PluginContext to list the modules.\n \\param [out] Names the output WasmEdge_String buffer of the function names.\n \\param Len the buffer length.\n\n \\returns actual module list size of the plug-in."] pub fn WasmEdge_PluginListModule (Cxt : * const WasmEdge_PluginContext , Names : * mut WasmEdge_String , Len : u32) -> u32 ; } extern "C" { # [doc = " Create the module instance in the plug-in by the module name.\n\n By giving the module name, developers can retrieve the module in the plug-in\n and create the module instance.\n The caller owns the object and should call `WasmEdge_ModuleInstanceDelete`\n to destroy it.\n\n \\param Cxt the WasmEdge_PluginContext to retrieve and create module.\n \\param ModuleName the module name to retrieve.\n\n \\returns pointer to the module instance context, NULL if the module name not\n found in the plug-in or the plug-in is not valid."] pub fn WasmEdge_PluginCreateModule (Cxt : * const WasmEdge_PluginContext , ModuleName : WasmEdge_String) -> * mut WasmEdge_ModuleInstanceContext ; } extern "C" { # [doc = " Initialize the wasi_nn plug-in.\n\n This function will initialize the wasi_nn plug-in with the preloads string\n list. Only available after loading the wasi_nn plug-in and before creating\n the module instance from the plug-in.\n\n \\param NNPreloads the preload string list. NULL if the length is 0.\n \\param PreloadsLen the length of the preload list."] pub fn WasmEdge_PluginInitWASINN (NNPreloads : * const * const :: std :: os :: raw :: c_char , PreloadsLen : u32) ; } extern "C" { # [doc = " Implement by plugins for returning the plugin descriptor.\n\n \\returns the plugin descriptor."] pub fn WasmEdge_Plugin_GetDescriptor () -> * const WasmEdge_PluginDescriptor ; } extern "C" { # [doc = " Register a host function that will be invoked before executing any host\n functions.\n\n There is only one pre-host-function. After calling this function, the\n previous registered host function will be replaced. This is a experimental\n feature. Use it at your own risk.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_ExecutorContext.\n \\param Data the host data to set into the given host function. When calling\n the Func, this pointer will be the argument of the Func function.\n \\param Func the function to be invoked before executing any other host\n functions."] pub fn WasmEdge_ExecutorExperimentalRegisterPreHostFunction (Cxt : * mut WasmEdge_ExecutorContext , Data : * mut :: std :: os :: raw :: c_void , Func : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void) >) ; } extern "C" { # [doc = " Register a host function that will be invoked after executing any host\n functions.\n\n There is only one post-host-function. After calling this function, the\n previous registered host function will be replaced. This is a experimental\n feature. Use it at your own risk.\n\n This function is thread-safe.\n\n \\param Cxt the WasmEdge_VMContext.\n \\param Data the host data to set into the given host function. When calling\n the Func, this pointer will be the argument of the Func function.\n \\param Func the function to be invoked after executing any other host\n functions."] pub fn WasmEdge_ExecutorExperimentalRegisterPostHostFunction (Cxt : * mut WasmEdge_ExecutorContext , Data : * mut :: std :: os :: raw :: c_void , Func : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void) >) ; }
\ No newline at end of file diff --git a/src/wasmedge_sys/ast_module.rs.html b/src/wasmedge_sys/ast_module.rs.html new file mode 100644 index 000000000..5638a1c32 --- /dev/null +++ b/src/wasmedge_sys/ast_module.rs.html @@ -0,0 +1,2189 @@ +ast_module.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+
//! Defines WasmEdge AST Module, Export, and Import structs.
+
+use super::ffi;
+use crate::{types::WasmEdgeLimit, WasmEdgeResult};
+use std::{borrow::Cow, ffi::CStr, sync::Arc};
+use wasmedge_types::{
+    error::{ExportError, ImportError, WasmEdgeError},
+    ExternalInstanceType, FuncType, GlobalType, MemoryType, Mutability, RefType, TableType,
+    ValType,
+};
+
+/// Defines compiled in-memory representation of an input WASM binary.
+///
+/// [Module] is also called *AST Module* in WasmEdge terminology. A [Module] is a compiled in-memory
+/// representation of an input WebAssembly binary. In the instantiation process, a [Module] is used to create a
+/// [module stance](crate::instance), from which the exported [functions](crate::Function), [tables](crate::Table),
+/// [memories](crate::Memory), and [globals](crate::Global) can be fetched.
+#[derive(Debug, Clone)]
+pub struct Module {
+    pub(crate) inner: Arc<InnerModule>,
+}
+impl Drop for Module {
+    fn drop(&mut self) {
+        if Arc::strong_count(&self.inner) == 1 && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_ASTModuleDelete(self.inner.0) };
+        }
+    }
+}
+impl Module {
+    /// Returns the number of wasm imports in the [Module].
+    pub fn count_of_imports(&self) -> u32 {
+        unsafe { ffi::WasmEdge_ASTModuleListImportsLength(self.inner.0) }
+    }
+
+    /// Returns the types of wasm imports in the [Module].
+    pub fn imports(&self) -> Vec<ImportType<'_>> {
+        let size = self.count_of_imports();
+        let mut returns = Vec::with_capacity(size as usize);
+        unsafe {
+            ffi::WasmEdge_ASTModuleListImports(self.inner.0, returns.as_mut_ptr(), size);
+            returns.set_len(size as usize);
+        }
+
+        returns
+            .into_iter()
+            .map(|ctx| ImportType {
+                inner: InnerImportType(ctx),
+                module: self,
+            })
+            .collect()
+    }
+
+    /// Returns the count of wasm exports in the [Module].
+    pub fn count_of_exports(&self) -> u32 {
+        unsafe { ffi::WasmEdge_ASTModuleListExportsLength(self.inner.0) }
+    }
+
+    /// Returns the types of wasm exports in the [Module].
+    pub fn exports(&self) -> Vec<ExportType<'_>> {
+        let size = self.count_of_exports();
+        let mut returns = Vec::with_capacity(size as usize);
+        unsafe {
+            ffi::WasmEdge_ASTModuleListExports(self.inner.0, returns.as_mut_ptr(), size);
+            returns.set_len(size as usize);
+        }
+
+        returns
+            .into_iter()
+            .map(|ctx| ExportType {
+                inner: InnerExportType(ctx),
+                module: self,
+            })
+            .collect()
+    }
+
+    /// Provides a raw pointer to the inner ASTModule context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_FunctionTypeContext {
+        self.inner.0 as *const _
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerModule(pub(crate) *mut ffi::WasmEdge_ASTModuleContext);
+unsafe impl Send for InnerModule {}
+unsafe impl Sync for InnerModule {}
+
+/// Defines the types of the imported wasm value.
+#[derive(Debug)]
+pub struct ImportType<'module> {
+    pub(crate) inner: InnerImportType,
+    pub(crate) module: &'module Module,
+}
+impl<'module> Drop for ImportType<'module> {
+    fn drop(&mut self) {
+        if !self.inner.0.is_null() {
+            self.inner.0 = std::ptr::null();
+        }
+    }
+}
+impl<'module> ImportType<'module> {
+    /// Returns the type of this import.
+    pub fn ty(&self) -> WasmEdgeResult<ExternalInstanceType> {
+        let ty = unsafe { ffi::WasmEdge_ImportTypeGetExternalType(self.inner.0) };
+        let ty: ExternalInstanceType = ty.into();
+        match ty {
+            ExternalInstanceType::Func(_) => {
+                let ctx_func_ty = unsafe {
+                    ffi::WasmEdge_ImportTypeGetFunctionType(
+                        self.module.inner.0 as *const _,
+                        self.inner.0 as *const _,
+                    )
+                };
+                match ctx_func_ty.is_null() {
+                    true => Err(Box::new(WasmEdgeError::Import(ImportError::FuncType(
+                        "Fail to get the function type".into(),
+                    )))),
+                    false => {
+                        // get types of the arguments
+                        let args_len = unsafe {
+                            ffi::WasmEdge_FunctionTypeGetParametersLength(ctx_func_ty) as usize
+                        };
+                        let mut args = Vec::with_capacity(args_len);
+                        unsafe {
+                            ffi::WasmEdge_FunctionTypeGetParameters(
+                                ctx_func_ty,
+                                args.as_mut_ptr(),
+                                args_len as u32,
+                            );
+                            args.set_len(args_len);
+                        }
+                        let args: Vec<ValType> = args.into_iter().map(Into::into).collect();
+
+                        // get types of the returns
+                        let returns_len = unsafe {
+                            ffi::WasmEdge_FunctionTypeGetReturnsLength(ctx_func_ty) as usize
+                        };
+                        let mut returns = Vec::with_capacity(returns_len);
+                        unsafe {
+                            ffi::WasmEdge_FunctionTypeGetReturns(
+                                ctx_func_ty,
+                                returns.as_mut_ptr(),
+                                returns_len as u32,
+                            );
+                            returns.set_len(returns_len);
+                        }
+                        let returns: Vec<ValType> = returns.into_iter().map(Into::into).collect();
+
+                        Ok(ExternalInstanceType::Func(FuncType::new(
+                            Some(args),
+                            Some(returns),
+                        )))
+                    }
+                }
+            }
+            ExternalInstanceType::Global(_) => {
+                let ctx_global_ty = unsafe {
+                    ffi::WasmEdge_ImportTypeGetGlobalType(self.module.inner.0, self.inner.0)
+                };
+                match ctx_global_ty.is_null() {
+                    true => Err(Box::new(WasmEdgeError::Import(ImportError::MemType(
+                        "Fail to get the global type".into(),
+                    )))),
+                    false => {
+                        // get the value type
+                        let val = unsafe { ffi::WasmEdge_GlobalTypeGetValType(ctx_global_ty) };
+                        let val_ty: ValType = val.into();
+
+                        // get mutability
+                        let val = unsafe { ffi::WasmEdge_GlobalTypeGetMutability(ctx_global_ty) };
+                        let mutability: Mutability = val.into();
+
+                        Ok(ExternalInstanceType::Global(GlobalType::new(
+                            val_ty, mutability,
+                        )))
+                    }
+                }
+            }
+            ExternalInstanceType::Memory(_) => {
+                let ctx_mem_ty = unsafe {
+                    ffi::WasmEdge_ImportTypeGetMemoryType(self.module.inner.0, self.inner.0)
+                };
+                match ctx_mem_ty.is_null() {
+                    true => Err(Box::new(WasmEdgeError::Import(ImportError::MemType(
+                        "Fail to get the memory type".into(),
+                    )))),
+                    false => {
+                        let limit = unsafe { ffi::WasmEdge_MemoryTypeGetLimit(ctx_mem_ty) };
+                        let limit: WasmEdgeLimit = limit.into();
+
+                        Ok(ExternalInstanceType::Memory(MemoryType::new(
+                            limit.min(),
+                            limit.max(),
+                            limit.shared(),
+                        )?))
+                    }
+                }
+            }
+            ExternalInstanceType::Table(_) => {
+                let ctx_tab_ty = unsafe {
+                    ffi::WasmEdge_ImportTypeGetTableType(self.module.inner.0, self.inner.0)
+                };
+                match ctx_tab_ty.is_null() {
+                    true => Err(Box::new(WasmEdgeError::Import(ImportError::TableType(
+                        "Fail to get the table type".into(),
+                    )))),
+                    false => {
+                        // get the element type
+                        let elem_ty = unsafe { ffi::WasmEdge_TableTypeGetRefType(ctx_tab_ty) };
+                        let elem_ty: RefType = elem_ty.into();
+
+                        // get the limit
+                        let limit = unsafe { ffi::WasmEdge_TableTypeGetLimit(ctx_tab_ty) };
+                        let limit: WasmEdgeLimit = limit.into();
+
+                        Ok(ExternalInstanceType::Table(TableType::new(
+                            elem_ty,
+                            limit.min(),
+                            limit.max(),
+                        )))
+                    }
+                }
+            }
+        }
+    }
+
+    /// Returns the field name of the module that this import is expected to come from.
+    pub fn name(&self) -> Cow<'_, str> {
+        let c_name = unsafe {
+            let raw_name = ffi::WasmEdge_ImportTypeGetExternalName(self.inner.0);
+            CStr::from_ptr(raw_name.Buf)
+        };
+        c_name.to_string_lossy()
+    }
+
+    /// Returns the module name that this import is expected to come from.
+    pub fn module_name(&self) -> Cow<'_, str> {
+        let c_name = unsafe {
+            let raw_name = ffi::WasmEdge_ImportTypeGetModuleName(self.inner.0);
+            CStr::from_ptr(raw_name.Buf)
+        };
+        c_name.to_string_lossy()
+    }
+
+    /// Provides a raw pointer to the inner ImportType context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_ImportTypeContext {
+        self.inner.0 as *const _
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerImportType(pub(crate) *const ffi::WasmEdge_ImportTypeContext);
+unsafe impl Send for InnerImportType {}
+unsafe impl Sync for InnerImportType {}
+
+/// Defines the types of the exported wasm values.
+#[derive(Debug)]
+pub struct ExportType<'module> {
+    pub(crate) inner: InnerExportType,
+    pub(crate) module: &'module Module,
+}
+impl<'module> Drop for ExportType<'module> {
+    fn drop(&mut self) {
+        if !self.inner.0.is_null() {
+            self.inner.0 = std::ptr::null();
+        }
+    }
+}
+impl<'module> ExportType<'module> {
+    /// Returns the type of this export.
+    pub fn ty(&self) -> WasmEdgeResult<ExternalInstanceType> {
+        let ty = unsafe { ffi::WasmEdge_ExportTypeGetExternalType(self.inner.0) };
+        let ty: ExternalInstanceType = ty.into();
+        match ty {
+            ExternalInstanceType::Func(_) => {
+                let ctx_func_ty = unsafe {
+                    ffi::WasmEdge_ExportTypeGetFunctionType(self.module.inner.0, self.inner.0)
+                };
+                match ctx_func_ty.is_null() {
+                    true => Err(Box::new(WasmEdgeError::Export(ExportError::FuncType(
+                        "Fail to get the function type".into(),
+                    )))),
+                    false => {
+                        // get types of the arguments
+                        let args_len = unsafe {
+                            ffi::WasmEdge_FunctionTypeGetParametersLength(ctx_func_ty) as usize
+                        };
+                        let mut args = Vec::with_capacity(args_len);
+                        unsafe {
+                            ffi::WasmEdge_FunctionTypeGetParameters(
+                                ctx_func_ty,
+                                args.as_mut_ptr(),
+                                args_len as u32,
+                            );
+                            args.set_len(args_len);
+                        }
+                        let args: Vec<ValType> = args.into_iter().map(Into::into).collect();
+
+                        // get types of the returns
+                        let returns_len = unsafe {
+                            ffi::WasmEdge_FunctionTypeGetReturnsLength(ctx_func_ty) as usize
+                        };
+                        let mut returns = Vec::with_capacity(returns_len);
+                        unsafe {
+                            ffi::WasmEdge_FunctionTypeGetReturns(
+                                ctx_func_ty,
+                                returns.as_mut_ptr(),
+                                returns_len as u32,
+                            );
+                            returns.set_len(returns_len);
+                        }
+                        let returns: Vec<ValType> = returns.into_iter().map(Into::into).collect();
+
+                        Ok(ExternalInstanceType::Func(FuncType::new(
+                            Some(args),
+                            Some(returns),
+                        )))
+                    }
+                }
+            }
+            ExternalInstanceType::Table(_) => {
+                let ctx_tab_ty = unsafe {
+                    ffi::WasmEdge_ExportTypeGetTableType(self.module.inner.0, self.inner.0)
+                };
+                match ctx_tab_ty.is_null() {
+                    true => Err(Box::new(WasmEdgeError::Export(ExportError::TableType(
+                        "Fail to get the function type".into(),
+                    )))),
+                    false => {
+                        // get the element type
+                        let elem_ty = unsafe { ffi::WasmEdge_TableTypeGetRefType(ctx_tab_ty) };
+                        let elem_ty: RefType = elem_ty.into();
+
+                        // get the limit
+                        let limit = unsafe { ffi::WasmEdge_TableTypeGetLimit(ctx_tab_ty) };
+                        let limit: WasmEdgeLimit = limit.into();
+
+                        Ok(ExternalInstanceType::Table(TableType::new(
+                            elem_ty,
+                            limit.min(),
+                            limit.max(),
+                        )))
+                    }
+                }
+            }
+            ExternalInstanceType::Memory(_) => {
+                let ctx_mem_ty = unsafe {
+                    ffi::WasmEdge_ExportTypeGetMemoryType(self.module.inner.0, self.inner.0)
+                };
+                match ctx_mem_ty.is_null() {
+                    true => Err(Box::new(WasmEdgeError::Export(ExportError::MemType(
+                        "Fail to get the function type".into(),
+                    )))),
+                    false => {
+                        let limit = unsafe { ffi::WasmEdge_MemoryTypeGetLimit(ctx_mem_ty) };
+                        let limit: WasmEdgeLimit = limit.into();
+
+                        Ok(ExternalInstanceType::Memory(MemoryType::new(
+                            limit.min(),
+                            limit.max(),
+                            limit.shared(),
+                        )?))
+                    }
+                }
+            }
+            ExternalInstanceType::Global(_) => {
+                let ctx_global_ty = unsafe {
+                    ffi::WasmEdge_ExportTypeGetGlobalType(self.module.inner.0, self.inner.0)
+                };
+                match ctx_global_ty.is_null() {
+                    true => Err(Box::new(WasmEdgeError::Export(ExportError::GlobalType(
+                        "Fail to get the function type".into(),
+                    )))),
+                    false => {
+                        // get the value type
+                        let val = unsafe { ffi::WasmEdge_GlobalTypeGetValType(ctx_global_ty) };
+                        let val_ty: ValType = val.into();
+
+                        // get mutability
+                        let val = unsafe { ffi::WasmEdge_GlobalTypeGetMutability(ctx_global_ty) };
+                        let mutability: Mutability = val.into();
+
+                        Ok(ExternalInstanceType::Global(GlobalType::new(
+                            val_ty, mutability,
+                        )))
+                    }
+                }
+            }
+        }
+    }
+
+    /// Returns the name by which this export is known by.
+    pub fn name(&self) -> Cow<'_, str> {
+        let c_name = unsafe {
+            let raw_name = ffi::WasmEdge_ExportTypeGetExternalName(self.inner.0);
+            CStr::from_ptr(raw_name.Buf)
+        };
+        c_name.to_string_lossy()
+    }
+
+    /// Provides a raw pointer to the inner ExportType context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_ExportTypeContext {
+        self.inner.0 as *const _
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerExportType(pub(crate) *const ffi::WasmEdge_ExportTypeContext);
+unsafe impl Send for InnerExportType {}
+unsafe impl Sync for InnerExportType {}
+
+#[cfg(test)]
+mod tests {
+    use crate::{Config, Loader};
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_types::{ExternalInstanceType, Mutability, RefType, ValType};
+
+    #[ignore = "need to update `import.wat`"]
+    #[test]
+    fn test_module_clone() {
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/import.wat");
+
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.bulk_memory_operations(true);
+        assert!(config.bulk_memory_operations_enabled());
+
+        // load module from file
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+        let result = loader.from_file(path);
+        dbg!(&result);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+        assert!(!module.inner.0.is_null());
+
+        // clone module
+        let module_clone = module.clone();
+
+        drop(module);
+        assert_eq!(std::sync::Arc::strong_count(&module_clone.inner), 1);
+        drop(module_clone);
+    }
+
+    #[ignore = "need to update `import.wat`"]
+    #[test]
+    fn test_module_import() {
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/import.wat");
+
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.bulk_memory_operations(true);
+        assert!(config.bulk_memory_operations_enabled());
+
+        // load module from file
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+        let result = loader.from_file(path);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+        assert!(!module.inner.0.is_null());
+
+        // check imports
+
+        assert_eq!(module.count_of_imports(), 14);
+        let imports = module.imports();
+
+        // check the ty, name, and module_name functions
+        let result = imports[0].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Func(_));
+        assert_eq!(imports[0].name(), "func-add");
+        assert_eq!(imports[0].module_name(), "extern");
+
+        let result = imports[1].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(imports[1].name(), "func-sub");
+        assert_eq!(imports[1].module_name(), "extern");
+
+        let result = imports[2].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(imports[2].name(), "func-mul");
+        assert_eq!(imports[2].module_name(), "extern");
+
+        let result = imports[3].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(imports[3].name(), "func-div");
+        assert_eq!(imports[3].module_name(), "extern");
+
+        let result = imports[4].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(imports[4].name(), "func-term");
+        assert_eq!(imports[4].module_name(), "extern");
+
+        let result = imports[5].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(imports[5].name(), "func-fail");
+        assert_eq!(imports[5].module_name(), "extern");
+
+        let result = imports[6].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Global(_));
+        assert_eq!(imports[6].name(), "glob-i32");
+        assert_eq!(imports[6].module_name(), "dummy");
+
+        let result = imports[7].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Global(_));
+        assert_eq!(imports[7].name(), "glob-i64");
+        assert_eq!(imports[7].module_name(), "dummy");
+
+        let result = imports[8].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Global(_));
+        assert_eq!(imports[8].name(), "glob-f32");
+        assert_eq!(imports[8].module_name(), "dummy");
+
+        let result = imports[9].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Global(_));
+        assert_eq!(imports[9].name(), "glob-f64");
+        assert_eq!(imports[9].module_name(), "dummy");
+
+        let result = imports[10].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Table(_));
+        assert_eq!(imports[10].name(), "tab-func");
+        assert_eq!(imports[10].module_name(), "dummy");
+
+        let result = imports[11].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Table(_));
+        assert_eq!(imports[11].name(), "tab-ext");
+        assert_eq!(imports[11].module_name(), "dummy");
+
+        let result = imports[12].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Memory(_));
+        assert_eq!(imports[12].name(), "mem1");
+        assert_eq!(imports[12].module_name(), "dummy");
+
+        let result = imports[13].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Memory(_));
+        assert_eq!(imports[13].name(), "mem2");
+        assert_eq!(imports[13].module_name(), "dummy");
+
+        // check the function_type function
+        let result = imports[4].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Func(_));
+        if let ExternalInstanceType::Func(func_ty) = ty {
+            assert_eq!(func_ty.returns_len(), 1);
+        }
+
+        // check the table_type function
+        let result = imports[11].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Table(_));
+        if let ExternalInstanceType::Table(table_ty) = ty {
+            assert_eq!(table_ty.elem_ty(), RefType::ExternRef);
+            assert_eq!(table_ty.minimum(), 10);
+            assert_eq!(table_ty.maximum(), Some(30));
+        }
+
+        // check the memory_type function
+        let result = imports[13].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Memory(_));
+        if let ExternalInstanceType::Memory(mem_ty) = ty {
+            assert_eq!(mem_ty.minimum(), 2);
+            assert_eq!(mem_ty.maximum(), None);
+        }
+
+        // check the global_type function
+        let result = imports[7].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Global(_));
+        if let ExternalInstanceType::Global(global_ty) = ty {
+            assert_eq!(global_ty.value_ty(), ValType::I64);
+            assert_eq!(global_ty.mutability(), Mutability::Const);
+        }
+    }
+
+    #[ignore = "need to update `import.wat`"]
+    #[test]
+    fn test_module_export() {
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/import.wat");
+
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.bulk_memory_operations(true);
+        assert!(config.bulk_memory_operations_enabled());
+
+        // load module from file
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+        let result = loader.from_file(path);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+        assert!(!module.inner.0.is_null());
+
+        // check exports
+
+        assert_eq!(module.count_of_exports(), 16);
+        let exports = module.exports();
+
+        // check the ty and name functions
+        let result = exports[0].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[0].name(), "func-1");
+
+        let result = exports[1].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[1].name(), "func-2");
+
+        let result = exports[2].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[2].name(), "func-3");
+
+        let result = exports[3].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[3].name(), "func-4");
+
+        assert_eq!(module.count_of_exports(), 16);
+
+        let result = exports[4].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[4].name(), "func-add");
+
+        let result = exports[5].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[5].name(), "func-mul-2");
+
+        let result = exports[6].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[6].name(), "func-call-indirect");
+
+        let result = exports[7].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[7].name(), "func-host-add");
+
+        let result = exports[8].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[8].name(), "func-host-sub");
+
+        let result = exports[9].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[9].name(), "func-host-mul");
+
+        let result = exports[10].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Func(_));
+        assert_eq!(exports[10].name(), "func-host-div");
+
+        let result = exports[11].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Table(_));
+        assert_eq!(exports[11].name(), "tab-func");
+
+        let result = exports[12].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Table(_));
+        assert_eq!(exports[12].name(), "tab-ext");
+
+        let result = exports[13].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Memory(_));
+        assert_eq!(exports[13].name(), "mem");
+
+        let result = exports[14].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Global(_));
+        assert_eq!(exports[14].name(), "glob-mut-i32");
+
+        let result = exports[15].ty();
+        assert!(result.is_ok());
+        matches!(result.unwrap(), ExternalInstanceType::Global(_));
+        assert_eq!(exports[15].name(), "glob-const-f32");
+
+        // check the function_type function
+        let result = exports[4].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Func(_));
+        if let ExternalInstanceType::Func(func_ty) = ty {
+            assert_eq!(func_ty.args_len(), 2);
+            assert_eq!(func_ty.returns_len(), 1);
+        }
+
+        // check the table_type function
+        let result = exports[12].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Table(_));
+        if let ExternalInstanceType::Table(table_ty) = ty {
+            assert_eq!(table_ty.elem_ty(), RefType::ExternRef);
+            assert_eq!(table_ty.minimum(), 10);
+            assert_eq!(table_ty.maximum(), None);
+        }
+
+        // check the memory_type function
+        let result = exports[13].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Memory(_));
+        if let ExternalInstanceType::Memory(mem_ty) = ty {
+            assert_eq!(mem_ty.minimum(), 1);
+            assert_eq!(mem_ty.maximum(), Some(3));
+        }
+
+        // check the global_type function
+        let result = exports[15].ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        matches!(ty, ExternalInstanceType::Global(_));
+        if let ExternalInstanceType::Global(global_ty) = ty {
+            assert_eq!(global_ty.value_ty(), ValType::F32);
+            assert_eq!(global_ty.mutability(), Mutability::Const);
+        }
+    }
+
+    #[ignore = "need to update `import.wat`"]
+    #[test]
+    fn test_module_send() {
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/import.wat");
+
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.bulk_memory_operations(true);
+        assert!(config.bulk_memory_operations_enabled());
+
+        // load module from file
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+        let result = loader.from_file(path);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+        assert!(!module.inner.0.is_null());
+
+        let handle = thread::spawn(move || {
+            // check exports
+
+            assert_eq!(module.count_of_exports(), 16);
+            let exports = module.exports();
+
+            // check the ty and name functions
+            let result = exports[0].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[0].name(), "func-1");
+
+            let result = exports[1].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[1].name(), "func-2");
+
+            let result = exports[2].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[2].name(), "func-3");
+
+            let result = exports[3].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[3].name(), "func-4");
+
+            assert_eq!(module.count_of_exports(), 16);
+
+            let result = exports[4].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[4].name(), "func-add");
+
+            let result = exports[5].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[5].name(), "func-mul-2");
+
+            let result = exports[6].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[6].name(), "func-call-indirect");
+
+            let result = exports[7].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[7].name(), "func-host-add");
+
+            let result = exports[8].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[8].name(), "func-host-sub");
+
+            let result = exports[9].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[9].name(), "func-host-mul");
+
+            let result = exports[10].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[10].name(), "func-host-div");
+
+            let result = exports[11].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Table(_));
+            assert_eq!(exports[11].name(), "tab-func");
+
+            let result = exports[12].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Table(_));
+            assert_eq!(exports[12].name(), "tab-ext");
+
+            let result = exports[13].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Memory(_));
+            assert_eq!(exports[13].name(), "mem");
+
+            let result = exports[14].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Global(_));
+            assert_eq!(exports[14].name(), "glob-mut-i32");
+
+            let result = exports[15].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Global(_));
+            assert_eq!(exports[15].name(), "glob-const-f32");
+
+            // check the function_type function
+            let result = exports[4].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Func(_));
+            if let ExternalInstanceType::Func(func_ty) = ty {
+                assert_eq!(func_ty.args_len(), 2);
+                assert_eq!(func_ty.returns_len(), 1);
+            }
+
+            // check the table_type function
+            let result = exports[12].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Table(_));
+            if let ExternalInstanceType::Table(table_ty) = ty {
+                assert_eq!(table_ty.elem_ty(), RefType::ExternRef);
+                assert_eq!(table_ty.minimum(), 10);
+                assert_eq!(table_ty.maximum(), None);
+            }
+
+            // check the memory_type function
+            let result = exports[13].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Memory(_));
+            if let ExternalInstanceType::Memory(mem_ty) = ty {
+                assert_eq!(mem_ty.minimum(), 1);
+                assert_eq!(mem_ty.maximum(), Some(3));
+            }
+
+            // check the global_type function
+            let result = exports[15].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Global(_));
+            if let ExternalInstanceType::Global(global_ty) = ty {
+                assert_eq!(global_ty.value_ty(), ValType::F32);
+                assert_eq!(global_ty.mutability(), Mutability::Const);
+            }
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[ignore = "need to update `import.wat`"]
+    #[test]
+    fn test_module_sync() {
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/import.wat");
+
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.bulk_memory_operations(true);
+        assert!(config.bulk_memory_operations_enabled());
+
+        // load module from file
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+        let result = loader.from_file(path);
+        assert!(result.is_ok());
+        let module = Arc::new(Mutex::new(result.unwrap()));
+
+        let module_cloned = Arc::clone(&module);
+        let handle = thread::spawn(move || {
+            let result = module_cloned.lock();
+            assert!(result.is_ok());
+            let module = result.unwrap();
+
+            // check exports
+
+            assert_eq!(module.count_of_exports(), 16);
+            let exports = module.exports();
+
+            // check the ty and name functions
+            let result = exports[0].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[0].name(), "func-1");
+
+            let result = exports[1].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[1].name(), "func-2");
+
+            let result = exports[2].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[2].name(), "func-3");
+
+            let result = exports[3].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[3].name(), "func-4");
+
+            assert_eq!(module.count_of_exports(), 16);
+
+            let result = exports[4].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[4].name(), "func-add");
+
+            let result = exports[5].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[5].name(), "func-mul-2");
+
+            let result = exports[6].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[6].name(), "func-call-indirect");
+
+            let result = exports[7].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[7].name(), "func-host-add");
+
+            let result = exports[8].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[8].name(), "func-host-sub");
+
+            let result = exports[9].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[9].name(), "func-host-mul");
+
+            let result = exports[10].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Func(_));
+            assert_eq!(exports[10].name(), "func-host-div");
+
+            let result = exports[11].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Table(_));
+            assert_eq!(exports[11].name(), "tab-func");
+
+            let result = exports[12].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Table(_));
+            assert_eq!(exports[12].name(), "tab-ext");
+
+            let result = exports[13].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Memory(_));
+            assert_eq!(exports[13].name(), "mem");
+
+            let result = exports[14].ty();
+            assert!(result.is_ok());
+            matches!(result.unwrap(), ExternalInstanceType::Global(_));
+            assert_eq!(exports[14].name(), "glob-mut-i32");
+
+            let result = exports[15].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Global(_));
+            assert_eq!(exports[15].name(), "glob-const-f32");
+
+            // check the function_type function
+            let result = exports[4].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Func(_));
+            if let ExternalInstanceType::Func(func_ty) = ty {
+                assert_eq!(func_ty.args_len(), 2);
+                assert_eq!(func_ty.returns_len(), 1);
+            }
+
+            // check the table_type function
+            let result = exports[12].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Table(_));
+            if let ExternalInstanceType::Table(table_ty) = ty {
+                assert_eq!(table_ty.elem_ty(), RefType::ExternRef);
+                assert_eq!(table_ty.minimum(), 10);
+                assert_eq!(table_ty.maximum(), None);
+            }
+
+            // check the memory_type function
+            let result = exports[13].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Memory(_));
+            if let ExternalInstanceType::Memory(mem_ty) = ty {
+                assert_eq!(mem_ty.minimum(), 1);
+                assert_eq!(mem_ty.maximum(), Some(3));
+            }
+
+            // check the global_type function
+            let result = exports[15].ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            matches!(ty, ExternalInstanceType::Global(_));
+            if let ExternalInstanceType::Global(global_ty) = ty {
+                assert_eq!(global_ty.value_ty(), ValType::F32);
+                assert_eq!(global_ty.mutability(), Mutability::Const);
+            }
+        });
+
+        handle.join().unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/compiler.rs.html b/src/wasmedge_sys/compiler.rs.html new file mode 100644 index 000000000..762b5a362 --- /dev/null +++ b/src/wasmedge_sys/compiler.rs.html @@ -0,0 +1,1191 @@ +compiler.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+
//! Defines WasmEdge ahead-of-time compiler.
+
+use crate::{ffi, utils, utils::check, Config, WasmEdgeResult};
+use std::path::Path;
+use wasmedge_types::error::WasmEdgeError;
+
+/// Defines WasmEdge ahead-of-time(AOT) compiler and the relevant APIs.
+#[derive(Debug)]
+pub struct Compiler {
+    pub(crate) inner: InnerCompiler,
+}
+impl Drop for Compiler {
+    fn drop(&mut self) {
+        if !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_CompilerDelete(self.inner.0) }
+        }
+    }
+}
+impl Compiler {
+    /// Creates a new AOT [compiler](crate::Compiler).
+    ///
+    /// # Error
+    ///
+    /// If fail to create a AOT [compiler](crate::Compiler), then an error is returned.
+    pub fn create(config: Option<&Config>) -> WasmEdgeResult<Self> {
+        let ctx = match config {
+            Some(config) => unsafe { ffi::WasmEdge_CompilerCreate(config.inner.0) },
+            None => unsafe { ffi::WasmEdge_CompilerCreate(std::ptr::null_mut()) },
+        };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::CompilerCreate)),
+            false => Ok(Self {
+                inner: InnerCompiler(ctx),
+            }),
+        }
+    }
+
+    /// Compiles the input WASM from the given file path for the AOT mode and stores the result to the output file path.
+    ///
+    /// # Arguments
+    ///
+    /// * `wasm_file` - The input wasm file, of which the file extension should be one of `wasm` or`wat`.
+    ///
+    /// * `aot_file` - The generated AOT wasm file, of which the file extension should be `dylib` on macOS, `so` on Linux or `dll` on Windows.
+    ///
+    /// # Error
+    ///
+    /// If fail to compile, then an error is returned.
+    pub fn compile_from_file(
+        &self,
+        wasm_file: impl AsRef<Path>,
+        aot_file: impl AsRef<Path>,
+    ) -> WasmEdgeResult<()> {
+        match wasm_file.as_ref().extension() {
+            Some(extension) => match extension.to_str() {
+                Some("wasm") => self.compile_from_wasm_file(wasm_file, aot_file),
+                Some("wat") => {
+                    let bytes = wat::parse_file(wasm_file.as_ref())
+                        .map_err(|_| WasmEdgeError::Operation("Failed to parse wat file".into()))?;
+                    self.compile_from_bytes(bytes, aot_file)
+                }
+                _ => Err(Box::new(WasmEdgeError::Operation(
+                    "The wasm file's extension should be `wasm` or `wat`".into(),
+                ))),
+            },
+            None => Err(Box::new(WasmEdgeError::Operation(
+                "The wasm file's extension should be `wasm` or `wat`".into(),
+            ))),
+        }
+    }
+
+    fn compile_from_wasm_file(
+        &self,
+        wasm_file: impl AsRef<Path>,
+        aot_file: impl AsRef<Path>,
+    ) -> WasmEdgeResult<()> {
+        let in_path = utils::path_to_cstring(wasm_file.as_ref())?;
+        let out_path = utils::path_to_cstring(aot_file.as_ref())?;
+        unsafe {
+            check(ffi::WasmEdge_CompilerCompile(
+                self.inner.0,
+                in_path.as_ptr(),
+                out_path.as_ptr(),
+            ))
+        }
+    }
+
+    /// Compiles the input WASM from the given bytes for the AOT mode and stores the result to the output file path.
+    ///
+    /// # Argument
+    ///
+    /// * `wasm_bytes` - The in-memory WASM bytes.
+    ///
+    /// * `aot_file` - The generated AOT wasm file, of which the file extension should be `dylib` on macOS, `so` on Linux or `dll` on Windows.
+    ///
+    /// # Error
+    ///
+    /// If fail to compile, then an error is returned.
+    pub fn compile_from_bytes(
+        &self,
+        wasm_bytes: impl AsRef<[u8]>,
+        aot_file: impl AsRef<Path>,
+    ) -> WasmEdgeResult<()> {
+        let out_path = utils::path_to_cstring(aot_file.as_ref())?;
+        unsafe {
+            let ptr = libc::malloc(wasm_bytes.as_ref().len());
+            let dst = ::core::slice::from_raw_parts_mut(
+                ptr.cast::<std::mem::MaybeUninit<u8>>(),
+                wasm_bytes.as_ref().len(),
+            );
+            let src = ::core::slice::from_raw_parts(
+                wasm_bytes
+                    .as_ref()
+                    .as_ptr()
+                    .cast::<std::mem::MaybeUninit<u8>>(),
+                wasm_bytes.as_ref().len(),
+            );
+            dst.copy_from_slice(src);
+
+            check(ffi::WasmEdge_CompilerCompileFromBuffer(
+                self.inner.0,
+                ptr as *const u8,
+                wasm_bytes.as_ref().len() as u64,
+                out_path.as_ptr(),
+            ))?;
+
+            libc::free(ptr);
+        }
+
+        Ok(())
+    }
+
+    /// Provides a raw pointer to the inner Compiler context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_CompilerContext {
+        self.inner.0 as *const _
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerCompiler(pub(crate) *mut ffi::WasmEdge_CompilerContext);
+unsafe impl Send for InnerCompiler {}
+unsafe impl Sync for InnerCompiler {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        AsImport, CallingFrame, Compiler, Config, Executor, FuncType, Function, ImportModule,
+        Loader, Store, Validator, WasmValue,
+    };
+    use std::{
+        io::Read,
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_macro::sys_host_function;
+    use wasmedge_types::{
+        error::{CoreError, CoreLoadError, HostFuncError},
+        wat2wasm, CompilerOptimizationLevel, CompilerOutputFormat, NeverType,
+    };
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_compiler() {
+        {
+            let result = Config::create();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+
+            // create a AOT Compiler without configuration
+            let result = Compiler::create(None);
+            assert!(result.is_ok());
+
+            // create a AOT Compiler with a given configuration
+            let result = Compiler::create(Some(&config));
+            assert!(result.is_ok());
+            let compiler = result.unwrap();
+
+            // compile a file for universal WASM output format
+            let in_path = std::env::current_dir()
+                .unwrap()
+                .ancestors()
+                .nth(2)
+                .unwrap()
+                .join("examples/wasmedge-sys/data/fibonacci.wat");
+            #[cfg(target_os = "linux")]
+            let out_path = std::path::PathBuf::from("test_aot.so");
+            #[cfg(target_os = "macos")]
+            let out_path = std::path::PathBuf::from("test_aot.dylib");
+            #[cfg(target_os = "windows")]
+            let out_path = std::path::PathBuf::from("test_aot.dll");
+            assert!(!out_path.exists());
+            let result = compiler.compile_from_file(in_path, &out_path);
+            assert!(result.is_ok());
+            assert!(out_path.exists());
+            assert!(std::fs::remove_file(out_path).is_ok());
+
+            // compile a virtual file
+            let result = compiler.compile_from_file("not_exist.wasm", "not_exist_ast.wasm");
+            assert!(result.is_err());
+            assert_eq!(
+                result.unwrap_err(),
+                Box::new(WasmEdgeError::Core(CoreError::Load(
+                    CoreLoadError::IllegalPath
+                )))
+            );
+        }
+
+        {
+            let result = Config::create();
+            assert!(result.is_ok());
+            let mut config = result.unwrap();
+            // compile file for shared library output format
+            config.set_aot_compiler_output_format(CompilerOutputFormat::Native);
+
+            let result = Compiler::create(Some(&config));
+            assert!(result.is_ok());
+            let compiler = result.unwrap();
+            let in_path = std::env::current_dir()
+                .unwrap()
+                .ancestors()
+                .nth(2)
+                .unwrap()
+                .join("examples/wasmedge-sys/data/fibonacci.wat");
+            #[cfg(target_os = "linux")]
+            let out_path = std::path::PathBuf::from("test_aot_from_file.so");
+            #[cfg(target_os = "macos")]
+            let out_path = std::path::PathBuf::from("test_aot_from_file.dylib");
+            #[cfg(target_os = "windows")]
+            let out_path = std::path::PathBuf::from("test_aot_from_file.dll");
+            assert!(!out_path.exists());
+            let result = compiler.compile_from_file(in_path, &out_path);
+            assert!(result.is_ok());
+            assert!(out_path.exists());
+
+            // read buffer
+            let result = std::fs::File::open(&out_path);
+            assert!(result.is_ok());
+            let mut f = result.unwrap();
+            let mut buffer = [0u8; 4];
+            let result = f.read(&mut buffer);
+            assert!(result.is_ok());
+            let wasm_magic: [u8; 4] = [0x00, 0x61, 0x73, 0x6D];
+            assert_ne!(buffer, wasm_magic);
+
+            // cleanup
+            assert!(std::fs::remove_file(out_path).is_ok());
+        }
+
+        {
+            let result = wat2wasm(
+                br#"(module
+                    (type (;0;) (func (param i32) (result i32)))
+                    (type (;1;) (func))
+                    (func (;0;) (type 0) (param i32) (result i32)
+                      (local i32 i32 i32)
+                      i32.const 1
+                      local.set 1
+                      block  ;; label = @1
+                        local.get 0
+                        i32.const 2
+                        i32.lt_s
+                        br_if 0 (;@1;)
+                        local.get 0
+                        i32.const -1
+                        i32.add
+                        local.tee 1
+                        i32.const 7
+                        i32.and
+                        local.set 2
+                        block  ;; label = @2
+                          block  ;; label = @3
+                            local.get 0
+                            i32.const -2
+                            i32.add
+                            i32.const 7
+                            i32.ge_u
+                            br_if 0 (;@3;)
+                            i32.const 1
+                            local.set 0
+                            i32.const 1
+                            local.set 1
+                            br 1 (;@2;)
+                          end
+                          local.get 1
+                          i32.const -8
+                          i32.and
+                          local.set 3
+                          i32.const 1
+                          local.set 0
+                          i32.const 1
+                          local.set 1
+                          loop  ;; label = @3
+                            local.get 1
+                            local.get 0
+                            i32.add
+                            local.tee 0
+                            local.get 1
+                            i32.add
+                            local.tee 1
+                            local.get 0
+                            i32.add
+                            local.tee 0
+                            local.get 1
+                            i32.add
+                            local.tee 1
+                            local.get 0
+                            i32.add
+                            local.tee 0
+                            local.get 1
+                            i32.add
+                            local.tee 1
+                            local.get 0
+                            i32.add
+                            local.tee 0
+                            local.get 1
+                            i32.add
+                            local.set 1
+                            local.get 3
+                            i32.const -8
+                            i32.add
+                            local.tee 3
+                            br_if 0 (;@3;)
+                          end
+                        end
+                        local.get 2
+                        i32.eqz
+                        br_if 0 (;@1;)
+                        local.get 1
+                        local.set 3
+                        loop  ;; label = @2
+                          local.get 3
+                          local.get 0
+                          i32.add
+                          local.set 1
+                          local.get 3
+                          local.set 0
+                          local.get 1
+                          local.set 3
+                          local.get 2
+                          i32.const -1
+                          i32.add
+                          local.tee 2
+                          br_if 0 (;@2;)
+                        end
+                      end
+                      local.get 1)
+                    (func (;1;) (type 1))
+                    (func (;2;) (type 1)
+                      call 1
+                      call 1)
+                    (func (;3;) (type 0) (param i32) (result i32)
+                      local.get 0
+                      call 0
+                      call 2)
+                    (table (;0;) 1 1 funcref)
+                    (memory (;0;) 16)
+                    (global (;0;) (mut i32) (i32.const 1048576))
+                    (export "memory" (memory 0))
+                    (export "fib" (func 3)))
+              "#,
+            );
+            assert!(result.is_ok());
+            let wasm_bytes = result.unwrap();
+
+            let result = Config::create();
+            assert!(result.is_ok());
+            let mut config = result.unwrap();
+            config.set_aot_optimization_level(CompilerOptimizationLevel::O0);
+            config.set_aot_compiler_output_format(CompilerOutputFormat::Native);
+
+            let result = Compiler::create(Some(&config));
+            assert!(result.is_ok());
+            let compiler = result.unwrap();
+            #[cfg(target_os = "linux")]
+            let out_path = std::path::PathBuf::from("test_aot_from_bytes.so");
+            #[cfg(target_os = "macos")]
+            let out_path = std::path::PathBuf::from("test_aot_from_bytes.dylib");
+            #[cfg(target_os = "windows")]
+            let out_path = std::path::PathBuf::from("test_aot_from_bytes.dll");
+            assert!(!out_path.exists());
+            let result = compiler.compile_from_bytes(wasm_bytes, &out_path);
+            assert!(result.is_ok());
+            assert!(out_path.exists());
+
+            // cleanup
+            assert!(std::fs::remove_file(out_path).is_ok());
+        }
+    }
+
+    #[test]
+    #[ignore]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_compiler_send() {
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        // create a AOT Compiler without configuration
+        let result = Compiler::create(None);
+        assert!(result.is_ok());
+
+        // create a AOT Compiler with a given configuration
+        let result = Compiler::create(Some(&config));
+        assert!(result.is_ok());
+        let compiler = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            // compile a file for universal WASM output format
+            let in_path = std::env::current_dir()
+                .unwrap()
+                .join("examples/data/fibonacci.wat");
+            #[cfg(target_os = "linux")]
+            let out_path = std::path::PathBuf::from("test_aot_fib_send.so");
+            #[cfg(target_os = "macos")]
+            let out_path = std::path::PathBuf::from("test_aot_fib_send.dylib");
+            #[cfg(target_os = "windows")]
+            let out_path = std::path::PathBuf::from("test_aot_fib_send.dll");
+            assert!(!out_path.exists());
+            let result = compiler.compile_from_file(in_path, &out_path);
+            assert!(result.is_ok());
+            assert!(out_path.exists());
+            assert!(std::fs::remove_file(out_path).is_ok());
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[ignore]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_compiler_sync() {
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        // create a AOT Compiler without configuration
+        let result = Compiler::create(None);
+        assert!(result.is_ok());
+
+        // create a AOT Compiler with a given configuration
+        let result = Compiler::create(Some(&config));
+        assert!(result.is_ok());
+        let compiler = Arc::new(Mutex::new(result.unwrap()));
+
+        let compiler_cloned = Arc::clone(&compiler);
+        let handle = thread::spawn(move || {
+            let result = compiler_cloned.lock();
+            assert!(result.is_ok());
+            let compiler = result.unwrap();
+
+            // compile a file for universal WASM output format
+            let in_path = std::env::current_dir()
+                .unwrap()
+                .join("examples/data/fibonacci.wat");
+            let out_path = std::path::PathBuf::from("fibonacci_sync_thread_aot.wasm");
+            assert!(!out_path.exists());
+            let result = compiler.compile_from_file(in_path, &out_path);
+            assert!(result.is_ok());
+            assert!(out_path.exists());
+            assert!(std::fs::remove_file(out_path).is_ok());
+        });
+
+        {
+            let result = compiler.lock();
+            assert!(result.is_ok());
+            let compiler_main = result.unwrap();
+            // compile a file for universal WASM output format
+            let in_path = std::env::current_dir()
+                .unwrap()
+                .join("examples/data/fibonacci.wat");
+            #[cfg(target_os = "linux")]
+            let out_path = std::path::PathBuf::from("test_aot_fib_sync.so");
+            #[cfg(target_os = "macos")]
+            let out_path = std::path::PathBuf::from("test_aot_fib_sync.dylib");
+            #[cfg(target_os = "windows")]
+            let out_path = std::path::PathBuf::from("test_aot_fib_sync.dll");
+            assert!(!out_path.exists());
+            let result = compiler_main.compile_from_file(in_path, &out_path);
+            assert!(result.is_ok());
+            assert!(out_path.exists());
+            assert!(std::fs::remove_file(out_path).is_ok());
+        }
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    fn test_aot() -> Result<(), Box<dyn std::error::Error>> {
+        // create a Config context
+        let mut config = Config::create()?;
+        // enable options
+        config.tail_call(true);
+        config.annotations(true);
+        config.memory64(true);
+        config.threads(true);
+        config.exception_handling(true);
+        config.function_references(true);
+        config.set_aot_optimization_level(CompilerOptimizationLevel::O0);
+        config.set_aot_compiler_output_format(CompilerOutputFormat::Native);
+        config.interruptible(true);
+
+        // create an executor
+        let mut executor = Executor::create(Some(&config), None)?;
+
+        // create a store
+        let mut store = Store::create()?;
+
+        let import = create_spec_test_module();
+        executor.register_import_module(&mut store, &import)?;
+
+        // set the AOT compiler options
+        let result = Compiler::create(Some(&config));
+        assert!(result.is_ok());
+        let compiler = result.unwrap();
+
+        // compile a file for universal WASM output format
+        let in_path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+        #[cfg(target_os = "macos")]
+        let out_path = std::path::PathBuf::from("fibonacci_aot.dylib");
+        #[cfg(target_os = "linux")]
+        let out_path = std::path::PathBuf::from("fibonacci_aot.so");
+        #[cfg(target_os = "windows")]
+        let out_path = std::path::PathBuf::from("fibonacci_aot.dll");
+        assert!(!out_path.exists());
+        let result = compiler.compile_from_file(in_path, &out_path);
+        assert!(result.is_ok());
+        assert!(out_path.exists());
+
+        {
+            // register the wasm module as named module
+            let extern_module = Loader::create(Some(&config))?.from_file(&out_path)?;
+            Validator::create(Some(&config))?.validate(&extern_module)?;
+            let extern_instance =
+                executor.register_named_module(&mut store, &extern_module, "extern")?;
+
+            let fib = extern_instance.get_func("fib")?;
+            let returns = executor.call_func(&fib, [WasmValue::from_i32(5)])?;
+            assert_eq!(returns[0].to_i32(), 8);
+        }
+
+        {
+            // register the wasm module as active module
+            let active_module = Loader::create(Some(&config))?.from_file(&out_path)?;
+            Validator::create(Some(&config))?.validate(&active_module)?;
+            let active_instance = executor.register_active_module(&mut store, &active_module)?;
+
+            let fib = active_instance.get_func("fib")?;
+            let returns = executor.call_func(&fib, [WasmValue::from_i32(5)])?;
+            assert_eq!(returns[0].to_i32(), 8);
+        }
+
+        // remove the wasm file by the compiler
+        assert!(std::fs::remove_file(&out_path).is_ok());
+
+        Ok(())
+    }
+
+    #[cfg(feature = "aot")]
+    fn create_spec_test_module() -> ImportModule<NeverType> {
+        // create an ImportObj module
+        let result = ImportModule::<NeverType>::create("spectest", None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        // create a host function
+        let result = FuncType::create([], []);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result =
+            Function::create_sync_func::<NeverType>(&func_ty, Box::new(spec_test_print), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+        // add host function "print"
+        import.add_func("print", host_func);
+        import
+    }
+
+    #[cfg(feature = "aot")]
+    #[sys_host_function]
+    fn spec_test_print(
+        _frame: CallingFrame,
+        _inputs: Vec<WasmValue>,
+    ) -> Result<Vec<WasmValue>, HostFuncError> {
+        Ok(vec![])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/config.rs.html b/src/wasmedge_sys/config.rs.html new file mode 100644 index 000000000..b8404bf72 --- /dev/null +++ b/src/wasmedge_sys/config.rs.html @@ -0,0 +1,2261 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+
//! Defines WasmEdge Config struct.
+
+use crate::{ffi, WasmEdgeResult};
+use wasmedge_types::error::WasmEdgeError;
+#[cfg(feature = "aot")]
+use wasmedge_types::{CompilerOptimizationLevel, CompilerOutputFormat};
+
+/// Defines Config struct used to check/set the configuration options.
+///
+/// [Config](crate::Config) manages the configuration options, which are used to initiate [Loader](crate::Loader), [Validator](crate::Validator), [Executor](crate::Executor), and [Compiler](crate::Compiler).
+///
+/// The configuration options are categorized into the following four groups:
+///
+/// - **WebAssembly Proposals**
+///
+///     This group of options are used to turn on/off the WebAssembly proposals. They are effective to any WasmEdge
+///     context created with [Config](crate::Config).
+///     
+///     - `MultiMemories` enables to use multiple memories within a single Wasm module.
+///
+///       Also see [Multiple Memories for Wasm](https://github.com/WebAssembly/multi-memory/blob/main/proposals/multi-memory/Overview.md)
+///     
+///     - `ImportExportMutGlobals` supports mutable imported and exported globals.
+///
+///       Also see [Import/Export Mutable Globals Proposal](https://github.com/WebAssembly/mutable-global/blob/master/proposals/mutable-global/Overview.md#importexport-mutable-globals).
+///
+///     - `NonTrapFloatToIntConversions` supports the non-trapping float-to-int conversion.
+///
+///       Also see [Non-trapping Float-to-int Conversions Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/nontrapping-float-to-int-conversion/Overview.md).
+///
+///     - `SignExtensionOperators` supports new integer instructions for sign-extending 8-bit, 16-bit, and 32-bit values.
+///     
+///       Also see [Sign-extension Operators Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/sign-extension-ops/Overview.md).
+///
+///     - `MultiValue` supports functions and instructions with multiple return values, and blocks with inputs.
+///     
+///       Also see [Multi-value Extension](https://github.com/WebAssembly/spec/blob/main/proposals/multi-value/Overview.md).
+///
+///     - `BulkMemoryOperations` supports bulk memory operations.
+///
+///       Also see [Bulk Memory Operations Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/bulk-memory-operations/Overview.md#motivation-for-bulk-memory-operations).
+///
+///     - `ReferenceTypes` supports reference types.
+///
+///       Also see [Reference Types Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/reference-types/Overview.md).
+///
+///     - `SIMD` supports 128-bit packed SIMD extension to WebAssembly.
+///
+///       Also see [SIMD Proposal](https://github.com/WebAssembly/spec/blob/main/proposals/simd/SIMD.md).
+///  
+///     - `TailCall` supports tail call optimization.
+///
+///       Also see [Tail Call Proposal](https://github.com/WebAssembly/tail-call/blob/master/proposals/tail-call/Overview.md).
+///
+///     - `Annotations` supports annotations in WASM text format.
+///
+///       Also see [Annotations Proposal](https://github.com/WebAssembly/annotations/blob/master/proposals/annotations/Overview.md).
+///
+///     - `Memory64` supports 64-bit memory indexes.
+///
+///       Also see [Memory64 Proposal](https://github.com/WebAssembly/memory64/blob/main/proposals/memory64/Overview.md).
+///
+///     - `Threads` supports threading feature.
+///
+///       Also see [Threading Proposal](https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md).
+///
+///     - `ExceptionHandling` supports exception handling.
+///     
+///       Also see [Exception Handling Proposal](https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md).
+///
+///     - `FunctionReferences` supports typed function references for WebAssembly.
+///
+///       Also see [Function References Proposal](https://github.com/WebAssembly/function-references/blob/master/proposals/function-references/Overview.md).
+///
+/// - **Host Registrations**
+///     - `Wasi` turns on the `WASI` support.
+///
+///     - `WasmEdgeProcess` turns on the `wasmedge_process` support.
+///     
+/// - **Memory Management**
+///     - `maximum_memory_page` limits the page size of [Memory](crate::Memory).
+///
+/// - **AOT Compilation**
+///
+///     The AOT compiler options configure the behavior about optimization level, output format, dump IR,
+///     and generic binary.
+///
+///     - Compiler Optimization Levels
+///         - `O0` performs as many optimizations as possible.
+///         
+///         - `O1` optimizes quickly without destroying debuggability.
+///
+///         - `02` optimizes for fast execution as much as possible without triggering significant incremental
+///                compile time or code size growth.
+///
+///         - `O3` optimizes for fast execution as much as possible.
+///
+///         - `Os` optimizes for small code size as much as possible without triggering significant incremental
+///                compile time or execution time slowdowns.
+///
+///         - `Oz` optimizes for small code size as much as possible.
+///
+///     - Compiler Output Formats
+///         - `Native` specifies the output format is native dynamic library (`*.wasm.so`).
+///
+///         - `Wasm` specifies the output format is WebAssembly with AOT compiled codes in custom section (`*.wasm`).
+///     
+///     - `dump_ir` determines if AOT compiler generates IR or not.
+///
+///     - `generic_binary` determines if AOT compiler generates the generic binary or not.
+///     
+///     - `interruptible` determines if AOT compiler generates interruptible binary or not.
+///     
+///     The configuration options above are only effective to [Compiler](crate::Compiler).
+///
+/// - **Runtime Statistics**
+///     - `instr_counting` determines if measuring the count of instructions when running a compiled or pure WASM.
+///
+///     - `cost_measuring` determines if measuring the instruction costs when running a compiled or pure WASM.
+///
+///     - `time_measuring` determines if measuring the running time when running a compiled or pure WASM.
+///
+/// API users can first set the options of interest, such as those related to the WebAssembly proposals,
+/// host registrations, AOT compiler options, and etc., then apply the configuration
+/// to create other WasmEdge runtime structs.
+#[derive(Debug, Clone)]
+pub struct Config {
+    pub(crate) inner: std::sync::Arc<InnerConfig>,
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    async_wasi_enabled: bool,
+}
+impl Drop for Config {
+    fn drop(&mut self) {
+        if std::sync::Arc::strong_count(&self.inner) == 1 && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_ConfigureDelete(self.inner.0) };
+        }
+    }
+}
+impl Config {
+    /// Creates a new [Config](crate::Config).
+    ///
+    /// # Error
+    ///
+    /// If fail to create, then an error is returned.
+    pub fn create() -> WasmEdgeResult<Self> {
+        let ctx = unsafe { ffi::WasmEdge_ConfigureCreate() };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::ConfigCreate)),
+            false => Ok(Self {
+                inner: std::sync::Arc::new(InnerConfig(ctx)),
+                #[cfg(all(feature = "async", target_os = "linux"))]
+                async_wasi_enabled: false,
+            }),
+        }
+    }
+
+    /// Enables or disables host registration wasi. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+
+    pub fn wasi(&mut self, enable: bool) {
+        #[cfg(not(feature = "async"))]
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddHostRegistration(
+                    self.inner.0,
+                    ffi::WasmEdge_HostRegistration_Wasi,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveHostRegistration(
+                    self.inner.0,
+                    ffi::WasmEdge_HostRegistration_Wasi,
+                )
+            }
+        }
+        #[cfg(all(feature = "async", target_os = "linux"))]
+        {
+            self.async_wasi_enabled = enable;
+        }
+    }
+
+    /// Checks if host registration wasi turns on or not.
+
+    pub fn wasi_enabled(&self) -> bool {
+        #[cfg(not(feature = "async"))]
+        unsafe {
+            ffi::WasmEdge_ConfigureHasHostRegistration(
+                self.inner.0,
+                ffi::WasmEdge_HostRegistration_Wasi,
+            )
+        }
+        #[cfg(all(feature = "async", target_os = "linux"))]
+        {
+            self.async_wasi_enabled
+        }
+    }
+
+    /// Sets the maximum number of the memory pages available.
+    ///
+    /// # Argument
+    ///
+    /// * `count` - The page count (64KB per page).
+    pub fn set_max_memory_pages(&mut self, count: u32) {
+        unsafe { ffi::WasmEdge_ConfigureSetMaxMemoryPage(self.inner.0, count) }
+    }
+
+    /// Returns the number of the memory pages available.
+    pub fn get_max_memory_pages(&self) -> u32 {
+        unsafe { ffi::WasmEdge_ConfigureGetMaxMemoryPage(self.inner.0) }
+    }
+
+    /// Enables or disables the ImportExportMutGlobals option. By default, the option is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn mutable_globals(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_ImportExportMutGlobals,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_ImportExportMutGlobals,
+                )
+            }
+        }
+    }
+
+    /// Checks if the ImportExportMutGlobals option turns on or not.
+    pub fn mutable_globals_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(
+                self.inner.0,
+                ffi::WasmEdge_Proposal_ImportExportMutGlobals,
+            )
+        }
+    }
+
+    /// Enables or disables the NonTrapFloatToIntConversions option. By default, the option is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn non_trap_conversions(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_NonTrapFloatToIntConversions,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_NonTrapFloatToIntConversions,
+                )
+            }
+        }
+    }
+
+    /// Checks if the NonTrapFloatToIntConversions option turns on or not.
+    pub fn non_trap_conversions_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(
+                self.inner.0,
+                ffi::WasmEdge_Proposal_NonTrapFloatToIntConversions,
+            )
+        }
+    }
+
+    /// Enables or disables the SignExtensionOperators option. By default, the option is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn sign_extension_operators(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_SignExtensionOperators,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_SignExtensionOperators,
+                )
+            }
+        }
+    }
+
+    /// Checks if the SignExtensionOperators option turns on or not.
+    pub fn sign_extension_operators_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(
+                self.inner.0,
+                ffi::WasmEdge_Proposal_SignExtensionOperators,
+            )
+        }
+    }
+
+    /// Enables or disables the MultiValue option. By default, the option is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn multi_value(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(self.inner.0, ffi::WasmEdge_Proposal_MultiValue)
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_MultiValue,
+                )
+            }
+        }
+    }
+
+    /// Checks if the MultiValue option turns on or not.
+    pub fn multi_value_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(self.inner.0, ffi::WasmEdge_Proposal_MultiValue)
+        }
+    }
+
+    /// Enables or disables the BulkMemoryOperations option. By default, the option is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn bulk_memory_operations(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_BulkMemoryOperations,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_BulkMemoryOperations,
+                )
+            }
+        }
+    }
+
+    /// Checks if the BulkMemoryOperations option turns on or not.
+    pub fn bulk_memory_operations_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(
+                self.inner.0,
+                ffi::WasmEdge_Proposal_BulkMemoryOperations,
+            )
+        }
+    }
+
+    /// Enables or disables the ReferenceTypes option. By default, the option is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn reference_types(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_ReferenceTypes,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_ReferenceTypes,
+                )
+            }
+        }
+    }
+
+    /// Checks if the ReferenceTypes option turns on or not.
+    pub fn reference_types_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(self.inner.0, ffi::WasmEdge_Proposal_ReferenceTypes)
+        }
+    }
+
+    /// Enables or disables the SIMD option. By default, the option is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn simd(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(self.inner.0, ffi::WasmEdge_Proposal_SIMD)
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(self.inner.0, ffi::WasmEdge_Proposal_SIMD)
+            }
+        }
+    }
+
+    /// Checks if the SIMD option turns on or not.
+    pub fn simd_enabled(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureHasProposal(self.inner.0, ffi::WasmEdge_Proposal_SIMD) }
+    }
+
+    /// Enables or disables the TailCall option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn tail_call(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(self.inner.0, ffi::WasmEdge_Proposal_TailCall)
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(self.inner.0, ffi::WasmEdge_Proposal_TailCall)
+            }
+        }
+    }
+
+    /// Checks if the TailCall option turns on or not.
+    pub fn tail_call_enabled(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureHasProposal(self.inner.0, ffi::WasmEdge_Proposal_TailCall) }
+    }
+
+    /// Enables or disables the Annotations option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn annotations(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(self.inner.0, ffi::WasmEdge_Proposal_Annotations)
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_Annotations,
+                )
+            }
+        }
+    }
+
+    /// Checks if the Annotations option turns on or not.
+    pub fn annotations_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(self.inner.0, ffi::WasmEdge_Proposal_Annotations)
+        }
+    }
+
+    /// Enables or disables the Memory64 option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn memory64(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(self.inner.0, ffi::WasmEdge_Proposal_Memory64)
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(self.inner.0, ffi::WasmEdge_Proposal_Memory64)
+            }
+        }
+    }
+
+    /// Checks if the Memory64 option turns on or not.
+    pub fn memory64_enabled(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureHasProposal(self.inner.0, ffi::WasmEdge_Proposal_Memory64) }
+    }
+
+    /// Enables or disables the Threads option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn threads(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(self.inner.0, ffi::WasmEdge_Proposal_Threads)
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(self.inner.0, ffi::WasmEdge_Proposal_Threads)
+            }
+        }
+    }
+
+    /// Checks if the Threads option turns on or not.
+    pub fn threads_enabled(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureHasProposal(self.inner.0, ffi::WasmEdge_Proposal_Threads) }
+    }
+
+    /// Enables or disables the ExceptionHandling option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn exception_handling(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_ExceptionHandling,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_ExceptionHandling,
+                )
+            }
+        }
+    }
+
+    /// Checks if the ExceptionHandling option turns on or not.
+    pub fn exception_handling_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(
+                self.inner.0,
+                ffi::WasmEdge_Proposal_ExceptionHandling,
+            )
+        }
+    }
+
+    /// Enables or disables the FunctionReferences option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn function_references(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_FunctionReferences,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_FunctionReferences,
+                )
+            }
+        }
+    }
+
+    /// Checks if the FunctionReferences option turns on or not.
+    pub fn function_references_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(
+                self.inner.0,
+                ffi::WasmEdge_Proposal_FunctionReferences,
+            )
+        }
+    }
+
+    /// Enables or disables the MultiMemories option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn multi_memories(&mut self, enable: bool) {
+        unsafe {
+            if enable {
+                ffi::WasmEdge_ConfigureAddProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_MultiMemories,
+                )
+            } else {
+                ffi::WasmEdge_ConfigureRemoveProposal(
+                    self.inner.0,
+                    ffi::WasmEdge_Proposal_MultiMemories,
+                )
+            }
+        }
+    }
+
+    /// Checks if the MultiMemories option turns on or not.
+    pub fn multi_memories_enabled(&self) -> bool {
+        unsafe {
+            ffi::WasmEdge_ConfigureHasProposal(self.inner.0, ffi::WasmEdge_Proposal_MultiMemories)
+        }
+    }
+
+    /// Enables or disables the `ForceInterpreter` option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether the option turns on or not.
+    pub fn interpreter_mode(&mut self, enable: bool) {
+        unsafe { ffi::WasmEdge_ConfigureSetForceInterpreter(self.inner.0, enable) }
+    }
+
+    /// Checks if the `ForceInterpreter` option turns on or not.
+    pub fn interpreter_mode_enabled(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureIsForceInterpreter(self.inner.0) }
+    }
+
+    // For AOT compiler
+
+    /// Sets the optimization level of AOT compiler. By default, the optimization level is `O3`.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `opt_level` - The optimization level of AOT compiler.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn set_aot_optimization_level(&mut self, opt_level: CompilerOptimizationLevel) {
+        unsafe {
+            ffi::WasmEdge_ConfigureCompilerSetOptimizationLevel(
+                self.inner.0,
+                opt_level as ffi::WasmEdge_CompilerOptimizationLevel,
+            )
+        }
+    }
+
+    /// Returns the optimization level of AOT compiler.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn get_aot_optimization_level(&self) -> CompilerOptimizationLevel {
+        let level = unsafe { ffi::WasmEdge_ConfigureCompilerGetOptimizationLevel(self.inner.0) };
+        level.into()
+    }
+
+    /// Sets the output binary format of AOT compiler. By default, the compiler output format is `Wasm`.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `format` - The format of the output binary.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn set_aot_compiler_output_format(&mut self, format: CompilerOutputFormat) {
+        unsafe {
+            ffi::WasmEdge_ConfigureCompilerSetOutputFormat(
+                self.inner.0,
+                format as ffi::WasmEdge_CompilerOutputFormat,
+            )
+        }
+    }
+
+    /// Returns the output binary format of AOT compiler.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn get_aot_compiler_output_format(&self) -> CompilerOutputFormat {
+        let value = unsafe { ffi::WasmEdge_ConfigureCompilerGetOutputFormat(self.inner.0) };
+        value.into()
+    }
+
+    /// Sets the dump IR option of AOT compiler. By default, the option is disabled.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `flag` - Whether dump ir or not.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn dump_ir(&mut self, flag: bool) {
+        unsafe { ffi::WasmEdge_ConfigureCompilerSetDumpIR(self.inner.0, flag) }
+    }
+
+    /// Checks if the dump IR option turns on or not.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn dump_ir_enabled(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureCompilerIsDumpIR(self.inner.0) }
+    }
+
+    /// Sets the generic binary option of AOT compiler. By default, the option is disabled.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `flag` - Whether generate the generic binary or not when perform AOT compilation.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn generic_binary(&mut self, flag: bool) {
+        unsafe { ffi::WasmEdge_ConfigureCompilerSetGenericBinary(self.inner.0, flag) }
+    }
+
+    /// Checks if the generic binary option of AOT compiler turns on or not.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn generic_binary_enabled(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureCompilerIsGenericBinary(self.inner.0) }
+    }
+
+    /// Enables or Disables the `Interruptible` option of AOT compiler. This option determines to generate interruptible binary or not when compilation in AOT compiler. By default, the option is disabled.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    ///
+    /// # Argument
+    ///
+    /// * `enable` - Whether turn on the `Interruptible` option.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn interruptible(&mut self, enable: bool) {
+        unsafe { ffi::WasmEdge_ConfigureCompilerSetInterruptible(self.inner.0, enable) }
+    }
+
+    /// Checks if the `Interruptible` option of AOT Compiler turns on or not.
+    ///
+    /// Notice that this function is only available when the `aot` feature is enabled.
+    #[cfg(feature = "aot")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+    pub fn interruptible_enabled(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureCompilerIsInterruptible(self.inner.0) }
+    }
+
+    // For Statistics
+
+    /// Sets the instruction counting option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `flag` - Whether support instruction counting or not when execution after AOT compilation.
+    pub fn count_instructions(&mut self, flag: bool) {
+        unsafe { ffi::WasmEdge_ConfigureStatisticsSetInstructionCounting(self.inner.0, flag) }
+    }
+
+    /// Checks if the instruction counting option turns on or not.
+    pub fn is_instruction_counting(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureStatisticsIsInstructionCounting(self.inner.0) }
+    }
+
+    /// Sets the cost measuring option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `flag` - Whether support cost measuring or not when execution after AOT compilation.
+    pub fn measure_cost(&mut self, flag: bool) {
+        unsafe { ffi::WasmEdge_ConfigureStatisticsSetCostMeasuring(self.inner.0, flag) }
+    }
+
+    /// Checks if the cost measuring option turns on or not.
+    pub fn is_cost_measuring(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureStatisticsIsCostMeasuring(self.inner.0) }
+    }
+
+    /// Sets the time measuring option. By default, the option is disabled.
+    ///
+    /// # Argument
+    ///
+    /// * `flag` - Whether support time measuring or not when execution after AOT compilation.
+    pub fn measure_time(&mut self, flag: bool) {
+        unsafe { ffi::WasmEdge_ConfigureStatisticsSetTimeMeasuring(self.inner.0, flag) }
+    }
+
+    /// Checks if the time measuring option turns on or not.
+    pub fn is_time_measuring(&self) -> bool {
+        unsafe { ffi::WasmEdge_ConfigureStatisticsIsTimeMeasuring(self.inner.0) }
+    }
+
+    /// Provides a raw pointer to the inner Configure context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_ConfigureContext {
+        self.inner.0 as *const _
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerConfig(pub(crate) *mut ffi::WasmEdge_ConfigureContext);
+unsafe impl Send for InnerConfig {}
+unsafe impl Sync for InnerConfig {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::{
+        borrow::BorrowMut,
+        sync::{Arc, Mutex},
+        thread,
+    };
+
+    #[test]
+    fn test_config_options() {
+        // create a Config instance
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+
+        // check default settings
+        assert!(!config.multi_memories_enabled());
+        assert!(!config.annotations_enabled());
+        assert!(config.bulk_memory_operations_enabled());
+        assert!(!config.exception_handling_enabled());
+        assert!(!config.function_references_enabled());
+        assert!(!config.memory64_enabled());
+        assert!(config.multi_value_enabled());
+        assert!(config.mutable_globals_enabled());
+        assert!(config.non_trap_conversions_enabled());
+        assert!(config.sign_extension_operators_enabled());
+        assert!(config.reference_types_enabled());
+        assert!(config.simd_enabled());
+        assert!(!config.tail_call_enabled());
+        assert!(!config.threads_enabled());
+        #[cfg(not(feature = "async"))]
+        assert!(!config.wasi_enabled());
+        assert!(!config.is_cost_measuring());
+        #[cfg(feature = "aot")]
+        assert!(!config.dump_ir_enabled());
+        #[cfg(feature = "aot")]
+        #[cfg(feature = "aot")]
+        assert!(!config.generic_binary_enabled());
+        assert!(!config.is_instruction_counting());
+        assert!(!config.is_time_measuring());
+        assert_eq!(config.get_max_memory_pages(), 65536);
+        #[cfg(feature = "aot")]
+        assert_eq!(
+            config.get_aot_optimization_level(),
+            CompilerOptimizationLevel::O3,
+        );
+        #[cfg(feature = "aot")]
+        assert_eq!(
+            config.get_aot_compiler_output_format(),
+            CompilerOutputFormat::Wasm,
+        );
+        assert!(!config.interpreter_mode_enabled());
+        #[cfg(feature = "aot")]
+        assert!(!config.interruptible_enabled());
+
+        // set options
+        config.multi_memories(true);
+        config.annotations(true);
+        config.bulk_memory_operations(false);
+        config.exception_handling(true);
+        config.function_references(true);
+        config.memory64(true);
+        config.multi_value(false);
+        config.mutable_globals(false);
+        config.non_trap_conversions(false);
+        config.sign_extension_operators(false);
+        config.reference_types(false);
+        config.simd(false);
+        config.tail_call(true);
+        config.threads(true);
+        config.measure_cost(true);
+        config.measure_time(true);
+        #[cfg(feature = "aot")]
+        config.dump_ir(true);
+        #[cfg(feature = "aot")]
+        config.generic_binary(true);
+        config.count_instructions(true);
+        config.interpreter_mode(true);
+
+        // check new settings
+        assert!(config.multi_memories_enabled());
+        assert!(config.annotations_enabled());
+        assert!(!config.bulk_memory_operations_enabled());
+        assert!(config.exception_handling_enabled());
+        assert!(config.function_references_enabled());
+        assert!(config.memory64_enabled());
+        assert!(!config.multi_value_enabled());
+        assert!(!config.mutable_globals_enabled());
+        assert!(!config.non_trap_conversions_enabled());
+        assert!(!config.sign_extension_operators_enabled());
+        assert!(!config.reference_types_enabled());
+        assert!(!config.simd_enabled());
+        assert!(config.tail_call_enabled());
+        assert!(config.threads_enabled());
+        assert!(config.is_cost_measuring());
+        #[cfg(feature = "aot")]
+        assert!(config.dump_ir_enabled());
+        #[cfg(feature = "aot")]
+        assert!(config.generic_binary_enabled());
+        assert!(config.is_instruction_counting());
+        assert!(config.is_time_measuring());
+        assert!(config.interpreter_mode_enabled());
+
+        // set maximum memory pages
+        config.set_max_memory_pages(10);
+        assert_eq!(config.get_max_memory_pages(), 10);
+        #[cfg(feature = "aot")]
+        config.set_aot_optimization_level(CompilerOptimizationLevel::Oz);
+        #[cfg(feature = "aot")]
+        assert_eq!(
+            config.get_aot_optimization_level(),
+            CompilerOptimizationLevel::Oz
+        );
+        #[cfg(feature = "aot")]
+        config.set_aot_compiler_output_format(CompilerOutputFormat::Native);
+        #[cfg(feature = "aot")]
+        assert_eq!(
+            config.get_aot_compiler_output_format(),
+            CompilerOutputFormat::Native,
+        );
+    }
+
+    #[test]
+    fn test_config_send() {
+        // create a Config instance
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            // check default settings
+            assert!(!config.multi_memories_enabled());
+            assert!(!config.annotations_enabled());
+            assert!(config.bulk_memory_operations_enabled());
+            assert!(!config.exception_handling_enabled());
+            assert!(!config.function_references_enabled());
+            assert!(!config.memory64_enabled());
+            assert!(config.reference_types_enabled());
+            assert!(config.simd_enabled());
+            assert!(!config.tail_call_enabled());
+            assert!(!config.threads_enabled());
+            assert!(!config.is_cost_measuring());
+            #[cfg(feature = "aot")]
+            assert!(!config.dump_ir_enabled());
+            #[cfg(feature = "aot")]
+            assert!(!config.generic_binary_enabled());
+            assert!(!config.is_instruction_counting());
+            assert!(!config.is_time_measuring());
+            assert_eq!(config.get_max_memory_pages(), 65536);
+            #[cfg(feature = "aot")]
+            assert_eq!(
+                config.get_aot_optimization_level(),
+                CompilerOptimizationLevel::O3,
+            );
+            #[cfg(feature = "aot")]
+            assert_eq!(
+                config.get_aot_compiler_output_format(),
+                CompilerOutputFormat::Wasm,
+            );
+
+            // set options
+            config.multi_memories(true);
+            config.annotations(true);
+            config.bulk_memory_operations(false);
+            config.exception_handling(true);
+            config.function_references(true);
+            config.memory64(true);
+            config.reference_types(false);
+            config.simd(false);
+            config.tail_call(true);
+            config.threads(true);
+            config.measure_cost(true);
+            config.measure_time(true);
+            #[cfg(feature = "aot")]
+            config.dump_ir(true);
+            #[cfg(feature = "aot")]
+            config.generic_binary(true);
+            config.count_instructions(true);
+
+            // check new settings
+            assert!(config.multi_memories_enabled());
+            assert!(config.annotations_enabled());
+            assert!(!config.bulk_memory_operations_enabled());
+            assert!(config.exception_handling_enabled());
+            assert!(config.function_references_enabled());
+            assert!(config.memory64_enabled());
+            assert!(!config.reference_types_enabled());
+            assert!(!config.simd_enabled());
+            assert!(config.tail_call_enabled());
+            assert!(config.threads_enabled());
+            assert!(config.is_cost_measuring());
+            #[cfg(feature = "aot")]
+            assert!(config.dump_ir_enabled());
+            #[cfg(feature = "aot")]
+            assert!(config.generic_binary_enabled());
+            assert!(config.is_instruction_counting());
+            assert!(config.is_time_measuring());
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    fn test_config_sync() {
+        // create a Config instance
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = Arc::new(Mutex::new(result.unwrap()));
+
+        let config_cloned = Arc::clone(&config);
+        let handle = thread::spawn(move || {
+            let result = config_cloned.lock();
+            assert!(result.is_ok());
+            let mut config = result.unwrap();
+
+            // check default settings
+            assert!(!config.multi_memories_enabled());
+            assert!(!config.annotations_enabled());
+            assert!(config.bulk_memory_operations_enabled());
+            assert!(!config.exception_handling_enabled());
+            assert!(!config.function_references_enabled());
+            assert!(!config.memory64_enabled());
+            assert!(config.reference_types_enabled());
+            assert!(config.simd_enabled());
+            assert!(!config.tail_call_enabled());
+            assert!(!config.threads_enabled());
+            assert!(!config.is_cost_measuring());
+            #[cfg(feature = "aot")]
+            assert!(!config.dump_ir_enabled());
+            #[cfg(feature = "aot")]
+            assert!(!config.generic_binary_enabled());
+            assert!(!config.is_instruction_counting());
+            assert!(!config.is_time_measuring());
+            assert_eq!(config.get_max_memory_pages(), 65536);
+            #[cfg(feature = "aot")]
+            assert_eq!(
+                config.get_aot_optimization_level(),
+                CompilerOptimizationLevel::O3,
+            );
+            #[cfg(feature = "aot")]
+            assert_eq!(
+                config.get_aot_compiler_output_format(),
+                CompilerOutputFormat::Wasm,
+            );
+
+            // set options
+            let config_mut = config.borrow_mut();
+            config_mut.multi_memories(true);
+            config_mut.annotations(true);
+            config_mut.bulk_memory_operations(false);
+            config_mut.exception_handling(true);
+            config_mut.function_references(true);
+            config_mut.memory64(true);
+            config_mut.reference_types(false);
+            config_mut.simd(false);
+            config_mut.tail_call(true);
+            config_mut.threads(true);
+            config_mut.measure_cost(true);
+            config_mut.measure_time(true);
+            #[cfg(feature = "aot")]
+            config_mut.dump_ir(true);
+            #[cfg(feature = "aot")]
+            config_mut.generic_binary(true);
+            config_mut.count_instructions(true);
+
+            // check new settings
+            assert!(config.multi_memories_enabled());
+            assert!(config.annotations_enabled());
+            assert!(!config.bulk_memory_operations_enabled());
+            assert!(config.exception_handling_enabled());
+            assert!(config.function_references_enabled());
+            assert!(config.memory64_enabled());
+            assert!(!config.reference_types_enabled());
+            assert!(!config.simd_enabled());
+            assert!(config.tail_call_enabled());
+            assert!(config.threads_enabled());
+            assert!(config.is_cost_measuring());
+            #[cfg(feature = "aot")]
+            assert!(config.dump_ir_enabled());
+            #[cfg(feature = "aot")]
+            assert!(config.generic_binary_enabled());
+            assert!(config.is_instruction_counting());
+            assert!(config.is_time_measuring());
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    fn test_config_clone() {
+        // create a Config instance
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        assert_eq!(std::sync::Arc::strong_count(&config.inner), 1);
+
+        // set options
+        config.multi_memories(true);
+        config.annotations(true);
+        config.bulk_memory_operations(false);
+        config.exception_handling(true);
+        config.function_references(true);
+        config.memory64(true);
+        config.multi_value(false);
+        config.mutable_globals(false);
+        config.non_trap_conversions(false);
+        config.sign_extension_operators(false);
+        config.reference_types(false);
+        config.simd(false);
+        config.tail_call(true);
+        config.threads(true);
+        config.measure_cost(true);
+        config.measure_time(true);
+        #[cfg(feature = "aot")]
+        config.dump_ir(true);
+        #[cfg(feature = "aot")]
+        config.generic_binary(true);
+        config.count_instructions(true);
+
+        let config_clone = config.clone();
+        assert_eq!(std::sync::Arc::strong_count(&config.inner), 2);
+        // check new settings
+        assert!(config_clone.multi_memories_enabled());
+        assert!(config_clone.annotations_enabled());
+        assert!(!config_clone.bulk_memory_operations_enabled());
+        assert!(config_clone.exception_handling_enabled());
+        assert!(config_clone.function_references_enabled());
+        assert!(config_clone.memory64_enabled());
+        assert!(!config_clone.multi_value_enabled());
+        assert!(!config_clone.mutable_globals_enabled());
+        assert!(!config_clone.non_trap_conversions_enabled());
+        assert!(!config_clone.sign_extension_operators_enabled());
+        assert!(!config_clone.reference_types_enabled());
+        assert!(!config_clone.simd_enabled());
+        assert!(config_clone.tail_call_enabled());
+        assert!(config_clone.threads_enabled());
+        assert!(config_clone.is_cost_measuring());
+        #[cfg(feature = "aot")]
+        assert!(config_clone.dump_ir_enabled());
+        #[cfg(feature = "aot")]
+        assert!(config_clone.generic_binary_enabled());
+        assert!(config_clone.is_instruction_counting());
+        assert!(config_clone.is_time_measuring());
+
+        drop(config);
+        assert_eq!(std::sync::Arc::strong_count(&config_clone.inner), 1);
+        drop(config_clone);
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/executor.rs.html b/src/wasmedge_sys/executor.rs.html new file mode 100644 index 000000000..c593c5184 --- /dev/null +++ b/src/wasmedge_sys/executor.rs.html @@ -0,0 +1,1991 @@ +executor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+
//! Defines WasmEdge Executor.
+
+use super::ffi;
+#[cfg(all(feature = "async", target_os = "linux"))]
+use crate::r#async::fiber::{AsyncState, FiberFuture};
+
+#[cfg(all(feature = "async", target_os = "linux", not(target_env = "musl")))]
+use crate::r#async::fiber::TimeoutFiberFuture;
+
+use crate::{
+    instance::module::InnerInstance, types::WasmEdgeString, utils::check, Config, Engine, FuncRef,
+    Function, ImportModule, Instance, Module, Statistics, Store, WasiInstance, WasmEdgeResult,
+    WasmValue,
+};
+use parking_lot::Mutex;
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+use std::os::raw::c_void;
+use std::sync::Arc;
+use wasmedge_types::error::WasmEdgeError;
+
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+pub(crate) struct JmpState {
+    pub(crate) sigjmp_buf: *mut setjmp::sigjmp_buf,
+}
+
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+scoped_tls::scoped_thread_local!(pub(crate) static JMP_BUF: JmpState);
+
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+unsafe extern "C" fn sync_timeout(sig: i32, info: *mut libc::siginfo_t) {
+    if let Some(info) = info.as_mut() {
+        let si_value = info.si_value();
+        let value: *mut libc::pthread_t = si_value.sival_ptr.cast();
+        let dist_pthread = *value;
+        let self_pthread = libc::pthread_self();
+        if self_pthread == dist_pthread {
+            if JMP_BUF.is_set() {
+                let env = JMP_BUF.with(|s| s.sigjmp_buf);
+                setjmp::siglongjmp(env, 1);
+            }
+        } else {
+            libc::pthread_sigqueue(dist_pthread, sig, si_value);
+        }
+    }
+}
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+unsafe extern "C" fn pre_host_func(_: *mut c_void) {
+    use libc::SIG_BLOCK;
+
+    let mut set = std::mem::zeroed();
+    libc::sigemptyset(&mut set);
+    libc::sigaddset(&mut set, timeout_signo());
+    libc::pthread_sigmask(SIG_BLOCK, &set, std::ptr::null_mut());
+}
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+unsafe extern "C" fn post_host_func(_: *mut c_void) {
+    use libc::SIG_UNBLOCK;
+
+    let mut set = std::mem::zeroed();
+    libc::sigemptyset(&mut set);
+    libc::sigaddset(&mut set, timeout_signo());
+    libc::pthread_sigmask(SIG_UNBLOCK, &set, std::ptr::null_mut());
+}
+
+#[inline]
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+pub(crate) fn timeout_signo() -> i32 {
+    option_env!("SIG_OFFSET")
+        .and_then(|s| s.parse().ok())
+        .unwrap_or(0)
+        + libc::SIGRTMIN()
+}
+
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+static INIT_SIGNAL_LISTEN: std::sync::Once = std::sync::Once::new();
+
+#[inline(always)]
+#[cfg(all(target_os = "linux", not(target_env = "musl")))]
+pub(crate) unsafe fn init_signal_listen() {
+    INIT_SIGNAL_LISTEN.call_once(|| {
+        let mut new_act: libc::sigaction = std::mem::zeroed();
+        new_act.sa_sigaction = sync_timeout as usize;
+        new_act.sa_flags = libc::SA_RESTART | libc::SA_SIGINFO;
+        libc::sigaction(timeout_signo(), &new_act, std::ptr::null_mut());
+    });
+}
+
+/// Defines an execution environment for both pure WASM and compiled WASM.
+#[derive(Debug, Clone)]
+pub struct Executor {
+    pub(crate) inner: Arc<InnerExecutor>,
+    pub(crate) registered: bool,
+}
+impl Executor {
+    /// Creates a new [executor](crate::Executor) to be associated with the given [config](crate::Config) and [statistics](crate::Statistics).
+    ///
+    /// # Arguments
+    ///
+    /// * `config` - The configuration of the new [executor](crate::Executor).
+    ///
+    /// * `stat` - The [statistics](crate::Statistics) needed by the new [executor](crate::Executor).
+    ///
+    /// # Error
+    ///
+    /// If fail to create a [executor](crate::Executor), then an error is returned.
+    pub fn create(config: Option<&Config>, stat: Option<&mut Statistics>) -> WasmEdgeResult<Self> {
+        let ctx = match config {
+            Some(config) => match stat {
+                Some(stat) => unsafe { ffi::WasmEdge_ExecutorCreate(config.inner.0, stat.inner.0) },
+                None => unsafe {
+                    ffi::WasmEdge_ExecutorCreate(config.inner.0, std::ptr::null_mut())
+                },
+            },
+            None => match stat {
+                Some(stat) => unsafe {
+                    ffi::WasmEdge_ExecutorCreate(std::ptr::null_mut(), stat.inner.0)
+                },
+                None => unsafe {
+                    ffi::WasmEdge_ExecutorCreate(std::ptr::null_mut(), std::ptr::null_mut())
+                },
+            },
+        };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::ExecutorCreate)),
+            false => {
+                #[cfg(all(target_os = "linux", not(target_env = "musl")))]
+                unsafe {
+                    ffi::WasmEdge_ExecutorExperimentalRegisterPreHostFunction(
+                        ctx,
+                        std::ptr::null_mut(),
+                        Some(pre_host_func),
+                    );
+                    ffi::WasmEdge_ExecutorExperimentalRegisterPostHostFunction(
+                        ctx,
+                        std::ptr::null_mut(),
+                        Some(post_host_func),
+                    );
+                }
+
+                Ok(Executor {
+                    inner: Arc::new(InnerExecutor(ctx)),
+                    registered: false,
+                })
+            }
+        }
+    }
+
+    /// Registers and instantiates the given [WASI instance](crate::WasiInstance) into a [store](crate::Store).
+    ///
+    /// # Arguments
+    ///
+    /// * `store` - The target [store](crate::Store), into which the given [wasi instance] is registered.
+    ///
+    /// * `instance` - The [WASI instance](crate::WasiInstance) to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register the given [WASI instance](crate::WasiInstance), then an error is returned.
+    pub fn register_wasi_instance(
+        &mut self,
+        store: &Store,
+        instance: &WasiInstance,
+    ) -> WasmEdgeResult<()> {
+        match instance {
+            #[cfg(not(feature = "async"))]
+            WasiInstance::Wasi(import) => unsafe {
+                check(ffi::WasmEdge_ExecutorRegisterImport(
+                    self.inner.0,
+                    store.inner.0,
+                    import.inner.0 as *const _,
+                ))?;
+            },
+            #[cfg(all(feature = "async", target_os = "linux"))]
+            WasiInstance::AsyncWasi(import) => unsafe {
+                check(ffi::WasmEdge_ExecutorRegisterImport(
+                    self.inner.0,
+                    store.inner.0,
+                    import.inner.0 as *const _,
+                ))?;
+            },
+        }
+
+        Ok(())
+    }
+
+    /// Registers and instantiates a [import module](crate::ImportModule) into a [store](crate::Store).
+    ///
+    /// # Arguments
+    ///
+    /// * `store` - The target [store](crate::Store), into which the given [import module](crate::ImportModule) is registered.
+    ///
+    /// * `import` - The WasmEdge [import module](crate::ImportModule) to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register the given [import module](crate::ImportModule), then an error is returned.
+    pub fn register_import_module<T>(
+        &mut self,
+        store: &Store,
+        import: &ImportModule<T>,
+    ) -> WasmEdgeResult<()>
+    where
+        T: ?Sized + Send + Sync + Clone,
+    {
+        unsafe {
+            check(ffi::WasmEdge_ExecutorRegisterImport(
+                self.inner.0,
+                store.inner.0,
+                import.inner.0 as *const _,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Registers and instantiates a WasmEdge [module](crate::Module) into a store.
+    ///
+    /// Instantiates the given WasmEdge [module](crate::Module), including the [functions](crate::Function), [memories](crate::Memory), [tables](crate::Table), and [globals](crate::Global) it hosts; and then, registers the module [instance](crate::Instance) into the [store](crate::Store) with the given name.
+    ///
+    /// # Arguments
+    ///
+    /// * `store` - The target [store](crate::Store), into which the given [module](crate::Module) is registered.
+    ///
+    /// * `module` - A validated [module](crate::Module) to be registered.
+    ///
+    /// * `name` - The exported name of the registered [module](crate::Module).
+    ///
+    /// # Error
+    ///
+    /// If fail to register the given [module](crate::Module), then an error is returned.
+    pub fn register_named_module(
+        &mut self,
+        store: &Store,
+        module: &Module,
+        name: impl AsRef<str>,
+    ) -> WasmEdgeResult<Instance> {
+        let mut instance_ctx = std::ptr::null_mut();
+        let mod_name: WasmEdgeString = name.as_ref().into();
+        unsafe {
+            check(ffi::WasmEdge_ExecutorRegister(
+                self.inner.0,
+                &mut instance_ctx,
+                store.inner.0,
+                module.inner.0 as *const _,
+                mod_name.as_raw(),
+            ))?;
+        }
+
+        Ok(Instance {
+            inner: Arc::new(Mutex::new(InnerInstance(instance_ctx))),
+            registered: false,
+        })
+    }
+
+    /// Registers and instantiates a WasmEdge [module](crate::Module) into a [store](crate::Store) as an anonymous module.
+    ///
+    /// Notice that when a new module is instantiated into the [store](crate::Store), the old instantiated module is removed; in addition, ensure that the [imports](crate::ImportModule) the module depends on are already registered into the [store](crate::Store).
+    ///
+    ///
+    /// # Arguments
+    ///
+    /// * `store` - The [store](crate::Store), in which the [module](crate::Module) to be instantiated
+    /// is stored.
+    ///
+    /// * `ast_mod` - The target [module](crate::Module) to be instantiated.
+    ///
+    /// # Error
+    ///
+    /// If fail to instantiate the given [module](crate::Module), then an error is returned.
+    pub fn register_active_module(
+        &mut self,
+        store: &Store,
+        module: &Module,
+    ) -> WasmEdgeResult<Instance> {
+        let mut instance_ctx = std::ptr::null_mut();
+        unsafe {
+            check(ffi::WasmEdge_ExecutorInstantiate(
+                self.inner.0,
+                &mut instance_ctx,
+                store.inner.0,
+                module.inner.0 as *const _,
+            ))?;
+        }
+        Ok(Instance {
+            inner: Arc::new(Mutex::new(InnerInstance(instance_ctx))),
+            registered: false,
+        })
+    }
+
+    /// Registers plugin module instance into a [store](crate::Store).
+    ///
+    /// # Arguments
+    ///
+    /// * `store` - The [store](crate::Store), in which the [module](crate::Module) to be instantiated
+    /// is stored.
+    ///
+    /// * `instance` - The plugin module instance to be registered.
+    ///
+    /// # Error
+    ///
+    /// If fail to register the given plugin module instance, then an error is returned.
+    pub fn register_plugin_instance(
+        &mut self,
+        store: &Store,
+        instance: &Instance,
+    ) -> WasmEdgeResult<()> {
+        unsafe {
+            check(ffi::WasmEdge_ExecutorRegisterImport(
+                self.inner.0,
+                store.inner.0,
+                instance.inner.lock().0 as *const _,
+            ))?;
+        }
+
+        Ok(())
+    }
+
+    /// Runs a host function instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    pub fn call_func(
+        &self,
+        func: &Function,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        let raw_params = params.into_iter().map(|x| x.as_raw()).collect::<Vec<_>>();
+
+        // get the length of the function's returns
+        let func_ty = func.ty()?;
+        let returns_len = func_ty.returns_len();
+        let mut returns = Vec::with_capacity(returns_len as usize);
+
+        unsafe {
+            check(ffi::WasmEdge_ExecutorInvoke(
+                self.inner.0,
+                func.inner.lock().0 as *const _,
+                raw_params.as_ptr(),
+                raw_params.len() as u32,
+                returns.as_mut_ptr(),
+                returns_len,
+            ))?;
+
+            returns.set_len(returns_len as usize);
+        }
+
+        Ok(returns.into_iter().map(Into::into).collect::<Vec<_>>())
+    }
+
+    /// Run a host function instance and return the results or timeout.
+    ///
+    /// # Arguments
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// * `timeout` - The maximum execution time of the function to be run.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(target_os = "linux", not(target_env = "musl")))]
+    #[cfg_attr(docsrs, doc(cfg(all(target_os = "linux", not(target_env = "musl")))))]
+    pub fn call_func_with_timeout(
+        &self,
+        func: &Function,
+        params: impl IntoIterator<Item = WasmValue>,
+        timeout: std::time::Duration,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        use wasmedge_types::error;
+
+        let raw_params = params.into_iter().map(|x| x.as_raw()).collect::<Vec<_>>();
+        // get the length of the function's returns
+        let func_ty = func.ty()?;
+        let returns_len = func_ty.returns_len();
+        let mut returns = Vec::with_capacity(returns_len as usize);
+
+        unsafe {
+            init_signal_listen();
+            let mut self_thread = libc::pthread_self();
+            let mut sigjmp_buf: setjmp::sigjmp_buf = std::mem::zeroed();
+            let env = &mut sigjmp_buf as *mut _;
+
+            let mut timerid: libc::timer_t = std::mem::zeroed();
+            let mut sev: libc::sigevent = std::mem::zeroed();
+            sev.sigev_notify = libc::SIGEV_SIGNAL;
+            sev.sigev_signo = timeout_signo();
+            sev.sigev_value.sival_ptr = &mut self_thread as *mut _ as *mut libc::c_void;
+
+            if libc::timer_create(libc::CLOCK_REALTIME, &mut sev, &mut timerid) < 0 {
+                return Err(Box::new(error::WasmEdgeError::Operation(
+                    "timer_create error".into(),
+                )));
+            }
+            let mut value: libc::itimerspec = std::mem::zeroed();
+            value.it_value.tv_sec = timeout.as_secs() as _;
+            value.it_value.tv_nsec = timeout.subsec_nanos() as _;
+            if libc::timer_settime(timerid, 0, &value, std::ptr::null_mut()) < 0 {
+                libc::timer_delete(timerid);
+                return Err(Box::new(error::WasmEdgeError::Operation(
+                    "timer_settime error".into(),
+                )));
+            }
+            let jmp_state = JmpState { sigjmp_buf: env };
+
+            JMP_BUF.set(&jmp_state, || {
+                if setjmp::sigsetjmp(env, 1) == 0 {
+                    let r = check(ffi::WasmEdge_ExecutorInvoke(
+                        self.inner.0,
+                        func.inner.lock().0 as *const _,
+                        raw_params.as_ptr(),
+                        raw_params.len() as u32,
+                        returns.as_mut_ptr(),
+                        returns_len,
+                    ));
+                    libc::timer_delete(timerid);
+                    r
+                } else {
+                    libc::timer_delete(timerid);
+                    Err(Box::new(error::WasmEdgeError::ExecuteTimeout))
+                }
+            })?;
+
+            returns.set_len(returns_len as usize);
+            Ok(returns.into_iter().map(Into::into).collect::<Vec<_>>())
+        }
+    }
+
+    /// Asynchronously runs a host function instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - Used to store asynchronous state at run time.
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn call_func_async(
+        &self,
+        async_state: &AsyncState,
+        func: &Function,
+        params: impl IntoIterator<Item = WasmValue> + Send,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        FiberFuture::on_fiber(async_state, || self.call_func(func, params))
+            .await
+            .unwrap()
+    }
+
+    /// Asynchronously runs a host function instance with a timeout setting
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - Used to store asynchronous state at run time.
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// * `timeout` - The maximum execution time of the function to be run.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux", not(target_env = "musl")))]
+    #[cfg_attr(
+        docsrs,
+        doc(cfg(all(feature = "async", target_os = "linux", not(target_env = "musl"))))
+    )]
+    #[cfg(feature = "async")]
+    pub async fn call_func_async_with_timeout(
+        &self,
+        async_state: &AsyncState,
+        func: &Function,
+        params: impl IntoIterator<Item = WasmValue> + Send,
+        timeout: std::time::Duration,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        use wasmedge_types::error;
+        let ldd = std::time::SystemTime::now() + timeout;
+        TimeoutFiberFuture::on_fiber(async_state, || self.call_func(func, params), ldd)
+            .await
+            .map_err(|_| Box::new(error::WasmEdgeError::ExecuteTimeout))?
+    }
+
+    /// Runs a host function reference instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func_ref` - The function reference instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function reference instance, then an error is returned.
+    pub fn call_func_ref(
+        &self,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        let raw_params = params.into_iter().map(|x| x.as_raw()).collect::<Vec<_>>();
+
+        // get the length of the function's returns
+        let func_ty = func_ref.ty()?;
+        let returns_len = func_ty.returns_len();
+        let mut returns = Vec::with_capacity(returns_len as usize);
+
+        unsafe {
+            check(ffi::WasmEdge_ExecutorInvoke(
+                self.inner.0,
+                func_ref.inner.0 as *const _,
+                raw_params.as_ptr(),
+                raw_params.len() as u32,
+                returns.as_mut_ptr(),
+                returns_len,
+            ))?;
+            returns.set_len(returns_len as usize);
+        }
+
+        Ok(returns.into_iter().map(Into::into).collect::<Vec<_>>())
+    }
+
+    /// Asynchronously runs a host function reference instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - Used to store asynchronous state at run time.
+    ///
+    /// * `func_ref` - The function reference instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function reference instance, then an error is returned.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn call_func_ref_async(
+        &self,
+        async_state: &AsyncState,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue> + Send,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        FiberFuture::on_fiber(async_state, || self.call_func_ref(func_ref, params))
+            .await
+            .unwrap()
+    }
+
+    /// Provides a raw pointer to the inner Executor context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_ExecutorContext {
+        self.inner.0 as *const _
+    }
+}
+impl Drop for Executor {
+    fn drop(&mut self) {
+        if !self.registered && Arc::strong_count(&self.inner) == 1 && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_ExecutorDelete(self.inner.0) }
+        }
+    }
+}
+impl Engine for Executor {
+    fn run_func(
+        &self,
+        func: &Function,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.call_func(func, params)
+    }
+
+    fn run_func_ref(
+        &self,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        self.call_func_ref(func_ref, params)
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerExecutor(pub(crate) *mut ffi::WasmEdge_ExecutorContext);
+unsafe impl Send for InnerExecutor {}
+unsafe impl Sync for InnerExecutor {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    cfg_if::cfg_if! {
+        if #[cfg(all(feature = "async", target_os = "linux"))] {
+            use crate::r#async::AsyncWasiModule;
+            use crate::{Loader, Validator};
+            use wasmedge_macro::sys_async_host_function;
+        }
+    }
+    use crate::{
+        AsImport, CallingFrame, Config, FuncType, Function, Global, GlobalType, ImportModule,
+        MemType, Memory, Statistics, Table, TableType, HOST_FUNCS, HOST_FUNC_FOOTPRINTS,
+    };
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_macro::sys_host_function;
+    use wasmedge_types::{error::HostFuncError, Mutability, NeverType, RefType, ValType};
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_executor_create() {
+        {
+            // create an Executor context without configuration and statistics
+            let result = Executor::create(None, None);
+            assert!(result.is_ok());
+            let executor = result.unwrap();
+            assert!(!executor.inner.0.is_null());
+        }
+
+        {
+            // create an Executor context with a given configuration
+            let result = Config::create();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+            let result = Executor::create(Some(&config), None);
+            assert!(result.is_ok());
+            let executor = result.unwrap();
+            assert!(!executor.inner.0.is_null());
+        }
+
+        {
+            // create an Executor context with a given statistics
+            let result = Statistics::create();
+            assert!(result.is_ok());
+            let mut stat = result.unwrap();
+            let result = Executor::create(None, Some(&mut stat));
+            assert!(result.is_ok());
+            let executor = result.unwrap();
+            assert!(!executor.inner.0.is_null());
+        }
+
+        {
+            // create an Executor context with the given configuration and statistics.
+            let result = Config::create();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+
+            let result = Statistics::create();
+            assert!(result.is_ok());
+            let mut stat = result.unwrap();
+
+            let result = Executor::create(Some(&config), Some(&mut stat));
+            assert!(result.is_ok());
+            let executor = result.unwrap();
+            assert!(!executor.inner.0.is_null());
+        }
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_executor_register_import() {
+        // create an Executor
+        let result = Executor::create(None, None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+        assert!(!executor.inner.0.is_null());
+
+        // create a Store
+        let result = Store::create();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // create an ImportObj module
+        let host_name = "extern";
+        let result = ImportModule::<NeverType>::create(host_name, None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        assert_eq!(HOST_FUNCS.read().len(), 0);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 0);
+
+        // add host function "func-add": (externref, i32) -> (i32)
+        let result = FuncType::create([ValType::ExternRef, ValType::I32], [ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+        // add the function into the import_obj module
+        import.add_func("func-add", host_func);
+
+        // create a Table instance
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let table_ty = result.unwrap();
+        let result = Table::create(&table_ty);
+        assert!(result.is_ok());
+        let host_table = result.unwrap();
+        // add the table into the import_obj module
+        import.add_table("table", host_table);
+
+        // create a Memory instance
+        let result = MemType::create(1, Some(2), false);
+        assert!(result.is_ok());
+        let mem_ty = result.unwrap();
+        let result = Memory::create(&mem_ty);
+        assert!(result.is_ok());
+        let host_memory = result.unwrap();
+        // add the memory into the import_obj module
+        import.add_memory("memory", host_memory);
+
+        // create a Global instance
+        let result = GlobalType::create(ValType::I32, Mutability::Const);
+        assert!(result.is_ok());
+        let global_ty = result.unwrap();
+        let result = Global::create(&global_ty, WasmValue::from_i32(666));
+        assert!(result.is_ok());
+        let host_global = result.unwrap();
+        // add the global into import_obj module
+        import.add_global("global_i32", host_global);
+
+        let result = executor.register_import_module(&mut store, &import);
+        assert!(result.is_ok());
+
+        {
+            let result = store.module("extern");
+            assert!(result.is_ok());
+            let instance = result.unwrap();
+
+            let result = instance.get_global("global_i32");
+            assert!(result.is_ok());
+            let global = result.unwrap();
+            assert_eq!(global.get_value().to_i32(), 666);
+        }
+
+        let handle = thread::spawn(move || {
+            let result = store.module("extern");
+            assert!(result.is_ok());
+            let instance = result.unwrap();
+
+            let result = instance.get_global("global_i32");
+            assert!(result.is_ok());
+            let global = result.unwrap();
+            assert_eq!(global.get_value().to_i32(), 666);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_executor_send() {
+        // create an Executor context with the given configuration and statistics.
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::create();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::create(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let executor = result.unwrap();
+        assert!(!executor.inner.0.is_null());
+
+        let handle = thread::spawn(move || {
+            assert!(!executor.inner.0.is_null());
+            println!("{:?}", executor.inner);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_executor_sync() {
+        // create an Executor context with the given configuration and statistics.
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+
+        let result = Statistics::create();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+
+        let result = Executor::create(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let executor = Arc::new(Mutex::new(result.unwrap()));
+
+        let executor_cloned = Arc::clone(&executor);
+        let handle = thread::spawn(move || {
+            let result = executor_cloned.lock();
+            assert!(result.is_ok());
+            let executor = result.unwrap();
+
+            assert!(!executor.inner.0.is_null());
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[tokio::test]
+    async fn test_executor_register_async_wasi() -> Result<(), Box<dyn std::error::Error>> {
+        // create a Config
+        let mut config = Config::create()?;
+        config.wasi(true);
+        assert!(config.wasi_enabled());
+
+        // create an Executor
+        let result = Executor::create(None, None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+        assert!(!executor.inner.0.is_null());
+
+        // create a Store
+        let result = Store::create();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // create an AsyncWasiModule
+        let result = AsyncWasiModule::create(Some(vec!["abc"]), Some(vec![("ENV", "1")]), None);
+        assert!(result.is_ok());
+        let async_wasi_module = result.unwrap();
+
+        let wasi_import = WasiInstance::AsyncWasi(async_wasi_module);
+        let result = executor.register_wasi_instance(&mut store, &wasi_import);
+        assert!(result.is_ok());
+
+        // register async_wasi module into the store
+        let wasm_file = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/async_hello.wasm");
+        let module = Loader::create(None)?.from_file(&wasm_file)?;
+        Validator::create(None)?.validate(&module)?;
+        let instance = executor.register_active_module(&mut store, &module)?;
+        let fn_start = instance.get_func("_start")?;
+
+        async fn tick() {
+            let mut i = 0;
+            loop {
+                println!("[tick] i={i}");
+                tokio::time::sleep(std::time::Duration::from_millis(500)).await;
+                i += 1;
+            }
+        }
+        tokio::spawn(tick());
+
+        dbg!("call async host func");
+
+        let async_state = AsyncState::new();
+        let _ = executor
+            .call_func_async(&async_state, &fn_start, [])
+            .await?;
+
+        dbg!("call async host func done");
+
+        Ok(())
+    }
+
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[tokio::test]
+    async fn test_executor_run_async_host_func() -> Result<(), Box<dyn std::error::Error>> {
+        fn async_hello(
+            _frame: CallingFrame,
+            _inputs: Vec<WasmValue>,
+            _: *mut std::os::raw::c_void,
+        ) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)>
+        {
+            Box::new(async move {
+                for _ in 0..10 {
+                    println!("[async hello] say hello");
+                    tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+                }
+
+                println!("[async hello] Done!");
+
+                Ok(vec![])
+            })
+        }
+
+        // create a Config
+        let mut config = Config::create()?;
+        config.wasi(true);
+        assert!(config.wasi_enabled());
+
+        // create an Executor
+        let result = Executor::create(None, None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+        assert!(!executor.inner.0.is_null());
+
+        // create a Store
+        let result = Store::create();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // create an AsyncWasiModule
+        let result = AsyncWasiModule::create(None, None, None);
+        assert!(result.is_ok());
+        let async_wasi_module = result.unwrap();
+
+        // register async_wasi module into the store
+        let wasi_import = WasiInstance::AsyncWasi(async_wasi_module);
+        let result = executor.register_wasi_instance(&mut store, &wasi_import);
+        assert!(result.is_ok());
+
+        let ty = FuncType::create([], [])?;
+        let async_hello_func =
+            Function::create_async_func::<NeverType>(&ty, Box::new(async_hello), None, 0)?;
+        let mut import = ImportModule::<NeverType>::create("extern", None)?;
+        import.add_func("async_hello", async_hello_func);
+
+        executor.register_import_module(&mut store, &import)?;
+
+        let extern_instance = store.module("extern")?;
+        let async_hello = extern_instance.get_func("async_hello")?;
+
+        async fn tick() {
+            let mut i = 0;
+            loop {
+                println!("[tick] i={i}");
+                tokio::time::sleep(std::time::Duration::from_millis(500)).await;
+                i += 1;
+            }
+        }
+        tokio::spawn(tick());
+
+        let async_state = AsyncState::new();
+        let _ = executor
+            .call_func_async(&async_state, &async_hello, [])
+            .await?;
+
+        Ok(())
+    }
+
+    #[sys_host_function]
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+    ) -> Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[sys_async_host_function]
+    async fn async_hello<T>(
+        _frame: CallingFrame,
+        _inputs: Vec<WasmValue>,
+        _data: *mut std::os::raw::c_void,
+    ) -> Result<Vec<WasmValue>, HostFuncError> {
+        for _ in 0..10 {
+            println!("[async hello] say hello");
+            tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+        }
+
+        println!("[async hello] Done!");
+
+        Ok(vec![])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/frame.rs.html b/src/wasmedge_sys/frame.rs.html new file mode 100644 index 000000000..6614ae38e --- /dev/null +++ b/src/wasmedge_sys/frame.rs.html @@ -0,0 +1,201 @@ +frame.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+
//! Defines WasmEdge CallingFrame.
+
+use crate::{
+    executor::InnerExecutor,
+    ffi,
+    instance::{memory::InnerMemory, module::InnerInstance},
+    Executor, Instance, Memory,
+};
+use parking_lot::Mutex;
+use std::sync::Arc;
+
+/// Represents a calling frame on top of stack.
+#[derive(Debug)]
+pub struct CallingFrame {
+    pub(crate) inner: InnerCallingFrame,
+}
+impl Drop for CallingFrame {
+    fn drop(&mut self) {
+        if !self.inner.0.is_null() {
+            self.inner.0 = std::ptr::null();
+        }
+    }
+}
+impl CallingFrame {
+    /// Creates a CallingFrame instance.
+    pub(crate) fn create(ctx: *const ffi::WasmEdge_CallingFrameContext) -> Self {
+        Self {
+            inner: InnerCallingFrame(ctx),
+        }
+    }
+
+    /// Returns the [executor instance](crate::Executor) from this calling frame.
+    pub fn executor_mut(&self) -> Option<Executor> {
+        let ctx = unsafe { ffi::WasmEdge_CallingFrameGetExecutor(self.inner.0) };
+
+        match ctx.is_null() {
+            false => Some(Executor {
+                inner: std::sync::Arc::new(InnerExecutor(ctx)),
+                registered: true,
+            }),
+            true => None,
+        }
+    }
+
+    /// Returns the [module instance](crate::Instance) in this calling frame.
+    ///
+    /// If the executing function instance is a host function and not added into any module instance, then returns `None`.
+    ///
+    /// When a wasm function is executing and trying to call a host function inside, a frame with the module
+    /// instance the wasm function belongs to will be pushed onto the stack. And therefore the calling frame
+    /// context will record that module instance.
+    ///
+    pub fn module_instance(&self) -> Option<Instance> {
+        let ctx = unsafe { ffi::WasmEdge_CallingFrameGetModuleInstance(self.inner.0) };
+
+        match ctx.is_null() {
+            false => Some(Instance {
+                inner: Arc::new(Mutex::new(InnerInstance(ctx as *mut _))),
+                registered: true,
+            }),
+            true => None,
+        }
+    }
+
+    /// Returns the [memory instance](crate::Memory) by the given index from the module instance of the current
+    /// calling frame. If the memory instance is not found, returns `None`.
+    ///
+    /// By default, a WASM module has only one memory instance after instantiation. Therefore, users can pass in `0` as
+    /// the index to get the memory instance in host function body. When the [MultiMemories](crate::Config::multi_memories)
+    /// config option is enabled, there would be more than one memory instances in the wasm module. Users can retrieve
+    /// the target memory instance by specifying the index of the memory instance in the wasm module instance.
+    ///
+    /// # Arguments
+    ///
+    /// * idx - The index of the memory instance.
+    ///
+    pub fn memory_mut(&self, idx: u32) -> Option<Memory> {
+        let ctx = unsafe { ffi::WasmEdge_CallingFrameGetMemoryInstance(self.inner.0, idx) };
+
+        match ctx.is_null() {
+            false => Some(Memory {
+                inner: std::sync::Arc::new(Mutex::new(InnerMemory(ctx))),
+                registered: true,
+            }),
+            true => None,
+        }
+    }
+
+    /// Provides a raw pointer to the inner CallingFrame context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_CallingFrameContext {
+        self.inner.0 as *const _
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerCallingFrame(pub(crate) *const ffi::WasmEdge_CallingFrameContext);
+unsafe impl Send for InnerCallingFrame {}
+unsafe impl Sync for InnerCallingFrame {}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/instance/function.rs.html b/src/wasmedge_sys/instance/function.rs.html new file mode 100644 index 000000000..f3d71e393 --- /dev/null +++ b/src/wasmedge_sys/instance/function.rs.html @@ -0,0 +1,3273 @@ +function.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+
//! Defines WasmEdge Function and FuncType structs.
+
+use crate::{
+    ffi, BoxedFn, CallingFrame, Engine, WasmEdgeResult, WasmValue, HOST_FUNCS, HOST_FUNC_FOOTPRINTS,
+};
+#[cfg(all(feature = "async", target_os = "linux"))]
+use crate::{
+    r#async::fiber::{AsyncCx, AsyncState, FiberFuture},
+    BoxedAsyncFn, ASYNC_HOST_FUNCS,
+};
+use core::ffi::c_void;
+use parking_lot::Mutex;
+use rand::Rng;
+use std::{convert::TryInto, sync::Arc};
+use wasmedge_types::{
+    error::{FuncError, HostFuncError, WasmEdgeError},
+    ValType,
+};
+
+pub type CustomFnWrapper = unsafe extern "C" fn(
+    key_ptr: *mut c_void,
+    data_ptr: *mut c_void,
+    calling_frame_ctx: *const ffi::WasmEdge_CallingFrameContext,
+    params: *const ffi::WasmEdge_Value,
+    param_len: u32,
+    returns: *mut ffi::WasmEdge_Value,
+    return_len: u32,
+) -> ffi::WasmEdge_Result;
+
+// Wrapper function for thread-safe scenarios.
+extern "C" fn wrap_fn(
+    key_ptr: *mut c_void,
+    data: *mut std::os::raw::c_void,
+    call_frame_ctx: *const ffi::WasmEdge_CallingFrameContext,
+    params: *const ffi::WasmEdge_Value,
+    param_len: u32,
+    returns: *mut ffi::WasmEdge_Value,
+    return_len: u32,
+) -> ffi::WasmEdge_Result {
+    let frame = CallingFrame::create(call_frame_ctx);
+
+    let key = key_ptr as *const usize as usize;
+
+    let input = {
+        let raw_input = unsafe {
+            std::slice::from_raw_parts(
+                params,
+                param_len
+                    .try_into()
+                    .expect("len of params should not greater than usize"),
+            )
+        };
+        raw_input.iter().map(|r| (*r).into()).collect::<Vec<_>>()
+    };
+
+    let return_len = return_len
+        .try_into()
+        .expect("len of returns should not greater than usize");
+    let raw_returns = unsafe { std::slice::from_raw_parts_mut(returns, return_len) };
+    let map_host_func = HOST_FUNCS.read();
+    match map_host_func.get(&key) {
+        None => unsafe { ffi::WasmEdge_ResultGen(ffi::WasmEdge_ErrCategory_WASM, 5) },
+        Some(host_func) => {
+            let real_fn = Arc::clone(host_func);
+            let real_fn_locked = real_fn.lock();
+            drop(map_host_func);
+
+            match real_fn_locked(frame, input, data) {
+                Ok(returns) => {
+                    assert!(returns.len() == return_len, "[wasmedge-sys] check the number of returns of host function. Expected: {}, actual: {}", return_len, returns.len());
+                    for (idx, wasm_value) in returns.into_iter().enumerate() {
+                        raw_returns[idx] = wasm_value.as_raw();
+                    }
+                    ffi::WasmEdge_Result { Code: 0 }
+                }
+                Err(err) => match err {
+                    HostFuncError::User(code) => unsafe {
+                        ffi::WasmEdge_ResultGen(ffi::WasmEdge_ErrCategory_UserLevelError, code)
+                    },
+                    HostFuncError::Runtime(code) => unsafe {
+                        ffi::WasmEdge_ResultGen(ffi::WasmEdge_ErrCategory_WASM, code)
+                    },
+                },
+            }
+        }
+    }
+}
+
+// Wrapper function for thread-safe scenarios.
+#[cfg(all(feature = "async", target_os = "linux"))]
+extern "C" fn wrap_async_fn(
+    key_ptr: *mut c_void,
+    data: *mut std::os::raw::c_void,
+    call_frame_ctx: *const ffi::WasmEdge_CallingFrameContext,
+    params: *const ffi::WasmEdge_Value,
+    param_len: u32,
+    returns: *mut ffi::WasmEdge_Value,
+    return_len: u32,
+) -> ffi::WasmEdge_Result {
+    // arguments
+    let input = {
+        let raw_input = unsafe {
+            std::slice::from_raw_parts(
+                params,
+                param_len
+                    .try_into()
+                    .expect("len of params should not greater than usize"),
+            )
+        };
+        raw_input.iter().map(|r| (*r).into()).collect::<Vec<_>>()
+    };
+
+    // returns
+    let return_len = return_len
+        .try_into()
+        .expect("len of returns should not greater than usize");
+    let raw_returns = unsafe { std::slice::from_raw_parts_mut(returns, return_len) };
+
+    // get and call host function
+    let key = key_ptr as *const usize as usize;
+    let map_host_func = ASYNC_HOST_FUNCS.read();
+    match map_host_func.get(&key) {
+        None => unsafe { ffi::WasmEdge_ResultGen(ffi::WasmEdge_ErrCategory_WASM, 5) },
+        Some(host_func) => {
+            // get host function
+            let real_fn = Arc::clone(host_func);
+            let real_fn_locked = real_fn.lock();
+            drop(map_host_func);
+
+            let frame = CallingFrame::create(call_frame_ctx);
+            let async_cx = AsyncCx::new();
+            let mut future = std::pin::Pin::from(real_fn_locked(frame, input, data));
+            // call host function
+            let result = match unsafe { async_cx.block_on(future.as_mut()) } {
+                Ok(Ok(ret)) => Ok(ret),
+                Ok(Err(err)) => Err(err),
+                Err(_err) => Err(HostFuncError::Runtime(0x07)),
+            };
+
+            // parse result
+            match result {
+                Ok(returns) => {
+                    assert!(returns.len() == return_len, "[wasmedge-sys] check the number of returns of async host function. Expected: {}, actual: {}", return_len, returns.len());
+                    for (idx, wasm_value) in returns.into_iter().enumerate() {
+                        raw_returns[idx] = wasm_value.as_raw();
+                    }
+                    ffi::WasmEdge_Result { Code: 0 }
+                }
+                Err(err) => match err {
+                    HostFuncError::User(code) => unsafe {
+                        ffi::WasmEdge_ResultGen(ffi::WasmEdge_ErrCategory_UserLevelError, code)
+                    },
+                    HostFuncError::Runtime(code) => unsafe {
+                        ffi::WasmEdge_ResultGen(ffi::WasmEdge_ErrCategory_WASM, code)
+                    },
+                },
+            }
+        }
+    }
+}
+
+/// Defines a host function.
+///
+/// A WasmEdge [Function] defines a WebAssembly host function described by its [type](crate::FuncType). A host function is a closure of the original function defined in either the host or the WebAssembly module.
+#[derive(Debug)]
+pub struct Function {
+    pub(crate) inner: Arc<Mutex<InnerFunc>>,
+    pub(crate) registered: bool,
+    pub(crate) data_owner: bool,
+}
+impl Function {
+    /// Creates a [host function](crate::Function) with the given function type.
+    ///
+    /// N.B. that this function is used for thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The types of the arguments and returns of the target function.
+    ///
+    /// * `real_fn` - The pointer to the target function.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// * `cost` - The function cost in the [Statistics](crate::Statistics). Pass 0 if the calculation is not needed.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](wasmedge_types::error::FuncError) is returned.
+    ///
+    /// # Example
+    ///
+    /// The example defines a host function `real_add`, and creates a [Function] binding to it by calling
+    /// the `create_binding` method.
+    ///
+    /// ```rust
+    /// use wasmedge_macro::sys_host_function;
+    /// use wasmedge_sys::{FuncType, Function, WasmValue, CallingFrame};
+    /// use wasmedge_types::{error::HostFuncError, ValType, WasmEdgeResult, NeverType};
+    ///
+    /// #[sys_host_function]
+    /// fn real_add(_frame: CallingFrame, inputs: Vec<WasmValue>) -> Result<Vec<WasmValue>, HostFuncError> {
+    ///     if inputs.len() != 2 {
+    ///         return Err(HostFuncError::User(1));
+    ///     }
+    ///
+    ///     let a = if inputs[0].ty() == ValType::I32 {
+    ///         inputs[0].to_i32()
+    ///     } else {
+    ///         return Err(HostFuncError::User(2));
+    ///     };
+    ///
+    ///     let b = if inputs[1].ty() == ValType::I32 {
+    ///         inputs[1].to_i32()
+    ///     } else {
+    ///         return Err(HostFuncError::User(3));
+    ///     };
+    ///
+    ///     let c = a + b;
+    ///
+    ///     Ok(vec![WasmValue::from_i32(c)])
+    /// }
+    ///
+    /// // create a FuncType
+    /// let func_ty = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]).expect("fail to create a FuncType");
+    ///
+    /// // create a Function instance
+    /// let func = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0).expect("fail to create a Function instance");
+    /// ```
+    pub fn create_sync_func<T>(
+        ty: &FuncType,
+        real_fn: BoxedFn,
+        data: Option<Box<T>>,
+        cost: u64,
+    ) -> WasmEdgeResult<Self> {
+        let (data, data_owner) = match data {
+            Some(d) => (Box::into_raw(d) as *mut std::ffi::c_void, true),
+            None => (std::ptr::null_mut(), false),
+        };
+
+        unsafe { Self::create_with_data(ty, real_fn, data, data_owner, cost) }
+    }
+
+    /// Creates a [host function](crate::Function) with the given function type.
+    ///
+    /// N.B. that this function is used for thread-safe scenarios.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The types of the arguments and returns of the target function.
+    ///
+    /// * `real_fn` - The pointer to the target function.
+    ///
+    /// * `data` - The pointer to the host context data used in this function.
+    ///
+    /// * `data_owner` - Whether the host context data is owned by the host function.
+    ///
+    /// * `cost` - The function cost in the [Statistics](crate::Statistics). Pass 0 if the calculation is not needed.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
+    ///
+    unsafe fn create_with_data(
+        ty: &FuncType,
+        real_fn: BoxedFn,
+        data: *mut c_void,
+        data_owner: bool,
+        cost: u64,
+    ) -> WasmEdgeResult<Self> {
+        let mut map_host_func = HOST_FUNCS.write();
+
+        // generate key for the coming host function
+        let mut rng = rand::thread_rng();
+        let mut key: usize = rng.gen();
+        while map_host_func.contains_key(&key) {
+            key = rng.gen();
+        }
+        map_host_func.insert(key, Arc::new(Mutex::new(real_fn)));
+        drop(map_host_func);
+
+        let ctx = ffi::WasmEdge_FunctionInstanceCreateBinding(
+            ty.inner.0,
+            Some(wrap_fn),
+            key as *const usize as *mut c_void,
+            data,
+            cost,
+        );
+
+        // create a footprint for the host function
+        let footprint = ctx as usize;
+        let mut footprint_to_id = HOST_FUNC_FOOTPRINTS.lock();
+        footprint_to_id.insert(footprint, key);
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Func(FuncError::Create))),
+            false => Ok(Self {
+                inner: Arc::new(Mutex::new(InnerFunc(ctx))),
+                registered: false,
+                data_owner,
+            }),
+        }
+    }
+
+    /// Creates an async [host function](crate::Function) with the given function type.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The types of the arguments and returns of the target function.
+    ///
+    /// * `real_fn` - The pointer to the target function.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// * `cost` - The function cost in the [Statistics](crate::Statistics). Pass 0 if the calculation is not needed.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](wasmedge_types::error::FuncError) is returned.
+    ///
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub fn create_async_func<T: Send + Sync>(
+        ty: &FuncType,
+        real_fn: BoxedAsyncFn,
+        data: Option<Box<T>>,
+        cost: u64,
+    ) -> WasmEdgeResult<Self> {
+        let (data, data_owner) = match data {
+            Some(d) => (Box::into_raw(d) as *mut std::ffi::c_void, true),
+            None => (std::ptr::null_mut(), false),
+        };
+
+        let mut map_host_func = ASYNC_HOST_FUNCS.write();
+
+        // generate key for the coming host function
+        let mut rng = rand::thread_rng();
+        let mut key: usize = rng.gen();
+        while map_host_func.contains_key(&key) {
+            key = rng.gen();
+        }
+        map_host_func.insert(key, Arc::new(Mutex::new(real_fn)));
+        drop(map_host_func);
+
+        let ctx = unsafe {
+            ffi::WasmEdge_FunctionInstanceCreateBinding(
+                ty.inner.0,
+                Some(wrap_async_fn),
+                key as *const usize as *mut c_void,
+                data,
+                cost,
+            )
+        };
+
+        // create a footprint for the host function
+        let footprint = ctx as usize;
+        let mut footprint_to_id = HOST_FUNC_FOOTPRINTS.lock();
+        footprint_to_id.insert(footprint, key);
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Func(FuncError::Create))),
+            false => Ok(Self {
+                inner: Arc::new(Mutex::new(InnerFunc(ctx))),
+                registered: false,
+                data_owner,
+            }),
+        }
+    }
+
+    /// Creates a [host function](crate::Function) with the given function type and the custom function wrapper.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The types of the arguments and returns of the target function.
+    ///
+    /// * `fn_wrapper` - The custom function wrapper.
+    ///
+    /// * `real_fn` - The pointer to the target function.
+    ///
+    /// * `data` - The pointer to the host context data used in this function.
+    ///
+    /// * `data_owner` - Whether the host context data is owned by the host function.
+    ///
+    /// * `cost` - The function cost in the [Statistics](crate::Statistics). Pass 0 if the calculation is not needed.
+    ///
+    /// # Error
+    ///
+    /// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](wasmedge_types::error::FuncError) is returned.
+    ///
+    /// # Safety
+    ///
+    /// Notice that the caller should guarantee the life cycle of both the `real_fn` and the `data` object.
+    ///
+    pub unsafe fn create_with_custom_wrapper(
+        ty: &FuncType,
+        fn_wrapper: CustomFnWrapper,
+        real_fn: *mut c_void,
+        data: *mut c_void,
+        data_owner: bool,
+        cost: u64,
+    ) -> WasmEdgeResult<Self> {
+        let ctx = ffi::WasmEdge_FunctionInstanceCreateBinding(
+            ty.inner.0,
+            Some(fn_wrapper),
+            real_fn,
+            data,
+            cost,
+        );
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Func(FuncError::Create))),
+            false => Ok(Self {
+                inner: Arc::new(Mutex::new(InnerFunc(ctx))),
+                registered: false,
+                data_owner,
+            }),
+        }
+    }
+
+    /// Returns the underlying wasm type of this [Function].
+    ///
+    /// # Errors
+    ///
+    /// If fail to get the function type, then an error is returned.
+    ///
+    pub fn ty(&self) -> WasmEdgeResult<FuncType> {
+        let ty = unsafe { ffi::WasmEdge_FunctionInstanceGetFunctionType(self.inner.lock().0) };
+        match ty.is_null() {
+            true => Err(Box::new(WasmEdgeError::Func(FuncError::Type))),
+            false => Ok(FuncType {
+                inner: InnerFuncType(ty as *mut _),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Runs this host function and returns the result.
+    ///
+    /// # Arguments
+    ///
+    /// * `engine` - The object implementing the [Engine](crate::Engine) trait.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    ///
+    pub fn call<E: Engine>(
+        &self,
+        engine: &E,
+        args: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        engine.run_func(self, args)
+    }
+
+    /// Runs this host function asynchronously and returns the result.
+    ///
+    /// # Arguments
+    ///
+    /// * `async_state` - Used to store asynchronous state at run time.
+    ///
+    /// * `engine` - The object implementing the [Engine](crate::Engine) trait.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    ///
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    pub async fn call_async<E: Engine + Send + Sync>(
+        &self,
+        async_state: &AsyncState,
+        engine: &E,
+        args: impl IntoIterator<Item = WasmValue> + Send,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        FiberFuture::on_fiber(async_state, || engine.run_func(self, args))
+            .await
+            .unwrap()
+    }
+
+    /// Returns a reference to this [Function] instance.
+    pub fn as_ref(&self) -> FuncRef {
+        FuncRef {
+            inner: InnerFuncRef(self.inner.lock().0 as *const _),
+        }
+    }
+
+    /// Provides a raw pointer to the inner function context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_FunctionInstanceContext {
+        self.inner.lock().0 as *const _
+    }
+}
+impl Drop for Function {
+    #[allow(clippy::from_raw_with_void_ptr)]
+    fn drop(&mut self) {
+        if !self.registered && Arc::strong_count(&self.inner) == 1 {
+            // remove the real_func from HOST_FUNCS
+            let footprint = self.inner.lock().0 as usize;
+            if let Some(key) = HOST_FUNC_FOOTPRINTS.lock().remove(&footprint) {
+                let mut map_host_func = HOST_FUNCS.write();
+                if map_host_func.contains_key(&key) {
+                    map_host_func.remove(&key).expect(
+                    "[wasmedge-sys] Failed to remove the host function from HOST_FUNCS_NEW container",
+                );
+                }
+
+                #[cfg(all(feature = "async", target_os = "linux"))]
+                {
+                    let mut map_host_func = ASYNC_HOST_FUNCS.write();
+                    if map_host_func.contains_key(&key) {
+                        map_host_func.remove(&key).expect(
+                    "[wasmedge-sys] Failed to remove the host function from ASYNC_HOST_FUNCS container",
+                );
+                    }
+                }
+            } else {
+                panic!("[wasmedge-sys] Failed to remove the host function from HOST_FUNC_FOOTPRINTS container");
+            }
+
+            // drop host data
+            if self.data_owner {
+                let _ = unsafe {
+                    Box::from_raw(
+                        ffi::WasmEdge_FunctionInstanceGetData(self.inner.lock().0) as *mut c_void
+                    )
+                };
+            }
+
+            // delete the function instance
+            if !self.inner.lock().0.is_null() {
+                unsafe {
+                    ffi::WasmEdge_FunctionInstanceDelete(self.inner.lock().0);
+                };
+            }
+        }
+    }
+}
+impl Clone for Function {
+    fn clone(&self) -> Self {
+        Self {
+            inner: self.inner.clone(),
+            registered: self.registered,
+            data_owner: self.data_owner,
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerFunc(pub(crate) *mut ffi::WasmEdge_FunctionInstanceContext);
+unsafe impl Send for InnerFunc {}
+unsafe impl Sync for InnerFunc {}
+
+/// Defines the type of a [host function](crate::Function).
+///
+/// A WasmEdge [FuncType] classifies the signature of a [Function], including the type information of both the arguments and the returns.
+#[derive(Debug)]
+pub struct FuncType {
+    pub(crate) inner: InnerFuncType,
+    pub(crate) registered: bool,
+}
+impl FuncType {
+    /// Create a new [FuncType] to be associated with the given arguments and returns.
+    ///
+    /// # Arguments
+    ///
+    /// * `args` - The argument types of a [Function].
+    ///
+    /// * `returns` - The types of the returns of a [Function].
+    ///
+    /// # Error
+    ///
+    /// If fail to create a [FuncType], then an error is returned.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// use wasmedge_sys::FuncType;
+    /// use wasmedge_types::ValType;
+    ///
+    /// let func_ty = FuncType::create(vec![ValType::I32;2], vec![ValType::I32]).expect("fail to create a FuncType");
+    /// ```
+    pub fn create<I: IntoIterator<Item = ValType>, R: IntoIterator<Item = ValType>>(
+        args: I,
+        returns: R,
+    ) -> WasmEdgeResult<Self> {
+        let param_tys = args
+            .into_iter()
+            .map(|x| x.into())
+            .collect::<Vec<ffi::WasmEdge_ValType>>();
+        let ret_tys = returns
+            .into_iter()
+            .map(|x| x.into())
+            .collect::<Vec<ffi::WasmEdge_ValType>>();
+
+        let ctx = unsafe {
+            ffi::WasmEdge_FunctionTypeCreate(
+                param_tys.as_ptr() as *const _,
+                param_tys.len() as u32,
+                ret_tys.as_ptr() as *const _,
+                ret_tys.len() as u32,
+            )
+        };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::FuncTypeCreate)),
+            false => Ok(Self {
+                inner: InnerFuncType(ctx),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Returns the number of the arguments of a [Function].
+    pub fn params_len(&self) -> u32 {
+        unsafe { ffi::WasmEdge_FunctionTypeGetParametersLength(self.inner.0) }
+    }
+
+    /// Returns an Iterator of the arguments of a [Function].
+    pub fn params_type_iter(&self) -> impl Iterator<Item = ValType> {
+        let len = self.params_len();
+        let mut types = Vec::with_capacity(len as usize);
+        unsafe {
+            ffi::WasmEdge_FunctionTypeGetParameters(self.inner.0, types.as_mut_ptr(), len);
+            types.set_len(len as usize);
+        }
+
+        types.into_iter().map(Into::into)
+    }
+
+    ///Returns the number of the returns of a [Function].
+    pub fn returns_len(&self) -> u32 {
+        unsafe { ffi::WasmEdge_FunctionTypeGetReturnsLength(self.inner.0) }
+    }
+
+    /// Returns an Iterator of the return types of a [Function].
+    pub fn returns_type_iter(&self) -> impl Iterator<Item = ValType> {
+        let len = self.returns_len();
+        let mut types = Vec::with_capacity(len as usize);
+        unsafe {
+            ffi::WasmEdge_FunctionTypeGetReturns(self.inner.0, types.as_mut_ptr(), len);
+            types.set_len(len as usize);
+        }
+
+        types.into_iter().map(Into::into)
+    }
+
+    /// Provides a raw pointer to the inner function type context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_FunctionTypeContext {
+        self.inner.0 as *const _
+    }
+}
+impl Drop for FuncType {
+    fn drop(&mut self) {
+        if !self.registered && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_FunctionTypeDelete(self.inner.0) };
+        }
+    }
+}
+impl From<wasmedge_types::FuncType> for FuncType {
+    fn from(ty: wasmedge_types::FuncType) -> Self {
+        let param_tys: Vec<_> = match ty.args() {
+            Some(args) => args.to_vec(),
+            None => Vec::new(),
+        };
+        let ret_tys: Vec<_> = match ty.returns() {
+            Some(returns) => returns.to_vec(),
+            None => Vec::new(),
+        };
+
+        FuncType::create(param_tys, ret_tys).expect("[wasmedge-sys] Failed to convert wasmedge_types::FuncType into wasmedge_sys::FuncType.")
+    }
+}
+impl From<FuncType> for wasmedge_types::FuncType {
+    fn from(ty: FuncType) -> Self {
+        let args = if ty.params_len() > 0 {
+            let mut args = Vec::with_capacity(ty.params_len() as usize);
+            for ty in ty.params_type_iter() {
+                args.push(ty);
+            }
+            Some(args)
+        } else {
+            None
+        };
+
+        let returns = if ty.returns_len() > 0 {
+            let mut returns = Vec::with_capacity(ty.returns_len() as usize);
+            for ty in ty.returns_type_iter() {
+                returns.push(ty);
+            }
+            Some(returns)
+        } else {
+            None
+        };
+
+        wasmedge_types::FuncType::new(args, returns)
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerFuncType(pub(crate) *mut ffi::WasmEdge_FunctionTypeContext);
+unsafe impl Send for InnerFuncType {}
+unsafe impl Sync for InnerFuncType {}
+
+/// Defines a reference to a [host function](crate::Function).
+#[derive(Debug, Clone)]
+pub struct FuncRef {
+    pub(crate) inner: InnerFuncRef,
+}
+impl Drop for FuncRef {
+    fn drop(&mut self) {
+        self.inner.0 = std::ptr::null();
+    }
+}
+impl FuncRef {
+    /// Returns the underlying wasm type of the host function this [FuncRef] points to.
+    ///
+    /// # Errors
+    ///
+    /// If fail to get the function type, then an error is returned.
+    ///
+    pub fn ty(&self) -> WasmEdgeResult<FuncType> {
+        let ty = unsafe { ffi::WasmEdge_FunctionInstanceGetFunctionType(self.inner.0 as *mut _) };
+        match ty.is_null() {
+            true => Err(Box::new(WasmEdgeError::Func(FuncError::Type))),
+            false => Ok(FuncType {
+                inner: InnerFuncType(ty as *mut _),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Runs this host function the reference refers to.
+    ///
+    /// # Arguments
+    ///
+    /// * `engine` - The object implementing the [Engine](crate::Engine) trait.
+    ///
+    /// * `args` - The arguments passed to the host function.
+    ///
+    /// # Error
+    ///
+    /// If fail to run the host function, then an error is returned.
+    ///
+    pub fn call<E: Engine>(
+        &self,
+        engine: &E,
+        args: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>> {
+        engine.run_func_ref(self, args)
+    }
+}
+
+#[derive(Debug, Clone)]
+pub(crate) struct InnerFuncRef(pub(crate) *const ffi::WasmEdge_FunctionInstanceContext);
+unsafe impl Send for InnerFuncRef {}
+unsafe impl Sync for InnerFuncRef {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    use crate::{r#async::AsyncWasiModule, WasiInstance, ASYNC_HOST_FUNCS};
+    use crate::{types::WasmValue, AsImport, Executor, ImportModule, Store, HOST_FUNC_FOOTPRINTS};
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_macro::sys_host_function;
+    use wasmedge_types::{NeverType, ValType};
+
+    #[test]
+    fn test_func_type() {
+        // test FuncType with args and returns
+        {
+            let param_tys = vec![
+                ValType::I32,
+                ValType::I64,
+                ValType::F32,
+                ValType::F64,
+                ValType::V128,
+                ValType::ExternRef,
+            ];
+            let param_len = param_tys.len();
+            let ret_tys = vec![ValType::FuncRef, ValType::ExternRef, ValType::V128];
+            let ret_len = ret_tys.len();
+
+            // create FuncType
+            let result = FuncType::create(param_tys, ret_tys);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+
+            // check parameters
+            assert_eq!(func_ty.params_len(), param_len as u32);
+            let param_tys = func_ty.params_type_iter().collect::<Vec<_>>();
+            assert_eq!(
+                param_tys,
+                vec![
+                    ValType::I32,
+                    ValType::I64,
+                    ValType::F32,
+                    ValType::F64,
+                    ValType::V128,
+                    ValType::ExternRef,
+                ]
+            );
+
+            // check returns
+            assert_eq!(func_ty.returns_len(), ret_len as u32);
+            let return_tys = func_ty.returns_type_iter().collect::<Vec<_>>();
+            assert_eq!(
+                return_tys,
+                vec![ValType::FuncRef, ValType::ExternRef, ValType::V128]
+            );
+        }
+
+        // test FuncType without args and returns
+        {
+            // create FuncType
+            let result = FuncType::create([], []);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+
+            assert_eq!(func_ty.params_len(), 0);
+            assert_eq!(func_ty.returns_len(), 0);
+        }
+    }
+
+    #[test]
+    fn test_func_basic() {
+        #[derive(Debug)]
+        struct Data<T, S> {
+            _x: i32,
+            _y: String,
+            _v: Vec<T>,
+            _s: Vec<S>,
+        }
+        let data: Data<i32, &str> = Data {
+            _x: 12,
+            _y: "hello".to_string(),
+            _v: vec![1, 2, 3],
+            _s: vec!["macos", "linux", "windows"],
+        };
+
+        fn real_add<T: core::fmt::Debug>(
+            _frame: CallingFrame,
+            input: Vec<WasmValue>,
+            data: *mut std::ffi::c_void,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            println!("Rust: Entering Rust function real_add");
+
+            // Do not use `Box::from_raw`: let host_data = unsafe { Box::from_raw(data as *mut T) };
+            let host_data = unsafe { &mut *(data as *mut T) };
+            println!("host_data: {:?}", host_data);
+
+            if input.len() != 2 {
+                return Err(HostFuncError::User(1));
+            }
+
+            let a = if input[0].ty() == ValType::I32 {
+                input[0].to_i32()
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+
+            let b = if input[1].ty() == ValType::I32 {
+                input[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            let c = a + b;
+            println!("Rust: calcuating in real_add c: {c:?}");
+
+            println!("Rust: Leaving Rust function real_add");
+            Ok(vec![WasmValue::from_i32(c)])
+        }
+
+        assert_eq!(HOST_FUNCS.read().len(), 0);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 0);
+
+        // create a FuncType
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        // create a host function
+        let result = Function::create_sync_func(
+            &func_ty,
+            Box::new(real_add::<Data<i32, &str>>),
+            Some(Box::new(data)),
+            0,
+        );
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        // get func type
+        let result = host_func.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+
+        // check parameters
+        assert_eq!(ty.params_len(), 2);
+        let param_tys = ty.params_type_iter().collect::<Vec<_>>();
+        assert_eq!(param_tys, vec![ValType::I32; 2]);
+
+        // check returns
+        assert_eq!(ty.returns_len(), 1);
+        let return_tys = ty.returns_type_iter().collect::<Vec<_>>();
+        assert_eq!(return_tys, vec![ValType::I32]);
+
+        // run this function
+        let result = Executor::create(None, None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+        let result = host_func.call(
+            &mut executor,
+            vec![WasmValue::from_i32(1), WasmValue::from_i32(2)],
+        );
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns[0].to_i32(), 3);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_func_create_host_func_in_host_func() {
+        #[sys_host_function]
+        fn func(
+            _frame: CallingFrame,
+            _input: Vec<WasmValue>,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            println!("Entering host function: func");
+
+            // spawn a new thread to create a new host function
+            let handler = std::thread::spawn(|| {
+                #[sys_host_function]
+                fn real_add(
+                    _frame: CallingFrame,
+                    input: Vec<WasmValue>,
+                ) -> Result<Vec<WasmValue>, HostFuncError> {
+                    println!("Rust: Entering Rust function real_add");
+
+                    if input.len() != 2 {
+                        return Err(HostFuncError::User(1));
+                    }
+
+                    let a = if input[0].ty() == ValType::I32 {
+                        input[0].to_i32()
+                    } else {
+                        return Err(HostFuncError::User(2));
+                    };
+
+                    let b = if input[1].ty() == ValType::I32 {
+                        input[1].to_i32()
+                    } else {
+                        return Err(HostFuncError::User(3));
+                    };
+
+                    let c = a + b;
+
+                    println!("Rust: Leaving Rust function real_add");
+                    Ok(vec![WasmValue::from_i32(c)])
+                }
+
+                // create a FuncType
+                let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+                assert!(result.is_ok());
+                let func_ty = result.unwrap();
+                // create a host function
+                let result =
+                    Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+                assert!(result.is_ok());
+                let host_func = result.unwrap();
+
+                // run this function
+                let result = Executor::create(None, None);
+                assert!(result.is_ok());
+                let mut executor = result.unwrap();
+                let result = host_func.call(
+                    &mut executor,
+                    vec![WasmValue::from_i32(1), WasmValue::from_i32(2)],
+                );
+                assert!(result.is_ok());
+                let returns = result.unwrap();
+                assert_eq!(returns[0].to_i32(), 3);
+            });
+            handler.join().unwrap();
+
+            println!("Leaving host function: func");
+            Ok(vec![])
+        }
+
+        // create a FuncType
+        let result = FuncType::create(vec![], vec![]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        // create a host function
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(func), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        // run this function
+        let result = Executor::create(None, None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+        let result = host_func.call(&mut executor, vec![]);
+        assert!(result.is_ok());
+    }
+
+    #[test]
+    fn test_func_send() {
+        // create a FuncType
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        // create a host function
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            // get func type
+            let result = host_func.ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+
+            // check parameters
+            assert_eq!(ty.params_len(), 2);
+            let param_tys = ty.params_type_iter().collect::<Vec<_>>();
+            assert_eq!(param_tys, vec![ValType::I32; 2]);
+
+            // check returns
+            assert_eq!(ty.returns_len(), 1);
+            let return_tys = ty.returns_type_iter().collect::<Vec<_>>();
+            assert_eq!(return_tys, vec![ValType::I32]);
+        });
+
+        handle.join().unwrap()
+    }
+
+    #[test]
+    fn test_func_sync() {
+        // create a FuncType
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        // create a host function
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = Arc::new(Mutex::new(result.unwrap()));
+
+        let host_func_cloned = Arc::clone(&host_func);
+        let handle = thread::spawn(move || {
+            let result = host_func_cloned.lock();
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+
+            // get func type
+            let result = host_func.ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+
+            // check parameters
+            assert_eq!(ty.params_len(), 2);
+            let param_tys = ty.params_type_iter().collect::<Vec<_>>();
+            assert_eq!(param_tys, vec![ValType::I32; 2]);
+
+            // check returns
+            assert_eq!(ty.returns_len(), 1);
+            let return_tys = ty.returns_type_iter().collect::<Vec<_>>();
+            assert_eq!(return_tys, vec![ValType::I32]);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[sys_host_function]
+    fn real_add(
+        _frame: CallingFrame,
+        input: Vec<WasmValue>,
+    ) -> Result<Vec<WasmValue>, HostFuncError> {
+        println!("Rust: Entering Rust function real_add");
+
+        if input.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if input[0].ty() == ValType::I32 {
+            input[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if input[1].ty() == ValType::I32 {
+            input[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+        println!("Rust: calcuating in real_add c: {c:?}");
+
+        println!("Rust: Leaving Rust function real_add");
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+
+    #[test]
+    fn test_func_closure() -> Result<(), Box<dyn std::error::Error>> {
+        {
+            // create a host function
+            let real_add = |_: CallingFrame,
+                            input: Vec<WasmValue>,
+                            _: *mut std::os::raw::c_void|
+             -> Result<Vec<WasmValue>, HostFuncError> {
+                println!("Rust: Entering Rust function real_add");
+
+                if input.len() != 2 {
+                    return Err(HostFuncError::User(1));
+                }
+
+                let a = if input[0].ty() == ValType::I32 {
+                    input[0].to_i32()
+                } else {
+                    return Err(HostFuncError::User(2));
+                };
+
+                let b = if input[1].ty() == ValType::I32 {
+                    input[1].to_i32()
+                } else {
+                    return Err(HostFuncError::User(3));
+                };
+
+                let c = a + b;
+                println!("Rust: calcuating in real_add c: {c:?}");
+
+                println!("Rust: Leaving Rust function real_add");
+                Ok(vec![WasmValue::from_i32(c)])
+            };
+
+            // create a FuncType
+            let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+
+            // create a host function from the closure defined above
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+
+            // create a Store
+            let result = Store::create();
+            assert!(result.is_ok());
+            let mut store = result.unwrap();
+
+            // create an ImportModule
+            let mut import = ImportModule::<NeverType>::create("extern", None)?;
+            import.add_func("add", host_func);
+
+            // run this function
+            let result = Executor::create(None, None);
+            assert!(result.is_ok());
+            let mut executor = result.unwrap();
+            executor.register_import_module(&mut store, &import)?;
+
+            let extern_instance = store.module("extern")?;
+            let add = extern_instance.get_func("add")?;
+
+            let result =
+                executor.call_func(&add, vec![WasmValue::from_i32(1), WasmValue::from_i32(2)]);
+            assert!(result.is_ok());
+            let returns = result.unwrap();
+            assert_eq!(returns[0].to_i32(), 3);
+        }
+
+        assert_eq!(HOST_FUNCS.read().len(), 0);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 0);
+
+        Ok(())
+    }
+
+    #[test]
+    fn test_func_drop_v1() -> Result<(), Box<dyn std::error::Error>> {
+        // create a host function
+        let real_add = |_: CallingFrame,
+                        input: Vec<WasmValue>,
+                        _: *mut std::os::raw::c_void|
+         -> Result<Vec<WasmValue>, HostFuncError> {
+            println!("Rust: Entering Rust function real_add");
+
+            if input.len() != 2 {
+                return Err(HostFuncError::User(1));
+            }
+
+            let a = if input[0].ty() == ValType::I32 {
+                input[0].to_i32()
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+
+            let b = if input[1].ty() == ValType::I32 {
+                input[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            let c = a + b;
+            println!("Rust: calcuating in real_add c: {c:?}");
+
+            println!("Rust: Leaving Rust function real_add");
+            Ok(vec![WasmValue::from_i32(c)])
+        };
+
+        // create a FuncType
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+
+        // create a host function
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        assert_eq!(Arc::strong_count(&host_func.inner), 1);
+        assert!(!host_func.registered);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // clone the host function before adding it to the import object
+        let host_func_cloned = host_func.clone();
+
+        assert_eq!(Arc::strong_count(&host_func_cloned.inner), 2);
+        assert!(!host_func_cloned.registered);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // create an ImportModule
+        let mut import = ImportModule::<NeverType>::create("extern", None)?;
+        // add the host function to the import module
+        import.add_func("add", host_func);
+
+        assert_eq!(Arc::strong_count(&host_func_cloned.inner), 2);
+        assert!(!host_func_cloned.registered);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        drop(host_func_cloned);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // create a Store
+        let result = Store::create();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // run this function
+        let result = Executor::create(None, None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+        executor.register_import_module(&mut store, &import)?;
+
+        // get the registered host function
+        let extern_instance = store.module("extern")?;
+        let add = extern_instance.get_func("add")?;
+        assert_eq!(Arc::strong_count(&add.inner), 1);
+        assert!(add.registered);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // clone the host function
+        let add_cloned = add.clone();
+        assert_eq!(Arc::strong_count(&add.inner), 2);
+        assert!(add.registered);
+        assert_eq!(Arc::strong_count(&add_cloned.inner), 2);
+        assert!(add_cloned.registered);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // drop the cloned host function
+        drop(add_cloned);
+        assert_eq!(Arc::strong_count(&add.inner), 1);
+        assert!(add.registered);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        drop(add);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // get the registered host function again
+        let extern_instance = store.module("extern")?;
+        let add_again = extern_instance.get_func("add")?;
+        assert_eq!(Arc::strong_count(&add_again.inner), 1);
+        assert!(add_again.registered);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // ! notice that `add_again` should be dropped before or not be used after dropping `import`
+        dbg!("drop add_again");
+        drop(add_again);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // drop the import object
+        dbg!("drop import");
+        drop(import);
+
+        assert!(store.module("extern").is_err());
+
+        assert_eq!(HOST_FUNCS.read().len(), 0);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 0);
+
+        // ! if `add_again` is not dropped before dropping `import`, then calling `add_again` will crash
+        // let result = executor.call_func(
+        //     &add_again,
+        //     vec![WasmValue::from_i32(1), WasmValue::from_i32(2)],
+        // );
+
+        Ok(())
+    }
+
+    #[test]
+    fn test_func_drop_v2() {
+        #[derive(Debug)]
+        struct Data<T, S> {
+            _x: i32,
+            _y: String,
+            _v: Vec<T>,
+            _s: Vec<S>,
+        }
+        let data: Data<i32, &str> = Data {
+            _x: 12,
+            _y: "hello".to_string(),
+            _v: vec![1, 2, 3],
+            _s: vec!["macos", "linux", "windows"],
+        };
+
+        fn real_add<T: core::fmt::Debug>(
+            _frame: CallingFrame,
+            input: Vec<WasmValue>,
+            data: *mut std::ffi::c_void,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            println!("Rust: Entering Rust function real_add");
+
+            // Do not use `Box::from_raw`: let host_data = unsafe { Box::from_raw(data as *mut T) };
+            let host_data = unsafe { &mut *(data as *mut T) };
+            println!("host_data: {:?}", host_data);
+
+            if input.len() != 2 {
+                return Err(HostFuncError::User(1));
+            }
+
+            let a = if input[0].ty() == ValType::I32 {
+                input[0].to_i32()
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+
+            let b = if input[1].ty() == ValType::I32 {
+                input[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            let c = a + b;
+            println!("Rust: calcuating in real_add c: {c:?}");
+
+            println!("Rust: Leaving Rust function real_add");
+            Ok(vec![WasmValue::from_i32(c)])
+        }
+
+        assert_eq!(HOST_FUNCS.read().len(), 0);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 0);
+
+        // create a FuncType
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        // create a host function
+        let result = Function::create_sync_func(
+            &func_ty,
+            Box::new(real_add::<Data<i32, &str>>),
+            Some(Box::new(data)),
+            0,
+        );
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        let host_func_cloned = host_func.clone();
+
+        drop(host_func);
+
+        drop(host_func_cloned);
+    }
+
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[tokio::test]
+    async fn test_func_async_closure() -> Result<(), Box<dyn std::error::Error>> {
+        {
+            #[derive(Debug)]
+            struct Data<T, S> {
+                _x: i32,
+                _y: String,
+                _v: Vec<T>,
+                _s: Vec<S>,
+            }
+            impl<T, S> Drop for Data<T, S> {
+                fn drop(&mut self) {
+                    println!("Dropping Data");
+                }
+            }
+
+            let data: Data<i32, &str> = Data {
+                _x: 12,
+                _y: "hello".to_string(),
+                _v: vec![1, 2, 3],
+                _s: vec!["macos", "linux", "windows"],
+            };
+
+            // define an async closure
+            let c = |_frame: CallingFrame,
+                     _args: Vec<WasmValue>,
+                     data: *mut std::os::raw::c_void|
+             -> Box<
+                (dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send),
+            > {
+                // Do not use `Box::from_raw`: let host_data = unsafe { Box::from_raw(data as *mut Data<i32, &str>) };
+                let host_data = unsafe { &mut *(data as *mut Data<i32, &str>) };
+
+                Box::new(async move {
+                    for _ in 0..10 {
+                        println!("[async hello] say hello");
+                        tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+
+                        println!("host_data: {:?}", host_data);
+                    }
+
+                    println!("[async hello] Done!");
+
+                    Ok(vec![])
+                })
+            };
+
+            // create a FuncType
+            let result = FuncType::create(vec![], vec![]);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+
+            // create an async host function
+            let result =
+                Function::create_async_func(&func_ty, Box::new(c), Some(Box::new(data)), 0);
+            assert!(result.is_ok());
+            let async_hello_func = result.unwrap();
+
+            // create an Executor
+            let result = Executor::create(None, None);
+            assert!(result.is_ok());
+            let mut executor = result.unwrap();
+            assert!(!executor.inner.0.is_null());
+
+            // create a Store
+            let result = Store::create();
+            assert!(result.is_ok());
+            let mut store = result.unwrap();
+
+            // create an AsyncWasiModule
+            let result = AsyncWasiModule::create(Some(vec!["abc"]), Some(vec![("a", "1")]), None);
+            assert!(result.is_ok());
+            let async_wasi_module = result.unwrap();
+
+            // register async_wasi module into the store
+            let wasi_import = WasiInstance::AsyncWasi(async_wasi_module);
+            let result = executor.register_wasi_instance(&mut store, &wasi_import);
+            assert!(result.is_ok());
+
+            // create an ImportModule
+            let mut import = ImportModule::<NeverType>::create("extern", None)?;
+            import.add_func("async_hello", async_hello_func);
+
+            executor.register_import_module(&mut store, &import)?;
+
+            let extern_instance = store.module("extern")?;
+            let async_hello = extern_instance.get_func("async_hello")?;
+
+            async fn tick() {
+                let mut i = 0;
+                loop {
+                    println!("[tick] i={i}");
+                    tokio::time::sleep(std::time::Duration::from_millis(500)).await;
+                    i += 1;
+                }
+            }
+            tokio::spawn(tick());
+
+            let async_state = AsyncState::new();
+            let _ = executor
+                .call_func_async(&async_state, &async_hello, [])
+                .await?;
+        }
+
+        assert_eq!(ASYNC_HOST_FUNCS.read().len(), 0);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 0);
+
+        Ok(())
+    }
+
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[tokio::test]
+    async fn test_func_async_func() -> Result<(), Box<dyn std::error::Error>> {
+        {
+            #[derive(Debug)]
+            struct Data<T, S> {
+                _x: i32,
+                _y: String,
+                _v: Vec<T>,
+                _s: Vec<S>,
+            }
+            let data: Data<i32, &str> = Data {
+                _x: 12,
+                _y: "hello".to_string(),
+                _v: vec![1, 2, 3],
+                _s: vec!["macos", "linux", "windows"],
+            };
+
+            // define async host function
+            fn f<T: core::fmt::Debug + Send + Sync + 'static>(
+                _frame: CallingFrame,
+                _args: Vec<WasmValue>,
+                data: *mut std::ffi::c_void,
+            ) -> Box<(dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send)>
+            {
+                // Do not use `Box::from_raw`: let data = unsafe { Box::from_raw(data as *mut T) };
+                let data = unsafe { &mut *(data as *mut T) };
+
+                Box::new(async move {
+                    for _ in 0..10 {
+                        println!("[async hello] say hello");
+                        tokio::time::sleep(std::time::Duration::from_secs(1)).await;
+                        println!("host_data: {:?}", data);
+                    }
+
+                    println!("[async hello] Done!");
+
+                    Ok(vec![])
+                })
+            }
+
+            // create a FuncType
+            let result = FuncType::create(vec![], vec![]);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+
+            // create an async host function
+            let result = Function::create_async_func(
+                &func_ty,
+                Box::new(f::<Data<i32, &str>>),
+                Some(Box::new(data)),
+                0,
+            );
+            assert!(result.is_ok());
+            let async_hello_func = result.unwrap();
+
+            assert_eq!(ASYNC_HOST_FUNCS.read().len(), 1);
+            assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+            // create an Executor
+            let result = Executor::create(None, None);
+            assert!(result.is_ok());
+            let mut executor = result.unwrap();
+            assert!(!executor.inner.0.is_null());
+
+            // create a Store
+            let result = Store::create();
+            assert!(result.is_ok());
+            let mut store = result.unwrap();
+
+            // create an AsyncWasiModule
+            let result = AsyncWasiModule::create(Some(vec!["abc"]), Some(vec![("a", "1")]), None);
+            assert!(result.is_ok());
+            let async_wasi_module = result.unwrap();
+
+            // register async_wasi module into the store
+            let wasi_import = WasiInstance::AsyncWasi(async_wasi_module);
+            let result = executor.register_wasi_instance(&mut store, &wasi_import);
+            assert!(result.is_ok());
+
+            // create an ImportModule
+            let mut import = ImportModule::<NeverType>::create("extern", None)?;
+            import.add_func("async_hello", async_hello_func);
+
+            executor.register_import_module(&mut store, &import)?;
+
+            let extern_instance = store.module("extern")?;
+            let async_hello = extern_instance.get_func("async_hello")?;
+
+            async fn tick() {
+                let mut i = 0;
+                loop {
+                    println!("[tick] i={i}");
+                    tokio::time::sleep(std::time::Duration::from_millis(500)).await;
+                    i += 1;
+                }
+            }
+            tokio::spawn(tick());
+
+            let async_state = AsyncState::new();
+            let _ = executor
+                .call_func_async(&async_state, &async_hello, [])
+                .await?;
+
+            assert_eq!(ASYNC_HOST_FUNCS.read().len(), 1);
+            assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+            drop(import);
+        }
+
+        assert_eq!(ASYNC_HOST_FUNCS.read().len(), 0);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 0);
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/instance/global.rs.html b/src/wasmedge_sys/instance/global.rs.html new file mode 100644 index 000000000..e7b527c23 --- /dev/null +++ b/src/wasmedge_sys/instance/global.rs.html @@ -0,0 +1,897 @@ +global.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+
//! Defines WasmEdge Global and GlobalType structs.
+//!
+//! A WasmEdge `Global` defines a global variable, which stores a single value of the given `GlobalType`.
+//! `GlobalType` specifies whether a global variable is immutable or mutable.
+
+use crate::{ffi, WasmEdgeResult, WasmValue};
+use parking_lot::Mutex;
+use std::sync::Arc;
+use wasmedge_types::{
+    error::{GlobalError, WasmEdgeError},
+    Mutability, ValType,
+};
+
+/// Defines a WebAssembly global variable, which stores a single value of the given [type](crate::GlobalType) and a flag indicating whether it is mutable or not.
+#[derive(Debug)]
+pub struct Global {
+    pub(crate) inner: Arc<Mutex<InnerGlobal>>,
+    pub(crate) registered: bool,
+}
+impl Global {
+    /// Creates a new [Global] instance to be associated with the given [GlobalType] and [WasmValue](crate::WasmValue).
+    ///
+    /// The type of the given [WasmValue](crate::WasmValue) must be matched with [GlobalType]; otherwise, it causes a failure. For example, `WasmValue::I32(520)` conflicts with a [GlobalType] with a value type defined as `ValType::F32`.
+    ///
+    /// # Errors
+    ///
+    /// * If fail to create the Global instance, then WasmEdgeError::Global(GlobalError::Create)(crate::error::GlobalError) is returned.
+    ///
+    pub fn create(ty: &GlobalType, val: WasmValue) -> WasmEdgeResult<Self> {
+        let ctx = unsafe { ffi::WasmEdge_GlobalInstanceCreate(ty.inner.0, val.as_raw()) };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Global(GlobalError::Create))),
+            false => Ok(Self {
+                inner: Arc::new(Mutex::new(InnerGlobal(ctx))),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Returns the underlying wasm type of a [Global] instance.
+    ///
+    /// # Errors
+    ///
+    /// If fail to get the type, then an error is returned.
+    ///
+    pub fn ty(&self) -> WasmEdgeResult<GlobalType> {
+        let ty_ctx = unsafe { ffi::WasmEdge_GlobalInstanceGetGlobalType(self.inner.lock().0) };
+        match ty_ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Global(GlobalError::Type))),
+            false => Ok(GlobalType {
+                inner: InnerGlobalType(ty_ctx as *mut _),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Returns the value of the [Global] instance.
+    pub fn get_value(&self) -> WasmValue {
+        let val = unsafe { ffi::WasmEdge_GlobalInstanceGetValue(self.inner.lock().0) };
+        val.into()
+    }
+
+    /// Sets the value of the [Global] instance.
+    ///
+    /// Notice that only the [Global] instance of [Mutability::Var](wasmedge_types::Mutability::Var) type can be set a new value. Setting a new value for a [Global] of [Mutability::Const](wasmedge_types::Mutability::Const) causes a failure.
+    ///
+    /// # Argument
+    ///
+    /// * `val` - The new wasm value to be set.
+    ///
+    /// # Errors
+    ///
+    /// If fail to set value, then an error is returned.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use wasmedge_sys::{Global, GlobalType, WasmValue};
+    /// use wasmedge_types::{ValType, Mutability};
+    ///
+    /// // create a GlobalType instance
+    /// let ty = GlobalType::create(ValType::F32, Mutability::Var).expect("fail to create a GlobalType");
+    /// // create a Global instance
+    /// let mut global = Global::create(&ty, WasmValue::from_f32(3.1415)).expect("fail to create a Global");
+    ///
+    /// global.set_value(WasmValue::from_f32(314.15)).expect("fail to set a new value for a Global");
+    /// assert_eq!(global.get_value().to_f32(), 314.15);
+    /// ```
+    ///
+    ///
+    pub fn set_value(&mut self, val: WasmValue) -> WasmEdgeResult<()> {
+        let ty = self.ty()?;
+        if ty.mutability() == Mutability::Const {
+            return Err(Box::new(WasmEdgeError::Global(GlobalError::ModifyConst)));
+        }
+        if ty.value_type() != val.ty() {
+            return Err(Box::new(WasmEdgeError::Global(
+                GlobalError::UnmatchedValType,
+            )));
+        }
+        unsafe { ffi::WasmEdge_GlobalInstanceSetValue(self.inner.lock().0, val.as_raw()) }
+        Ok(())
+    }
+
+    /// Provides a raw pointer to the inner global context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_GlobalInstanceContext {
+        self.inner.lock().0 as *const _
+    }
+}
+impl Drop for Global {
+    fn drop(&mut self) {
+        if self.registered {
+            self.inner.lock().0 = std::ptr::null_mut();
+        } else if Arc::strong_count(&self.inner) == 1 && !self.inner.lock().0.is_null() {
+            unsafe { ffi::WasmEdge_GlobalInstanceDelete(self.inner.lock().0) };
+        }
+    }
+}
+impl Clone for Global {
+    fn clone(&self) -> Self {
+        Self {
+            inner: self.inner.clone(),
+            registered: self.registered,
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerGlobal(pub(crate) *mut ffi::WasmEdge_GlobalInstanceContext);
+unsafe impl Send for InnerGlobal {}
+unsafe impl Sync for InnerGlobal {}
+
+/// Defines the type of a wasm global variable.
+///
+/// A [GlobalType] classifies a global variable that hold a value and can either be mutable or immutable.
+#[derive(Debug)]
+pub struct GlobalType {
+    pub(crate) inner: InnerGlobalType,
+    pub(crate) registered: bool,
+}
+impl GlobalType {
+    /// Create a new [GlobalType] to be associated with the given [ValType](wasmedge_types::ValType) and [Mutability](wasmedge_types::Mutability).
+    ///
+    /// # Arguments
+    ///
+    /// * `val_type` - The value type of the global variable.
+    ///
+    /// * `mutability` - The mutability of the global variable.
+    ///
+    /// # Errors
+    ///
+    /// If fail to create a new [GlobalType], then an error is returned.
+    pub fn create(val_ty: ValType, mutable: Mutability) -> WasmEdgeResult<Self> {
+        let ctx = unsafe { ffi::WasmEdge_GlobalTypeCreate(val_ty.into(), mutable.into()) };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::GlobalTypeCreate)),
+            false => Ok(Self {
+                inner: InnerGlobalType(ctx),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Returns the value type of the [GlobalType].
+    pub fn value_type(&self) -> ValType {
+        let val = unsafe { ffi::WasmEdge_GlobalTypeGetValType(self.inner.0 as *const _) };
+        val.into()
+    }
+
+    /// Returns the [Mutability](wasmedge_types::Mutability) value of the [GlobalType].
+    pub fn mutability(&self) -> Mutability {
+        let val = unsafe { ffi::WasmEdge_GlobalTypeGetMutability(self.inner.0) };
+        val.into()
+    }
+
+    /// Provides a raw pointer to the inner global type context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_GlobalTypeContext {
+        self.inner.0 as *const _
+    }
+}
+impl Drop for GlobalType {
+    fn drop(&mut self) {
+        if !self.registered && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_GlobalTypeDelete(self.inner.0) };
+        }
+    }
+}
+impl From<wasmedge_types::GlobalType> for GlobalType {
+    fn from(ty: wasmedge_types::GlobalType) -> Self {
+        GlobalType::create(ty.value_ty(), ty.mutability()).expect(
+            "[wasmedge-sys] Failed to convert wasmedge_types::GlobalType into wasmedge_sys::GlobalType.",
+        )
+    }
+}
+impl From<GlobalType> for wasmedge_types::GlobalType {
+    fn from(ty: GlobalType) -> Self {
+        wasmedge_types::GlobalType::new(ty.value_type(), ty.mutability())
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerGlobalType(pub(crate) *mut ffi::WasmEdge_GlobalTypeContext);
+unsafe impl Send for InnerGlobalType {}
+unsafe impl Sync for InnerGlobalType {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_types::{Mutability, ValType};
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_global_type() {
+        // create a GlobalType instance
+        let result = GlobalType::create(ValType::I32, Mutability::Const);
+        assert!(result.is_ok());
+        let global_ty = result.unwrap();
+        assert!(!global_ty.inner.0.is_null());
+        assert!(!global_ty.registered);
+
+        // value type
+        assert_eq!(global_ty.value_type(), ValType::I32);
+        // Mutability
+        assert_eq!(global_ty.mutability(), Mutability::Const);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_global_const_i32() {
+        // create a GlobalType instance
+        let result = GlobalType::create(ValType::I32, Mutability::Const);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+
+        // create a const Global instance
+        let result = Global::create(&ty, WasmValue::from_i32(99));
+        assert!(result.is_ok());
+        let mut global_const = result.unwrap();
+
+        // access the value held by global_const
+        assert_eq!(global_const.get_value().to_i32(), 99);
+        let result = global_const.set_value(WasmValue::from_i32(0));
+        assert!(result.is_err());
+
+        // access the global type
+        let result = global_const.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+        assert!(ty.registered);
+        assert_eq!(ty.value_type(), ValType::I32);
+        assert_eq!(ty.mutability(), Mutability::Const);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_global_var_f32() {
+        // create a GlobalType instance
+        let result = GlobalType::create(ValType::F32, Mutability::Var);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+
+        // create a Var Global instance
+        let result = Global::create(&ty, WasmValue::from_f32(13.14));
+        assert!(result.is_ok());
+        let mut global_var = result.unwrap();
+
+        // access the value held by global_var
+        assert_eq!(global_var.get_value().to_f32(), 13.14);
+        let result = global_var.set_value(WasmValue::from_f32(1.314));
+        assert!(result.is_ok());
+        assert_eq!(global_var.get_value().to_f32(), 1.314);
+
+        // access the global type
+        let result = global_var.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+        assert!(ty.registered);
+        assert_eq!(ty.value_type(), ValType::F32);
+        assert_eq!(ty.mutability(), Mutability::Var);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_global_conflict() {
+        {
+            // create a GlobalType instance
+            let result = GlobalType::create(ValType::F32, Mutability::Var);
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            assert!(!ty.inner.0.is_null());
+
+            // create a Var Global instance with a value of mis-matched Value::I32 type
+            let result = Global::create(&ty, WasmValue::from_i32(520));
+            assert!(result.is_err());
+        }
+
+        {
+            // create a GlobalType instance
+            let result = GlobalType::create(ValType::F32, Mutability::Var);
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            assert!(!ty.inner.0.is_null());
+
+            // create a Var Global instance with a value of Value::F32 type
+            let result = Global::create(&ty, WasmValue::from_f32(13.14));
+            assert!(result.is_ok());
+            let mut global_var = result.unwrap();
+
+            // set a new value of mis-matched Value::I32 type
+            let result = global_var.set_value(WasmValue::from_i32(1314));
+            assert!(result.is_err());
+            assert_eq!(global_var.get_value().to_f32(), 13.14);
+
+            // set a new value of Value::F32 type
+            let result = global_var.set_value(WasmValue::from_f32(1.314));
+            assert!(result.is_ok());
+            assert_eq!(global_var.get_value().to_f32(), 1.314);
+        }
+    }
+
+    #[test]
+    fn test_global_send() {
+        {
+            // create a GlobalType instance
+            let result = GlobalType::create(ValType::I32, Mutability::Const);
+            assert!(result.is_ok());
+            let global_ty = result.unwrap();
+
+            let handle = thread::spawn(move || {
+                assert!(!global_ty.inner.0.is_null());
+                assert!(!global_ty.registered);
+
+                // value type
+                assert_eq!(global_ty.value_type(), ValType::I32);
+                // Mutability
+                assert_eq!(global_ty.mutability(), Mutability::Const);
+            });
+
+            handle.join().unwrap()
+        }
+
+        {
+            // create a GlobalType instance
+            let result = GlobalType::create(ValType::I32, Mutability::Const);
+            assert!(result.is_ok());
+            let global_ty = result.unwrap();
+
+            // create a Global instance
+            let result = Global::create(&global_ty, WasmValue::from_i32(5));
+            assert!(result.is_ok());
+            let global = result.unwrap();
+
+            let handle = thread::spawn(move || {
+                // access the value held by global
+                assert_eq!(global.get_value().to_i32(), 5);
+            });
+
+            handle.join().unwrap()
+        }
+    }
+
+    #[test]
+    fn test_global_sync() {
+        // create a GlobalType instance
+        let result = GlobalType::create(ValType::I32, Mutability::Const);
+        assert!(result.is_ok());
+        let global_ty = result.unwrap();
+
+        // create a Global instance
+        let result = Global::create(&global_ty, WasmValue::from_i32(5));
+        assert!(result.is_ok());
+        let global = Arc::new(Mutex::new(result.unwrap()));
+
+        let global_cloned = Arc::clone(&global);
+        let handle = thread::spawn(move || {
+            let result = global_cloned.lock();
+            assert!(result.is_ok());
+            let global = result.unwrap();
+
+            assert_eq!(global.get_value().to_i32(), 5);
+        });
+
+        handle.join().unwrap()
+    }
+
+    #[test]
+    fn test_global_clone() {
+        {
+            // create a GlobalType instance
+            let result = GlobalType::create(ValType::I32, Mutability::Const);
+            assert!(result.is_ok());
+            let global_ty = result.unwrap();
+
+            // create a Global instance
+            let result = Global::create(&global_ty, WasmValue::from_i32(5));
+            assert!(result.is_ok());
+            let global = result.unwrap();
+
+            let global_cloned = global.clone();
+
+            drop(global);
+
+            assert_eq!(global_cloned.get_value().to_i32(), 5);
+        }
+
+        {
+            // create a GlobalType instance
+            let result = GlobalType::create(ValType::F32, Mutability::Var);
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            assert!(!ty.inner.0.is_null());
+
+            // create a Var Global instance
+            let result = Global::create(&ty, WasmValue::from_f32(13.14));
+            assert!(result.is_ok());
+            let mut global_var = result.unwrap();
+            assert_eq!(global_var.get_value().to_f32(), 13.14);
+
+            let global_var_cloned = global_var.clone();
+            assert_eq!(
+                global_var_cloned.get_value().to_f32(),
+                global_var.get_value().to_f32()
+            );
+
+            // access the value held by global_var
+            let result = global_var.set_value(WasmValue::from_f32(1.314));
+            assert!(result.is_ok());
+            assert_eq!(global_var.get_value().to_f32(), 1.314);
+
+            drop(global_var);
+
+            assert_eq!(global_var_cloned.get_value().to_f32(), 1.314);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/instance/memory.rs.html b/src/wasmedge_sys/instance/memory.rs.html new file mode 100644 index 000000000..c30ea1d1b --- /dev/null +++ b/src/wasmedge_sys/instance/memory.rs.html @@ -0,0 +1,1187 @@ +memory.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+
//! Defines WasmEdge Memory and MemType structs.
+//!
+//! A WasmEdge `Memory` defines a linear memory as described by `MemType`.
+//! `MemType` specifies the limits on the size of a memory by a range. The start of
+//! the limit range specifies min size (initial size) of that memory, while the end
+//! restricts the size to which the memory can grow later.
+
+use crate::{ffi, types::WasmEdgeLimit, utils::check, WasmEdgeResult};
+use parking_lot::Mutex;
+use std::sync::Arc;
+use wasmedge_types::error::{MemError, WasmEdgeError};
+
+/// Defines a WebAssembly memory instance, which is a linear memory described by its [type](crate::MemType). Each memory instance consists of a vector of bytes and an optional maximum size, and its size is a multiple of the WebAssembly page size (*64KiB* of each page).
+#[derive(Debug)]
+pub struct Memory {
+    pub(crate) inner: Arc<Mutex<InnerMemory>>,
+    pub(crate) registered: bool,
+}
+impl Memory {
+    /// Create a new [Memory] to be associated with the given capacity limit.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The type of the new [Memory] instance.
+    ///
+    /// # Errors
+    ///
+    /// * If fail to create the memory instance, then [WasmEdgeError::Mem(MemError::Create)](wasmedge_types::error::MemError) is returned.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use wasmedge_sys::{MemType, Memory};
+    ///
+    /// let ty = MemType::create(10, Some(20), false).expect("fail to create memory type");
+    ///
+    /// let memory = Memory::create(&ty);
+    ///
+    /// ```
+    ///
+    pub fn create(ty: &MemType) -> WasmEdgeResult<Self> {
+        let ctx = unsafe { ffi::WasmEdge_MemoryInstanceCreate(ty.inner.0 as *const _) };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Mem(MemError::Create))),
+            false => Ok(Memory {
+                inner: Arc::new(Mutex::new(InnerMemory(ctx))),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Returns the type of the [Memory].
+    ///
+    /// # Errors
+    ///
+    /// If fail to get the type from the [Memory], then an error is returned.
+    ///
+    pub fn ty(&self) -> WasmEdgeResult<MemType> {
+        let ty_ctx = unsafe { ffi::WasmEdge_MemoryInstanceGetMemoryType(self.inner.lock().0) };
+        match ty_ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Mem(MemError::Type))),
+            false => Ok(MemType {
+                inner: InnerMemType(ty_ctx as *mut _),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Copies the data from the [Memory] to the output buffer.
+    ///
+    /// # Arguments
+    ///
+    /// * `offset` - The data start offset in the [Memory].
+    ///
+    /// * `len` - The requested data length.
+    ///
+    /// # Errors
+    ///
+    /// If the `offset + len` is larger than the data size in the [Memory], then an error is returned.
+    ///
+    pub fn get_data(&self, offset: u32, len: u32) -> WasmEdgeResult<Vec<u8>> {
+        let mut data = Vec::with_capacity(len as usize);
+        unsafe {
+            check(ffi::WasmEdge_MemoryInstanceGetData(
+                self.inner.lock().0,
+                data.as_mut_ptr(),
+                offset,
+                len,
+            ))?;
+            data.set_len(len as usize);
+        }
+
+        Ok(data.into_iter().collect())
+    }
+
+    /// Copies the data from the given input buffer into the [Memory].
+    ///
+    /// # Arguments
+    ///
+    /// * `data` - The data buffer to copy.
+    ///
+    /// * `offset` - The data start offset in the [Memory].
+    ///
+    /// # Errors
+    ///
+    /// If the sum of the `offset` and the data length is larger than the size of the [Memory],
+    /// then an error is returned.
+    ///
+    /// ```
+    /// use wasmedge_sys::{Memory, MemType};
+    /// use wasmedge_types::error::{CoreError, CoreExecutionError, WasmEdgeError};
+    ///
+    /// // create a Memory: the min size 1 and the max size 2
+    /// let ty = MemType::create(1, Some(2), false).expect("fail to create a memory type");
+    /// let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+    ///
+    /// // set data and the data length is larger than the data size in the memory
+    /// let result = mem.set_data(vec![1; 10], u32::pow(2, 16) - 9);
+    /// assert!(result.is_err());
+    /// assert_eq!(result.unwrap_err(), Box::new(WasmEdgeError::Core(CoreError::Execution(CoreExecutionError::MemoryOutOfBounds))));
+    /// ```
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use wasmedge_sys::{MemType, Memory};
+    ///
+    /// // create a Memory: the min size 1 and the max size 2
+    /// let ty = MemType::create(1, Some(2), false).expect("fail to create a memory type");
+    /// let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+    /// // page count
+    /// let count = mem.size();
+    /// assert_eq!(count, 1);
+    ///
+    /// // set data
+    /// mem.set_data(vec![1; 10], 10).expect("fail to set data");
+    ///
+    /// // get data
+    /// let data = mem.get_data(10, 10).expect("fail to get data");
+    /// assert_eq!(data, vec![1; 10]);
+    /// ```
+    ///
+    pub fn set_data(&mut self, data: impl AsRef<[u8]>, offset: u32) -> WasmEdgeResult<()> {
+        unsafe {
+            check(ffi::WasmEdge_MemoryInstanceSetData(
+                self.inner.lock().0,
+                data.as_ref().as_ptr(),
+                offset,
+                data.as_ref().len() as u32,
+            ))
+        }
+    }
+
+    /// Returns the const data pointer to the [Memory].
+    ///
+    /// # Arguments
+    ///
+    /// * `offset` - The data start offset in the [Memory].
+    ///
+    /// * `len` - The requested data length. If the size of `offset` + `len` is larger
+    /// than the data size in the [Memory]
+    ///
+    ///
+    /// # Errors
+    ///
+    /// If fail to get the data pointer, then an error is returned.
+    ///
+    pub fn data_pointer(&self, offset: u32, len: u32) -> WasmEdgeResult<*const u8> {
+        let ptr = unsafe {
+            ffi::WasmEdge_MemoryInstanceGetPointerConst(self.inner.lock().0, offset, len)
+        };
+        match ptr.is_null() {
+            true => Err(Box::new(WasmEdgeError::Mem(MemError::ConstPtr))),
+            false => Ok(ptr),
+        }
+    }
+
+    /// Returns the data pointer to the [Memory].
+    ///
+    /// # Arguments
+    ///
+    /// * `offset` - The data start offset in the [Memory].
+    ///
+    /// * `len` - The requested data length. If the size of `offset` + `len` is larger than the data size in the [Memory]
+    ///
+    /// # Errors
+    ///
+    /// If fail to get the data pointer, then an error is returned.
+    ///
+    pub fn data_pointer_mut(&mut self, offset: u32, len: u32) -> WasmEdgeResult<*mut u8> {
+        let ptr =
+            unsafe { ffi::WasmEdge_MemoryInstanceGetPointer(self.inner.lock().0, offset, len) };
+        match ptr.is_null() {
+            true => Err(Box::new(WasmEdgeError::Mem(MemError::MutPtr))),
+            false => Ok(ptr),
+        }
+    }
+
+    /// Returns the size, in WebAssembly pages (64 KiB of each page), of this wasm memory.
+    pub fn size(&self) -> u32 {
+        unsafe { ffi::WasmEdge_MemoryInstanceGetPageSize(self.inner.lock().0) }
+    }
+
+    /// Grows this WebAssembly memory by `count` pages.
+    ///
+    /// # Arguments
+    ///
+    /// * `count` - The page counts to be extended to the [Memory].
+    ///
+    /// # Errors
+    ///
+    /// If fail to grow the page count, then an error is returned.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use wasmedge_sys::{MemType, Memory};
+    ///
+    /// // create a Memory with a limit range [10, 20]
+    /// let ty = MemType::create(10, Some(20), false).expect("fail to create a memory type");
+    /// let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+    /// // check page count
+    /// let count = mem.size();
+    /// assert_eq!(count, 10);
+    ///
+    /// // grow 5 pages
+    /// mem.grow(10).expect("fail to grow the page count");
+    /// assert_eq!(mem.size(), 20);
+    /// ```
+    ///
+    pub fn grow(&mut self, count: u32) -> WasmEdgeResult<()> {
+        unsafe {
+            check(ffi::WasmEdge_MemoryInstanceGrowPage(
+                self.inner.lock().0,
+                count,
+            ))
+        }
+    }
+
+    /// Provides a raw pointer to the inner memory context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_MemoryInstanceContext {
+        self.inner.lock().0 as *const _
+    }
+}
+impl Drop for Memory {
+    fn drop(&mut self) {
+        if self.registered {
+            self.inner.lock().0 = std::ptr::null_mut();
+        } else if Arc::strong_count(&self.inner) == 1 && !self.inner.lock().0.is_null() {
+            unsafe { ffi::WasmEdge_MemoryInstanceDelete(self.inner.lock().0) };
+        }
+    }
+}
+impl Clone for Memory {
+    fn clone(&self) -> Self {
+        Self {
+            inner: self.inner.clone(),
+            registered: self.registered,
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerMemory(pub(crate) *mut ffi::WasmEdge_MemoryInstanceContext);
+unsafe impl Send for InnerMemory {}
+unsafe impl Sync for InnerMemory {}
+
+/// Defines the type of a wasm memory instance
+#[derive(Debug)]
+pub struct MemType {
+    pub(crate) inner: InnerMemType,
+    pub(crate) registered: bool,
+}
+impl MemType {
+    /// Create a new [MemType] to be associated with the given limit range for the capacity.
+    ///
+    /// # Arguments
+    ///
+    /// * 'min' - The initial size of the linear memory.
+    ///
+    /// * 'max' - The upper bound of the linear memory size allowed to grow. If 'max' is set 'None', then the maximum size will be set `u32::MAX`.
+    ///
+    /// * `shared` - Whether the memory is shared or not. Reference [Threading proposal for WebAssembly](https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md#shared-linear-memory) for details about shared memory. If `shared` is set `true`, then `max` MUST not be `None`.
+    ///
+    /// # Errors
+    ///
+    /// If fail to create a [MemType], then an error is returned.
+    ///
+    /// # Example
+    ///
+    /// ```ignore
+    /// let ty = MemType::create(0, Some(u32::MAX), false);
+    /// ```
+    ///
+    pub fn create(min: u32, max: Option<u32>, shared: bool) -> WasmEdgeResult<Self> {
+        if shared && max.is_none() {
+            return Err(Box::new(WasmEdgeError::Mem(MemError::CreateSharedType)));
+        }
+        let ctx =
+            unsafe { ffi::WasmEdge_MemoryTypeCreate(WasmEdgeLimit::new(min, max, shared).into()) };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::MemTypeCreate)),
+            false => Ok(Self {
+                inner: InnerMemType(ctx),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Returns the initial size of a [Memory].
+    pub fn min(&self) -> u32 {
+        let limit = unsafe { ffi::WasmEdge_MemoryTypeGetLimit(self.inner.0) };
+        let limit: WasmEdgeLimit = limit.into();
+        limit.min()
+    }
+
+    /// Returns the maximum size of a [Memory] allowed to grow.
+    pub fn max(&self) -> Option<u32> {
+        let limit = unsafe { ffi::WasmEdge_MemoryTypeGetLimit(self.inner.0) };
+        let limit: WasmEdgeLimit = limit.into();
+        limit.max()
+    }
+
+    /// Returns whether the memory is shared or not.
+    pub fn shared(&self) -> bool {
+        let limit = unsafe { ffi::WasmEdge_MemoryTypeGetLimit(self.inner.0) };
+        let limit: WasmEdgeLimit = limit.into();
+        limit.shared()
+    }
+
+    /// Provides a raw pointer to the inner memory type context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_MemoryTypeContext {
+        self.inner.0 as *const _
+    }
+}
+impl Drop for MemType {
+    fn drop(&mut self) {
+        if !self.registered && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_MemoryTypeDelete(self.inner.0) }
+        }
+    }
+}
+impl From<wasmedge_types::MemoryType> for MemType {
+    fn from(ty: wasmedge_types::MemoryType) -> Self {
+        MemType::create(ty.minimum(), ty.maximum(), ty.shared()).expect(
+            "[wasmedge-sys] Failed to convert wasmedge_types::MemoryType into wasmedge_sys::MemType.",
+        )
+    }
+}
+impl From<MemType> for wasmedge_types::MemoryType {
+    fn from(ty: MemType) -> Self {
+        wasmedge_types::MemoryType::new(ty.min(), ty.max(), ty.shared()).expect(
+            "[wasmedge-sys] Failed to convert wasmedge_sys::MemType into wasmedge_types::MemoryType."
+        )
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerMemType(pub(crate) *mut ffi::WasmEdge_MemoryTypeContext);
+unsafe impl Send for InnerMemType {}
+unsafe impl Sync for InnerMemType {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_types::error::{CoreError, CoreExecutionError, WasmEdgeError};
+
+    #[test]
+    fn test_memory_type() {
+        // case 1
+        let result = MemType::create(0, Some(u32::MAX), false);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+        assert!(!ty.registered);
+        assert_eq!(ty.min(), 0);
+        assert_eq!(ty.max(), Some(u32::MAX));
+
+        // case 2
+        let result = MemType::create(10, Some(101), false);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+        assert!(!ty.registered);
+        assert_eq!(ty.min(), 10);
+        assert_eq!(ty.max(), Some(101));
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_memory_grow() {
+        // create a Memory with a limit range [10, 20]
+        let result = MemType::create(10, Some(20), false);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Memory::create(&ty);
+        assert!(result.is_ok());
+        let mut mem = result.unwrap();
+        assert!(!mem.inner.lock().0.is_null());
+        assert!(!mem.registered);
+
+        // get type
+        let result = mem.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+        assert!(ty.registered);
+        // check limit
+        assert_eq!(ty.min(), 10);
+        assert_eq!(ty.max(), Some(20));
+
+        // check page count
+        let count = mem.size();
+        assert_eq!(count, 10);
+
+        // grow 5 pages
+        let result = mem.grow(10);
+        assert!(result.is_ok());
+        assert_eq!(mem.size(), 20);
+
+        // grow additional  pages, which causes a failure
+        let result = mem.grow(1);
+        assert!(result.is_err());
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_memory_data() {
+        // create a Memory: the min size 1 and the max size 2
+        let result = MemType::create(1, Some(2), false);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Memory::create(&ty);
+        assert!(result.is_ok());
+        let mut mem = result.unwrap();
+        assert!(!mem.inner.lock().0.is_null());
+        assert!(!mem.registered);
+
+        // check page count
+        let count = mem.size();
+        assert_eq!(count, 1);
+
+        // get data before set data
+        let result = mem.get_data(0, 10);
+        assert!(result.is_ok());
+        let data = result.unwrap();
+        assert_eq!(data, vec![0; 10]);
+
+        // set data
+        let result = mem.set_data(vec![1; 10], 10);
+        assert!(result.is_ok());
+        // get data after set data
+        let result = mem.get_data(10, 10);
+        assert!(result.is_ok());
+        let data = result.unwrap();
+        assert_eq!(data, vec![1; 10]);
+
+        // set data and the data length is larger than the data size in the memory
+        let result = mem.set_data(vec![1; 10], u32::pow(2, 16) - 9);
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Core(CoreError::Execution(
+                CoreExecutionError::MemoryOutOfBounds
+            )))
+        );
+
+        // grow the memory size
+        let result = mem.grow(1);
+        assert!(result.is_ok());
+        assert_eq!(mem.size(), 2);
+        let result = mem.set_data(vec![1; 10], u32::pow(2, 16) - 9);
+        assert!(result.is_ok());
+    }
+
+    #[test]
+    fn test_memory_send() {
+        {
+            let result = MemType::create(10, Some(101), false);
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            assert!(!ty.inner.0.is_null());
+            assert!(!ty.registered);
+
+            let handle = thread::spawn(move || {
+                assert!(!ty.inner.0.is_null());
+                assert!(!ty.registered);
+                assert_eq!(ty.min(), 10);
+                assert_eq!(ty.max(), Some(101));
+            });
+
+            handle.join().unwrap()
+        }
+
+        {
+            // create a Memory with a limit range [10, 20]
+            let result = MemType::create(10, Some(20), false);
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            let result = Memory::create(&ty);
+            assert!(result.is_ok());
+            let mem = result.unwrap();
+            assert!(!mem.inner.lock().0.is_null());
+            assert!(!mem.registered);
+
+            let handle = thread::spawn(move || {
+                // get type
+                let result = mem.ty();
+                assert!(result.is_ok());
+                let ty = result.unwrap();
+                assert!(!ty.inner.0.is_null());
+                assert!(ty.registered);
+                // check limit
+                assert_eq!(ty.min(), 10);
+                assert_eq!(ty.max(), Some(20));
+
+                // check page count
+                let count = mem.size();
+                assert_eq!(count, 10);
+            });
+
+            handle.join().unwrap()
+        }
+    }
+
+    #[test]
+    fn test_memory_sync() {
+        // create a Memory with a limit range [10, 20]
+        let result = MemType::create(10, Some(20), false);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Memory::create(&ty);
+        assert!(result.is_ok());
+        let mem = result.unwrap();
+        assert!(!mem.inner.lock().0.is_null());
+        assert!(!mem.registered);
+        let memory = Arc::new(Mutex::new(mem));
+
+        let memory_cloned = Arc::clone(&memory);
+        let handle = thread::spawn(move || {
+            let mem = memory_cloned.lock().unwrap();
+
+            // get type
+            let result = mem.ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            assert!(!ty.inner.0.is_null());
+            assert!(ty.registered);
+            // check limit
+            assert_eq!(ty.min(), 10);
+            assert_eq!(ty.max(), Some(20));
+
+            // check page count
+            let count = mem.size();
+            assert_eq!(count, 10);
+        });
+
+        handle.join().unwrap()
+    }
+
+    #[test]
+    fn test_memory_clone() {
+        #[derive(Debug, Clone)]
+        struct RecordsMemory {
+            memory: Memory,
+        }
+
+        // create a Memory with a limit range [10, 20]
+        let result = MemType::create(10, Some(20), false);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Memory::create(&ty);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        let rec_mem = RecordsMemory { memory };
+
+        let rec_mem_cloned = rec_mem.clone();
+
+        drop(rec_mem);
+
+        assert_eq!(rec_mem_cloned.memory.size(), 10);
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/instance/mod.rs.html b/src/wasmedge_sys/instance/mod.rs.html new file mode 100644 index 000000000..656a485b3 --- /dev/null +++ b/src/wasmedge_sys/instance/mod.rs.html @@ -0,0 +1,37 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
//! Defines WasmEdge instance structs, including Function, Global, Memory, Table, and etc.
+
+pub mod function;
+pub mod global;
+pub mod memory;
+pub mod module;
+pub mod table;
+
+#[doc(hidden)]
+pub use function::{FuncType, Function};
+#[doc(hidden)]
+pub use global::{Global, GlobalType};
+#[doc(hidden)]
+pub use memory::{MemType, Memory};
+#[doc(hidden)]
+pub use module::Instance;
+#[doc(hidden)]
+pub use table::{Table, TableType};
+
\ No newline at end of file diff --git a/src/wasmedge_sys/instance/module.rs.html b/src/wasmedge_sys/instance/module.rs.html new file mode 100644 index 000000000..cdfbb6fe3 --- /dev/null +++ b/src/wasmedge_sys/instance/module.rs.html @@ -0,0 +1,3231 @@ +module.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+
//! Defines WasmEdge Instance and other relevant types.
+
+use crate::{
+    ffi,
+    instance::{function::InnerFunc, global::InnerGlobal, memory::InnerMemory, table::InnerTable},
+    types::WasmEdgeString,
+    Function, Global, Memory, Table, WasmEdgeResult, HOST_FUNCS, HOST_FUNC_FOOTPRINTS,
+};
+#[cfg(all(feature = "async", target_os = "linux"))]
+use crate::{r#async::AsyncWasiModule, ASYNC_HOST_FUNCS};
+use parking_lot::Mutex;
+use std::sync::Arc;
+use wasmedge_types::error::{InstanceError, WasmEdgeError};
+
+/// An [Instance] represents an instantiated module. In the instantiation process, An [Instance] is created from al[Module](crate::Module). From an [Instance] the exported [functions](crate::Function), [tables](crate::Table), [memories](crate::Memory), and [globals](crate::Global) can be fetched.
+#[derive(Debug)]
+pub struct Instance {
+    pub(crate) inner: Arc<Mutex<InnerInstance>>,
+    pub(crate) registered: bool,
+}
+impl Drop for Instance {
+    fn drop(&mut self) {
+        if self.registered {
+            self.inner.lock().0 = std::ptr::null_mut();
+        } else if Arc::strong_count(&self.inner) == 1 && !self.inner.lock().0.is_null() {
+            unsafe {
+                ffi::WasmEdge_ModuleInstanceDelete(self.inner.lock().0);
+            }
+        }
+    }
+}
+impl Instance {
+    /// Returns the name of this exported [module instance](crate::Instance).
+    ///
+    /// If this module instance is an active module instance, then None is returned.
+    pub fn name(&self) -> Option<String> {
+        let name =
+            unsafe { ffi::WasmEdge_ModuleInstanceGetModuleName(self.inner.lock().0 as *const _) };
+
+        let name: String = name.into();
+        if name.is_empty() {
+            return None;
+        }
+
+        Some(name)
+    }
+
+    /// Returns the exported [function instance](crate::Function) by name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported [function instance](crate::Function).
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [function](crate::Function), then an error is returned.
+    pub fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function> {
+        let func_name: WasmEdgeString = name.as_ref().into();
+        let func_ctx = unsafe {
+            ffi::WasmEdge_ModuleInstanceFindFunction(
+                self.inner.lock().0 as *const _,
+                func_name.as_raw(),
+            )
+        };
+        match func_ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Instance(
+                InstanceError::NotFoundFunc(name.as_ref().to_string()),
+            ))),
+            false => Ok(Function {
+                inner: Arc::new(Mutex::new(InnerFunc(func_ctx))),
+                registered: true,
+                data_owner: false, // it doesn't matter to set this field to false
+            }),
+        }
+    }
+
+    /// Returns the exported [table instance](crate::Table) by name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported [table instance](crate::Table).
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [table instance](crate::Table), then an error is returned.
+    pub fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table> {
+        let table_name: WasmEdgeString = name.as_ref().into();
+        let ctx = unsafe {
+            ffi::WasmEdge_ModuleInstanceFindTable(
+                self.inner.lock().0 as *const _,
+                table_name.as_raw(),
+            )
+        };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Instance(
+                InstanceError::NotFoundTable(name.as_ref().to_string()),
+            ))),
+            false => Ok(Table {
+                inner: Arc::new(Mutex::new(InnerTable(ctx))),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Returns the exported [memory instance](crate::Memory) by name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported [memory instance](crate::Memory).
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [memory instance](crate::Memory), then an error is returned.
+    pub fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory> {
+        let mem_name: WasmEdgeString = name.as_ref().into();
+        let ctx = unsafe {
+            ffi::WasmEdge_ModuleInstanceFindMemory(
+                self.inner.lock().0 as *const _,
+                mem_name.as_raw(),
+            )
+        };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Instance(
+                InstanceError::NotFoundMem(name.as_ref().to_string()),
+            ))),
+            false => Ok(Memory {
+                inner: Arc::new(Mutex::new(InnerMemory(ctx))),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Returns the exported [global instance](crate::Global) by name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported [global instance](crate::Global).
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [global instance](crate::Global), then an error is returned.
+    pub fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global> {
+        let global_name: WasmEdgeString = name.as_ref().into();
+        let ctx = unsafe {
+            ffi::WasmEdge_ModuleInstanceFindGlobal(
+                self.inner.lock().0 as *const _,
+                global_name.as_raw(),
+            )
+        };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Instance(
+                InstanceError::NotFoundGlobal(name.as_ref().to_string()),
+            ))),
+            false => Ok(Global {
+                inner: Arc::new(Mutex::new(InnerGlobal(ctx))),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Returns the length of the exported [function instances](crate::Function) in this module instance.
+    pub fn func_len(&self) -> u32 {
+        unsafe { ffi::WasmEdge_ModuleInstanceListFunctionLength(self.inner.lock().0) }
+    }
+
+    /// Returns the names of the exported [function instances](crate::Function) in this module instance.
+    pub fn func_names(&self) -> Option<Vec<String>> {
+        let len_func_names = self.func_len();
+        match len_func_names > 0 {
+            true => {
+                let mut func_names = Vec::with_capacity(len_func_names as usize);
+                unsafe {
+                    ffi::WasmEdge_ModuleInstanceListFunction(
+                        self.inner.lock().0,
+                        func_names.as_mut_ptr(),
+                        len_func_names,
+                    );
+                    func_names.set_len(len_func_names as usize);
+                }
+
+                let names = func_names
+                    .into_iter()
+                    .map(|x| x.into())
+                    .collect::<Vec<String>>();
+                Some(names)
+            }
+            false => None,
+        }
+    }
+
+    /// Returns the length of the exported [table instances](crate::Table) in this module instance.
+    pub fn table_len(&self) -> u32 {
+        unsafe { ffi::WasmEdge_ModuleInstanceListTableLength(self.inner.lock().0) }
+    }
+
+    /// Returns the names of the exported [table instances](crate::Table) in this module instance.
+    pub fn table_names(&self) -> Option<Vec<String>> {
+        let len_table_names = self.table_len();
+        match len_table_names > 0 {
+            true => {
+                let mut table_names = Vec::with_capacity(len_table_names as usize);
+                unsafe {
+                    ffi::WasmEdge_ModuleInstanceListTable(
+                        self.inner.lock().0,
+                        table_names.as_mut_ptr(),
+                        len_table_names,
+                    );
+                    table_names.set_len(len_table_names as usize);
+                }
+
+                let names = table_names
+                    .into_iter()
+                    .map(|x| x.into())
+                    .collect::<Vec<String>>();
+                Some(names)
+            }
+            false => None,
+        }
+    }
+
+    /// Returns the length of the exported [memory instances](crate::Memory) in this module instance.
+    pub fn mem_len(&self) -> u32 {
+        unsafe { ffi::WasmEdge_ModuleInstanceListMemoryLength(self.inner.lock().0) }
+    }
+
+    /// Returns the names of all exported [memory instances](crate::Memory) in this module instance.
+    pub fn mem_names(&self) -> Option<Vec<String>> {
+        let len_mem_names = self.mem_len();
+        match len_mem_names > 0 {
+            true => {
+                let mut mem_names = Vec::with_capacity(len_mem_names as usize);
+                unsafe {
+                    ffi::WasmEdge_ModuleInstanceListMemory(
+                        self.inner.lock().0,
+                        mem_names.as_mut_ptr(),
+                        len_mem_names,
+                    );
+                    mem_names.set_len(len_mem_names as usize);
+                }
+
+                let names = mem_names
+                    .into_iter()
+                    .map(|x| x.into())
+                    .collect::<Vec<String>>();
+                Some(names)
+            }
+            false => None,
+        }
+    }
+
+    /// Returns the length of the exported [global instances](crate::Global) in this module instance.
+    pub fn global_len(&self) -> u32 {
+        unsafe { ffi::WasmEdge_ModuleInstanceListGlobalLength(self.inner.lock().0) }
+    }
+
+    /// Returns the names of the exported [global instances](crate::Global) in this module instance.
+    pub fn global_names(&self) -> Option<Vec<String>> {
+        let len_global_names = self.global_len();
+        match len_global_names > 0 {
+            true => {
+                let mut global_names = Vec::with_capacity(len_global_names as usize);
+                unsafe {
+                    ffi::WasmEdge_ModuleInstanceListGlobal(
+                        self.inner.lock().0,
+                        global_names.as_mut_ptr(),
+                        len_global_names,
+                    );
+                    global_names.set_len(len_global_names as usize);
+                }
+
+                let names = global_names
+                    .into_iter()
+                    .map(|x| x.into())
+                    .collect::<Vec<String>>();
+                Some(names)
+            }
+            false => None,
+        }
+    }
+
+    /// Returns the host data held by the module instance.
+    pub fn host_data<T: Send + Sync + Clone>(&mut self) -> Option<&mut T> {
+        let ctx = unsafe { ffi::WasmEdge_ModuleInstanceGetHostData(self.inner.lock().0) };
+
+        match ctx.is_null() {
+            true => None,
+            false => {
+                let ctx = unsafe { &mut *(ctx as *mut T) };
+                Some(ctx)
+            }
+        }
+    }
+
+    /// Provides a raw pointer to the inner module instance context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_ModuleInstanceContext {
+        self.inner.lock().0 as *const _
+    }
+}
+impl Clone for Instance {
+    fn clone(&self) -> Self {
+        Self {
+            inner: self.inner.clone(),
+            registered: self.registered,
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerInstance(pub(crate) *mut ffi::WasmEdge_ModuleInstanceContext);
+unsafe impl Send for InnerInstance {}
+unsafe impl Sync for InnerInstance {}
+
+/// The object as an module instance is required to implement this trait.
+pub trait AsInstance {
+    /// Returns the exported [function instance](crate::Function) by name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported [function instance](crate::Function).
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [function](crate::Function), then an error is returned.
+    fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>;
+
+    /// Returns the length of the exported [function instances](crate::Function) in this module instance.
+    fn func_len(&self) -> u32;
+
+    /// Returns the names of the exported [function instances](crate::Function) in this module instance.
+    fn func_names(&self) -> Option<Vec<String>>;
+
+    /// Returns the exported [table instance](crate::Table) by name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported [table instance](crate::Table).
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [table instance](crate::Table), then an error is returned.
+    fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>;
+
+    /// Returns the length of the exported [table instances](crate::Table) in this module instance.
+    fn table_len(&self) -> u32;
+
+    /// Returns the names of the exported [table instances](crate::Table) in this module instance.
+    fn table_names(&self) -> Option<Vec<String>>;
+
+    /// Returns the exported [memory instance](crate::Memory) by name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported [memory instance](crate::Memory).
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [memory instance](crate::Memory), then an error is returned.
+    fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>;
+
+    /// Returns the length of the exported [memory instances](crate::Memory) in this module instance.
+    fn mem_len(&self) -> u32;
+
+    /// Returns the names of all exported [memory instances](crate::Memory) in this module instance.
+    fn mem_names(&self) -> Option<Vec<String>>;
+
+    /// Returns the exported [global instance](crate::Global) by name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target exported [global instance](crate::Global).
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [global instance](crate::Global), then an error is returned.
+    fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>;
+
+    /// Returns the length of the exported [global instances](crate::Global) in this module instance.
+    fn global_len(&self) -> u32;
+
+    /// Returns the names of the exported [global instances](crate::Global) in this module instance.
+    fn global_names(&self) -> Option<Vec<String>>;
+}
+
+/// An [ImportModule] represents a host module with a name. A host module consists of one or more host [function](crate::Function), [table](crate::Table), [memory](crate::Memory), and [global](crate::Global) instances,  which are defined outside wasm modules and fed into wasm modules as imports.
+#[derive(Debug, Clone)]
+pub struct ImportModule<T: ?Sized + Send + Sync + Clone> {
+    pub(crate) inner: Arc<InnerInstance>,
+    pub(crate) registered: bool,
+    name: String,
+    funcs: Vec<Function>,
+    data: Option<Box<T>>,
+}
+impl<T: ?Sized + Send + Sync + Clone> Drop for ImportModule<T> {
+    #[allow(clippy::from_raw_with_void_ptr)]
+    fn drop(&mut self) {
+        if !self.registered && Arc::strong_count(&self.inner) == 1 && !self.inner.0.is_null() {
+            // cleanup the stuff belonging to each host function before really dropping the host function
+            for func in self.funcs.iter() {
+                assert_eq!(Arc::strong_count(&func.inner), 1, "[wasmedge-sys] The host function is still in use while dropping the import module");
+                assert!(func.registered, "[wasmedge-sys] Trying to drop a non-registered host function while dropping the import module");
+
+                if func.data_owner {
+                    unsafe {
+                        // drop host data
+                        let p = ffi::WasmEdge_FunctionInstanceGetData(func.inner.lock().0);
+                        let _ = Box::from_raw(p as *mut std::ffi::c_void);
+                    }
+                }
+
+                // remove the real_func from HOST_FUNCS
+                let footprint = func.inner.lock().0 as usize;
+
+                if let Some(key) = HOST_FUNC_FOOTPRINTS.lock().remove(&footprint) {
+                    let mut map_host_func = HOST_FUNCS.write();
+                    if map_host_func.contains_key(&key) {
+                        let _ = map_host_func.remove(&key).expect(
+                                "[wasmedge-sys] Failed to remove the host function from HOST_FUNCS_NEW container",
+                            );
+                    }
+
+                    #[cfg(all(feature = "async", target_os = "linux"))]
+                    {
+                        let mut map_host_func = ASYNC_HOST_FUNCS.write();
+                        if map_host_func.contains_key(&key) {
+                            map_host_func.remove(&key).expect(
+                                "[wasmedge-sys] Failed to remove the host function from ASYNC_HOST_FUNCS container",
+                            );
+                        }
+                    }
+                }
+            }
+
+            // free the module instance
+            unsafe {
+                ffi::WasmEdge_ModuleInstanceDelete(self.inner.0);
+            }
+        }
+    }
+}
+impl<T: ?Sized + Send + Sync + Clone> ImportModule<T> {
+    /// Creates a module instance which is used to import host functions, tables, memories, and globals into a wasm module.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the import module instance.
+    ///
+    /// * `data` - The host context data used in this function.
+    ///
+    /// # Error
+    ///
+    /// If fail to create the import module instance, then an error is returned.
+    pub fn create(name: impl AsRef<str>, data: Option<Box<T>>) -> WasmEdgeResult<Self> {
+        let mut import = Self {
+            inner: std::sync::Arc::new(InnerInstance(std::ptr::null_mut())),
+            registered: false,
+            name: name.as_ref().to_string(),
+            funcs: Vec::new(),
+            data,
+        };
+
+        let raw_name = WasmEdgeString::from(name.as_ref());
+
+        let ctx = match import.data.as_mut() {
+            Some(boxed_data) => {
+                // let p = boxed_data.as_mut() as *mut _ as *mut std::ffi::c_void;
+                unsafe {
+                    ffi::WasmEdge_ModuleInstanceCreateWithData(
+                        raw_name.as_raw(),
+                        boxed_data.as_mut() as *mut _ as *mut std::ffi::c_void,
+                        None,
+                    )
+                }
+            }
+            None => unsafe { ffi::WasmEdge_ModuleInstanceCreate(raw_name.as_raw()) },
+        };
+
+        import.inner = Arc::new(InnerInstance(ctx));
+
+        Ok(import)
+    }
+
+    /// Provides a raw pointer to the inner module instance context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_ModuleInstanceContext {
+        self.inner.0 as *const _
+    }
+}
+impl<T: ?Sized + Send + Sync + Clone> AsImport for ImportModule<T> {
+    fn name(&self) -> &str {
+        self.name.as_str()
+    }
+
+    fn add_func(&mut self, name: impl AsRef<str>, func: Function) {
+        self.funcs.push(func);
+        let f = self.funcs.last_mut().unwrap();
+        f.registered = true;
+
+        let func_name: WasmEdgeString = name.into();
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceAddFunction(
+                self.inner.0,
+                func_name.as_raw(),
+                f.inner.lock().0,
+            );
+        }
+    }
+
+    fn add_table(&mut self, name: impl AsRef<str>, table: Table) {
+        let table_name: WasmEdgeString = name.as_ref().into();
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceAddTable(
+                self.inner.0,
+                table_name.as_raw(),
+                table.inner.lock().0,
+            );
+        }
+
+        table.inner.lock().0 = std::ptr::null_mut();
+    }
+
+    fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory) {
+        let mem_name: WasmEdgeString = name.as_ref().into();
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceAddMemory(
+                self.inner.0,
+                mem_name.as_raw(),
+                memory.inner.lock().0,
+            );
+        }
+        memory.inner.lock().0 = std::ptr::null_mut();
+    }
+
+    fn add_global(&mut self, name: impl AsRef<str>, global: Global) {
+        let global_name: WasmEdgeString = name.as_ref().into();
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceAddGlobal(
+                self.inner.0,
+                global_name.as_raw(),
+                global.inner.lock().0,
+            );
+        }
+        global.inner.lock().0 = std::ptr::null_mut();
+    }
+}
+
+/// A [WasiModule] is a module instance for the WASI specification.
+#[cfg(not(feature = "async"))]
+#[derive(Debug, Clone)]
+pub struct WasiModule {
+    pub(crate) inner: Arc<InnerInstance>,
+    pub(crate) registered: bool,
+    funcs: Vec<Function>,
+}
+#[cfg(not(feature = "async"))]
+impl Drop for WasiModule {
+    fn drop(&mut self) {
+        if !self.registered && Arc::strong_count(&self.inner) == 1 && !self.inner.0.is_null() {
+            // free the module instance
+            unsafe {
+                ffi::WasmEdge_ModuleInstanceDelete(self.inner.0);
+            }
+
+            // drop the registered host functions
+            self.funcs.drain(..);
+        }
+    }
+}
+#[cfg(not(feature = "async"))]
+impl WasiModule {
+    /// Creates a WASI host module which contains the WASI host functions, and initializes it with the given parameters.
+    ///
+    /// # Arguments
+    ///
+    /// * `args` - The commandline arguments. The first argument is the program name.
+    ///
+    /// * `envs` - The environment variables in the format `ENV_VAR_NAME=VALUE`.
+    ///
+    /// * `preopens` - The directories to pre-open. The required format is `GUEST_PATH:HOST_PATH`.
+    ///
+    /// # Error
+    ///
+    /// If fail to create a host module, then an error is returned.
+    pub fn create(
+        args: Option<Vec<&str>>,
+        envs: Option<Vec<&str>>,
+        preopens: Option<Vec<&str>>,
+    ) -> WasmEdgeResult<Self> {
+        // parse args
+        let cstr_args: Vec<_> = match args {
+            Some(args) => args
+                .iter()
+                .map(|&x| std::ffi::CString::new(x).unwrap())
+                .collect(),
+            None => vec![],
+        };
+        let mut p_args: Vec<_> = cstr_args.iter().map(|x| x.as_ptr()).collect();
+        let p_args_len = p_args.len();
+        p_args.push(std::ptr::null());
+
+        // parse envs
+        let cstr_envs: Vec<_> = match envs {
+            Some(envs) => envs
+                .iter()
+                .map(|&x| std::ffi::CString::new(x).unwrap())
+                .collect(),
+            None => vec![],
+        };
+        let mut p_envs: Vec<_> = cstr_envs.iter().map(|x| x.as_ptr()).collect();
+        let p_envs_len = p_envs.len();
+        p_envs.push(std::ptr::null());
+
+        // parse preopens
+        let cstr_preopens: Vec<_> = match preopens {
+            Some(preopens) => preopens
+                .iter()
+                .map(|&x| std::ffi::CString::new(x).unwrap())
+                .collect(),
+            None => vec![],
+        };
+        let mut p_preopens: Vec<_> = cstr_preopens.iter().map(|x| x.as_ptr()).collect();
+        let p_preopens_len = p_preopens.len();
+        p_preopens.push(std::ptr::null());
+
+        let ctx = unsafe {
+            ffi::WasmEdge_ModuleInstanceCreateWASI(
+                p_args.as_ptr(),
+                p_args_len as u32,
+                p_envs.as_ptr(),
+                p_envs_len as u32,
+                p_preopens.as_ptr(),
+                p_preopens_len as u32,
+            )
+        };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::ImportObjCreate)),
+            false => Ok(Self {
+                inner: std::sync::Arc::new(InnerInstance(ctx)),
+                registered: false,
+                funcs: Vec::new(),
+            }),
+        }
+    }
+
+    /// Returns the name of the module instance.
+    pub fn name(&self) -> &str {
+        "wasi_snapshot_preview1"
+    }
+
+    /// Initializes the WASI host module with the given parameters.
+    ///
+    /// # Arguments
+    ///
+    /// * `args` - The commandline arguments. The first argument is the program name.
+    ///
+    /// * `envs` - The environment variables in the format `ENV_VAR_NAME=VALUE`.
+    ///
+    /// * `preopens` - The directories to pre-open. The required format is `GUEST_PATH:HOST_PATH`.
+    pub fn init_wasi(
+        &mut self,
+        args: Option<Vec<&str>>,
+        envs: Option<Vec<&str>>,
+        preopens: Option<Vec<&str>>,
+    ) {
+        // parse args
+        let cstr_args: Vec<_> = match args {
+            Some(args) => args
+                .iter()
+                .map(|&x| std::ffi::CString::new(x).unwrap())
+                .collect(),
+            None => vec![],
+        };
+        let mut p_args: Vec<_> = cstr_args.iter().map(|x| x.as_ptr()).collect();
+        let p_args_len = p_args.len();
+        p_args.push(std::ptr::null());
+
+        // parse envs
+        let cstr_envs: Vec<_> = match envs {
+            Some(envs) => envs
+                .iter()
+                .map(|&x| std::ffi::CString::new(x).unwrap())
+                .collect(),
+            None => vec![],
+        };
+        let mut p_envs: Vec<_> = cstr_envs.iter().map(|x| x.as_ptr()).collect();
+        let p_envs_len = p_envs.len();
+        p_envs.push(std::ptr::null());
+
+        // parse preopens
+        let cstr_preopens: Vec<_> = match preopens {
+            Some(preopens) => preopens
+                .iter()
+                .map(|&x| std::ffi::CString::new(x).unwrap())
+                .collect(),
+            None => vec![],
+        };
+        let mut p_preopens: Vec<_> = cstr_preopens.iter().map(|x| x.as_ptr()).collect();
+        let p_preopens_len = p_preopens.len();
+        p_preopens.push(std::ptr::null());
+
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceInitWASI(
+                self.inner.0,
+                p_args.as_ptr(),
+                p_args_len as u32,
+                p_envs.as_ptr(),
+                p_envs_len as u32,
+                p_preopens.as_ptr(),
+                p_preopens_len as u32,
+            )
+        };
+    }
+
+    /// Returns the WASI exit code.
+    ///
+    /// The WASI exit code can be accessed after running the "_start" function of a `wasm32-wasi` program.
+    pub fn exit_code(&self) -> u32 {
+        unsafe { ffi::WasmEdge_ModuleInstanceWASIGetExitCode(self.inner.0 as *const _) }
+    }
+
+    /// Returns the native handler from the mapped FD/Handler.
+    ///
+    /// # Argument
+    ///
+    /// * `fd` - The WASI mapped Fd.
+    ///
+    /// # Error
+    ///
+    /// If fail to get the native handler, then an error is returned.
+    pub fn get_native_handler(&self, fd: i32) -> WasmEdgeResult<u64> {
+        let mut handler: u64 = 0;
+        let code: u32 = unsafe {
+            ffi::WasmEdge_ModuleInstanceWASIGetNativeHandler(
+                self.inner.0 as *const _,
+                fd,
+                &mut handler as *mut u64,
+            )
+        };
+
+        match code {
+            0 => Ok(handler),
+            _ => Err(Box::new(WasmEdgeError::Instance(
+                InstanceError::NotFoundMappedFdHandler,
+            ))),
+        }
+    }
+
+    /// Provides a raw pointer to the inner module instance context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_ModuleInstanceContext {
+        self.inner.0 as *const _
+    }
+}
+
+/// The module to be registered via the the [Executor::register_import_module](crate::Executor::register_import_module) function is required to implement this trait.
+pub trait AsImport {
+    /// Returns the name of the module instance.
+    fn name(&self) -> &str;
+
+    /// Imports a [host function instance](crate::Function).
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The name of the host function instance to import.
+    ///
+    /// * `func` - The host function instance to import.
+    fn add_func(&mut self, name: impl AsRef<str>, func: Function);
+
+    /// Imports a [table instance](crate::Table).
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The name of the host table instance to import.
+    ///
+    /// * `table` - The host table instance to import.
+    fn add_table(&mut self, name: impl AsRef<str>, table: Table);
+
+    /// Imports a [memory instance](crate::Memory).
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The name of the host memory instance to import.
+    ///
+    /// * `memory` - The host memory instance to import.
+    fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory);
+
+    /// Imports a [global instance](crate::Global).
+    ///
+    /// # Arguments
+    ///
+    /// * `name` - The name of the host global instance to import.
+    ///
+    /// * `global` - The host global instance to import.
+    fn add_global(&mut self, name: impl AsRef<str>, global: Global);
+}
+
+/// Defines three types of module instances that can be imported into a WasmEdge [Store](crate::Store) instance.
+#[derive(Debug, Clone)]
+pub enum WasiInstance {
+    /// Defines the import module instance of WasiModule type.
+    #[cfg(not(feature = "async"))]
+    #[cfg_attr(docsrs, doc(cfg(not(feature = "async"))))]
+    Wasi(WasiModule),
+    /// Defines the import module instance of AsyncWasiModule type.
+    #[cfg(all(feature = "async", target_os = "linux"))]
+    #[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+    AsyncWasi(AsyncWasiModule),
+}
+impl WasiInstance {
+    /// Returns the name of the import object.
+    pub fn name(&self) -> &str {
+        match self {
+            #[cfg(not(feature = "async"))]
+            WasiInstance::Wasi(wasi) => wasi.name(),
+            #[cfg(all(feature = "async", target_os = "linux"))]
+            WasiInstance::AsyncWasi(async_wasi) => async_wasi.name(),
+        }
+    }
+
+    /// Returns the raw pointer to the inner `WasmEdge_ModuleInstanceContext`.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_raw_ptr(&self) -> *const ffi::WasmEdge_ModuleInstanceContext {
+        match self {
+            #[cfg(not(feature = "async"))]
+            WasiInstance::Wasi(wasi) => wasi.inner.0,
+            #[cfg(all(feature = "async", target_os = "linux"))]
+            WasiInstance::AsyncWasi(async_wasi) => async_wasi.inner.0,
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{
+        CallingFrame, Config, Executor, FuncType, GlobalType, ImportModule, MemType, Store,
+        TableType, WasmValue, HOST_FUNCS, HOST_FUNC_FOOTPRINTS,
+    };
+    #[cfg(not(feature = "async"))]
+    use std::sync::{Arc, Mutex};
+    use std::thread;
+    use wasmedge_macro::sys_host_function;
+    use wasmedge_types::{error::HostFuncError, Mutability, NeverType, RefType, ValType};
+
+    #[test]
+    // #[cfg(not(feature = "async"))]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_add_instance() {
+        assert_eq!(HOST_FUNCS.read().len(), 0);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 0);
+
+        let host_name = "extern";
+
+        // create an import module
+        let result = ImportModule::<NeverType>::create(host_name, None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        // create a host function
+        let result = FuncType::create([ValType::ExternRef, ValType::I32], [ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        let host_func = result.unwrap();
+        // add the host function
+        import.add_func("func-add", host_func);
+
+        assert_eq!(HOST_FUNCS.read().len(), 1);
+        assert_eq!(HOST_FUNC_FOOTPRINTS.lock().len(), 1);
+
+        // create a table
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let table_ty = result.unwrap();
+        let result = Table::create(&table_ty);
+        assert!(result.is_ok());
+        let host_table = result.unwrap();
+        // add the table
+        import.add_table("table", host_table);
+
+        // create a memory
+        let result = MemType::create(1, Some(2), false);
+        assert!(result.is_ok());
+        let mem_ty = result.unwrap();
+        let result = Memory::create(&mem_ty);
+        assert!(result.is_ok());
+        let host_memory = result.unwrap();
+        // add the memory
+        import.add_memory("memory", host_memory);
+
+        // create a global
+        let result = GlobalType::create(ValType::I32, Mutability::Const);
+        assert!(result.is_ok());
+        let global_ty = result.unwrap();
+        let result = Global::create(&global_ty, WasmValue::from_i32(666));
+        assert!(result.is_ok());
+        let host_global = result.unwrap();
+        // add the global
+        import.add_global("global_i32", host_global);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_import_module_send() {
+        let host_name = "extern";
+
+        // create an ImportModule instance
+        let result = ImportModule::<NeverType>::create(host_name, None);
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            assert!(!import.inner.0.is_null());
+            println!("{:?}", import.inner);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[cfg(not(feature = "async"))]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_import_module_sync() {
+        let host_name = "extern";
+
+        // create an ImportModule instance
+        let result = ImportModule::<NeverType>::create(host_name, None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        // add host function
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+        import.add_func("add", host_func);
+
+        // add table
+        let result = TableType::create(RefType::FuncRef, 0, Some(u32::MAX));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let table = result.unwrap();
+        import.add_table("table", table);
+
+        // add memory
+        let memory = {
+            let result = MemType::create(10, Some(20), false);
+            assert!(result.is_ok());
+            let mem_ty = result.unwrap();
+            let result = Memory::create(&mem_ty);
+            assert!(result.is_ok());
+            result.unwrap()
+        };
+        import.add_memory("memory", memory);
+
+        // add globals
+        let result = GlobalType::create(ValType::F32, Mutability::Const);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Global::create(&ty, WasmValue::from_f32(3.5));
+        assert!(result.is_ok());
+        let global = result.unwrap();
+        import.add_global("global", global);
+
+        let import = Arc::new(Mutex::new(import));
+        let import_cloned = Arc::clone(&import);
+        let handle = thread::spawn(move || {
+            let result = import_cloned.lock();
+            assert!(result.is_ok());
+            let import = result.unwrap();
+
+            // create a store
+            let result = Store::create();
+            assert!(result.is_ok());
+            let mut store = result.unwrap();
+            assert!(!store.inner.0.is_null());
+            assert!(!store.registered);
+
+            // create an executor
+            let result = Config::create();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+            let result = Executor::create(Some(&config), None);
+            assert!(result.is_ok());
+            let mut executor = result.unwrap();
+
+            // register import object into store
+            let result = executor.register_import_module(&mut store, &import);
+            assert!(result.is_ok());
+
+            // get the exported module by name
+            let result = store.module("extern");
+            assert!(result.is_ok());
+            let instance = result.unwrap();
+
+            // get the exported function by name
+            let result = instance.get_func("add");
+            assert!(result.is_ok());
+
+            // get the exported global by name
+            let result = instance.get_global("global");
+            assert!(result.is_ok());
+            let global = result.unwrap();
+            assert!(!global.inner.lock().0.is_null() && global.registered);
+            let val = global.get_value();
+            assert_eq!(val.to_f32(), 3.5);
+
+            // get the exported memory by name
+            let result = instance.get_memory("memory");
+            assert!(result.is_ok());
+            let memory = result.unwrap();
+            let result = memory.ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            assert_eq!(ty.min(), 10);
+            assert_eq!(ty.max(), Some(20));
+
+            // get the exported table by name
+            let result = instance.get_table("table");
+            assert!(result.is_ok());
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[cfg(all(not(feature = "async"), target_family = "unix"))]
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_wasi() {
+        // create a wasi module instance
+        {
+            let result = WasiModule::create(None, None, None);
+            assert!(result.is_ok());
+
+            let result = WasiModule::create(
+                Some(vec!["arg1", "arg2"]),
+                Some(vec!["ENV1=VAL1", "ENV1=VAL2", "ENV3=VAL3"]),
+                Some(vec![
+                    "apiTestData",
+                    "Makefile",
+                    "CMakeFiles",
+                    "ssvmAPICoreTests",
+                    ".:.",
+                ]),
+            );
+            assert!(result.is_ok());
+
+            let result = WasiModule::create(
+                None,
+                Some(vec!["ENV1=VAL1", "ENV1=VAL2", "ENV3=VAL3"]),
+                Some(vec![
+                    "apiTestData",
+                    "Makefile",
+                    "CMakeFiles",
+                    "ssvmAPICoreTests",
+                    ".:.",
+                ]),
+            );
+            assert!(result.is_ok());
+            let wasi_import = result.unwrap();
+            assert_eq!(wasi_import.exit_code(), 0);
+        }
+    }
+
+    #[test]
+    #[cfg(not(feature = "async"))]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_find_xxx() -> Result<(), Box<dyn std::error::Error>> {
+        let module_name = "extern_module";
+
+        // create ImportModule instance
+        let result = ImportModule::<NeverType>::create(module_name, None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        // add host function
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+        import.add_func("add", host_func);
+
+        // add table
+        let result = TableType::create(RefType::FuncRef, 0, Some(u32::MAX));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let table = result.unwrap();
+        import.add_table("table", table);
+
+        // add memory
+        let result = MemType::create(0, Some(u32::MAX), false);
+        assert!(result.is_ok());
+        let mem_ty = result.unwrap();
+        let result = Memory::create(&mem_ty);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+        import.add_memory("mem", memory);
+
+        // add global
+        let result = GlobalType::create(ValType::F32, Mutability::Const);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Global::create(&ty, WasmValue::from_f32(3.5));
+        assert!(result.is_ok());
+        let global = result.unwrap();
+        import.add_global("global", global);
+
+        // create an executor
+        let mut executor = Executor::create(None, None)?;
+
+        // create a store
+        let mut store = Store::create()?;
+
+        executor.register_import_module(&mut store, &import)?;
+
+        // get the module named "extern"
+        let result = store.module("extern_module");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // check the name of the module
+        assert!(instance.name().is_some());
+        assert_eq!(instance.name().unwrap(), "extern_module");
+
+        // get the exported function named "fib"
+        let result = instance.get_func("add");
+        assert!(result.is_ok());
+        let func = result.unwrap();
+
+        // check the type of the function
+        let result = func.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+
+        // check the parameter types
+        let param_types = ty.params_type_iter().collect::<Vec<ValType>>();
+        assert_eq!(param_types, [ValType::I32, ValType::I32]);
+
+        // check the return types
+        let return_types = ty.returns_type_iter().collect::<Vec<ValType>>();
+        assert_eq!(return_types, [ValType::I32]);
+
+        // get the exported table named "table"
+        let result = instance.get_table("table");
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // check the type of the table
+        let result = table.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert_eq!(ty.elem_ty(), RefType::FuncRef);
+        assert_eq!(ty.min(), 0);
+        assert_eq!(ty.max(), Some(u32::MAX));
+
+        // get the exported memory named "mem"
+        let result = instance.get_memory("mem");
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+
+        // check the type of the memory
+        let result = memory.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert_eq!(ty.min(), 0);
+        assert_eq!(ty.max(), Some(u32::MAX));
+
+        // get the exported global named "global"
+        let result = instance.get_global("global");
+        assert!(result.is_ok());
+        let global = result.unwrap();
+
+        // check the type of the global
+        let result = global.ty();
+        assert!(result.is_ok());
+        let global = result.unwrap();
+        assert_eq!(global.value_type(), ValType::F32);
+        assert_eq!(global.mutability(), Mutability::Const);
+
+        Ok(())
+    }
+
+    #[test]
+    #[cfg(not(feature = "async"))]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_find_names() -> Result<(), Box<dyn std::error::Error>> {
+        let module_name = "extern_module";
+
+        // create ImportModule instance
+        let result = ImportModule::<NeverType>::create(module_name, None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        // add host function
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+        import.add_func("add", host_func);
+
+        // add table
+        let result = TableType::create(RefType::FuncRef, 0, Some(u32::MAX));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let table = result.unwrap();
+        import.add_table("table", table);
+
+        // add memory
+        let result = MemType::create(0, Some(u32::MAX), false);
+        assert!(result.is_ok());
+        let mem_ty = result.unwrap();
+        let result = Memory::create(&mem_ty);
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+        import.add_memory("mem", memory);
+
+        // add global
+        let result = GlobalType::create(ValType::F32, Mutability::Const);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Global::create(&ty, WasmValue::from_f32(3.5));
+        assert!(result.is_ok());
+        let global = result.unwrap();
+        import.add_global("global", global);
+
+        // create an executor
+        let mut executor = Executor::create(None, None)?;
+
+        // create a store
+        let mut store = Store::create()?;
+
+        executor.register_import_module(&mut store, &import)?;
+
+        // get the module named "extern"
+        let result = store.module("extern_module");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        // check the name of the module
+        assert!(instance.name().is_some());
+        assert_eq!(instance.name().unwrap(), "extern_module");
+
+        assert_eq!(instance.func_len(), 1);
+        let result = instance.func_names();
+        assert!(result.is_some());
+        assert_eq!(result.unwrap(), ["add"]);
+
+        assert_eq!(instance.table_len(), 1);
+        let result = instance.table_names();
+        assert!(result.is_some());
+        assert_eq!(result.unwrap(), ["table"]);
+
+        assert_eq!(instance.mem_len(), 1);
+        let result = instance.mem_names();
+        assert!(result.is_some());
+        assert_eq!(result.unwrap(), ["mem"]);
+
+        assert_eq!(instance.global_len(), 1);
+        let result = instance.global_names();
+        assert!(result.is_some());
+        assert_eq!(result.unwrap(), ["global"]);
+
+        Ok(())
+    }
+
+    #[test]
+    #[cfg(not(feature = "async"))]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_get() {
+        let module_name = "extern_module";
+
+        let result = Store::create();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+        assert!(!store.inner.0.is_null());
+        assert!(!store.registered);
+
+        // check the length of registered module list in store before instantiation
+        assert_eq!(store.module_len(), 0);
+        assert!(store.module_names().is_none());
+
+        // create ImportObject instance
+        let result = ImportModule::<NeverType>::create(module_name, None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        // add host function
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+        import.add_func("add", host_func);
+
+        // add table
+        let result = TableType::create(RefType::FuncRef, 0, Some(u32::MAX));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let table = result.unwrap();
+        import.add_table("table", table);
+
+        // add memory
+        let memory = {
+            let result = MemType::create(10, Some(20), false);
+            assert!(result.is_ok());
+            let mem_ty = result.unwrap();
+            let result = Memory::create(&mem_ty);
+            assert!(result.is_ok());
+            result.unwrap()
+        };
+        import.add_memory("mem", memory);
+
+        // add globals
+        let result = GlobalType::create(ValType::F32, Mutability::Const);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Global::create(&ty, WasmValue::from_f32(3.5));
+        assert!(result.is_ok());
+        let global = result.unwrap();
+        import.add_global("global", global);
+
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+        let result = Executor::create(Some(&config), None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        let result = executor.register_import_module(&mut store, &import);
+        assert!(result.is_ok());
+
+        let result = store.module(module_name);
+        assert!(result.is_ok());
+        let mut instance = result.unwrap();
+
+        // get the exported memory
+        let result = instance.get_memory("mem");
+        assert!(result.is_ok());
+        let memory = result.unwrap();
+        let result = memory.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert_eq!(ty.min(), 10);
+        assert_eq!(ty.max(), Some(20));
+
+        // get host data
+        assert!(instance.host_data::<NeverType>().is_none());
+    }
+
+    #[sys_host_function]
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+    ) -> Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+
+    #[cfg(not(feature = "async"))]
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_instance_clone() {
+        // clone of ImportModule
+        {
+            let host_name = "extern";
+
+            // create an import module
+            let result = ImportModule::<NeverType>::create(host_name, None);
+            assert!(result.is_ok());
+            let mut import = result.unwrap();
+
+            // create a host function
+            let result = FuncType::create([ValType::ExternRef, ValType::I32], [ValType::I32]);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            // add the host function
+            import.add_func("func-add", host_func);
+
+            // create a table
+            let result = TableType::create(RefType::FuncRef, 10, Some(20));
+            assert!(result.is_ok());
+            let table_ty = result.unwrap();
+            let result = Table::create(&table_ty);
+            assert!(result.is_ok());
+            let host_table = result.unwrap();
+            // add the table
+            import.add_table("table", host_table);
+
+            // create a memory
+            let result = MemType::create(1, Some(2), false);
+            assert!(result.is_ok());
+            let mem_ty = result.unwrap();
+            let result = Memory::create(&mem_ty);
+            assert!(result.is_ok());
+            let host_memory = result.unwrap();
+            // add the memory
+            import.add_memory("memory", host_memory);
+
+            // create a global
+            let result = GlobalType::create(ValType::I32, Mutability::Const);
+            assert!(result.is_ok());
+            let global_ty = result.unwrap();
+            let result = Global::create(&global_ty, WasmValue::from_i32(666));
+            assert!(result.is_ok());
+            let host_global = result.unwrap();
+            // add the global
+            import.add_global("global_i32", host_global);
+            assert_eq!(Arc::strong_count(&import.inner), 1);
+
+            // clone the import module
+            let import_clone = import.clone();
+            assert_eq!(Arc::strong_count(&import.inner), 2);
+
+            drop(import);
+            assert_eq!(Arc::strong_count(&import_clone.inner), 1);
+
+            drop(import_clone);
+        }
+
+        // clone of WasiModule
+        {
+            let result = WasiModule::create(None, None, None);
+            assert!(result.is_ok());
+
+            let result = WasiModule::create(
+                Some(vec!["arg1", "arg2"]),
+                Some(vec!["ENV1=VAL1", "ENV1=VAL2", "ENV3=VAL3"]),
+                Some(vec![
+                    "apiTestData",
+                    "Makefile",
+                    "CMakeFiles",
+                    "ssvmAPICoreTests",
+                    ".:.",
+                ]),
+            );
+            assert!(result.is_ok());
+
+            let result = WasiModule::create(
+                None,
+                Some(vec!["ENV1=VAL1", "ENV1=VAL2", "ENV3=VAL3"]),
+                Some(vec![
+                    "apiTestData",
+                    "Makefile",
+                    "CMakeFiles",
+                    "ssvmAPICoreTests",
+                    ".:.",
+                ]),
+            );
+            assert!(result.is_ok());
+            let wasi_import = result.unwrap();
+            assert_eq!(wasi_import.exit_code(), 0);
+            assert_eq!(std::sync::Arc::strong_count(&wasi_import.inner), 1);
+
+            // clone
+            let wasi_import_clone = wasi_import.clone();
+            assert_eq!(std::sync::Arc::strong_count(&wasi_import.inner), 2);
+
+            drop(wasi_import);
+            assert_eq!(std::sync::Arc::strong_count(&wasi_import_clone.inner), 1);
+            drop(wasi_import_clone);
+        }
+    }
+
+    #[test]
+    fn test_instance_create_import_with_data() {
+        let module_name = "extern_module";
+
+        // define host data
+        #[derive(Clone, Debug)]
+        struct Circle {
+            radius: i32,
+        }
+
+        let circle = Circle { radius: 10 };
+
+        // create an import module
+        let result = ImportModule::create(module_name, Some(Box::new(circle)));
+
+        assert!(result.is_ok());
+        let import = result.unwrap();
+
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+        let result = Executor::create(Some(&config), None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        let result = Store::create();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        let result = executor.register_import_module(&mut store, &import);
+        assert!(result.is_ok());
+
+        let result = store.module(module_name);
+        assert!(result.is_ok());
+        let mut instance = result.unwrap();
+
+        let result = instance.host_data::<Circle>();
+        assert!(result.is_some());
+        let host_data = result.unwrap();
+        assert_eq!(host_data.radius, 10);
+    }
+
+    #[test]
+    fn test_instance_valgrind_memory_check() {
+        // define host data
+        #[derive(Clone, Debug)]
+        struct Circle {
+            radius: i32,
+        }
+        impl Drop for Circle {
+            fn drop(&mut self) {
+                println!("dropping circle: {}", self.radius);
+            }
+        }
+
+        #[sys_host_function]
+        fn real_add_new(
+            _frame: CallingFrame,
+            inputs: Vec<WasmValue>,
+            data: &mut Circle,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            println!("radius of circle: {}", data.radius);
+
+            if inputs.len() != 2 {
+                return Err(HostFuncError::User(1));
+            }
+
+            let a = if inputs[0].ty() == ValType::I32 {
+                inputs[0].to_i32()
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+
+            let b = if inputs[1].ty() == ValType::I32 {
+                inputs[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            let c = a + b;
+
+            Ok(vec![WasmValue::from_i32(c)])
+        }
+
+        // create an import module
+        let host_name = "extern";
+        let result = ImportModule::<NeverType>::create(host_name, None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        // create a host function
+        let result = FuncType::create([ValType::ExternRef, ValType::I32], [ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result = Function::create_sync_func::<Circle>(
+            &func_ty,
+            Box::new(real_add_new),
+            Some(Box::new(Circle { radius: 10 })),
+            0,
+        );
+        let host_func = result.unwrap();
+
+        // add the host function
+        import.add_func("func-add", host_func);
+        drop(import);
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/instance/table.rs.html b/src/wasmedge_sys/instance/table.rs.html new file mode 100644 index 000000000..656dc1201 --- /dev/null +++ b/src/wasmedge_sys/instance/table.rs.html @@ -0,0 +1,1053 @@ +table.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+
//! Defines WasmEdge Table and TableType structs.
+//!
+//! A WasmEdge `Table` defines a WebAssembly table instance described by its `TableType`.
+//! `TableType` specifies the limits on the size of a table. The start of
+//! the limit range specifies the lower bound (inclusive) of the size, while
+//! the end resticts the upper bound (inclusive).
+
+use crate::{
+    ffi,
+    types::{WasmEdgeLimit, WasmValue},
+    utils::check,
+    WasmEdgeResult,
+};
+use parking_lot::Mutex;
+use std::sync::Arc;
+use wasmedge_types::{
+    error::{TableError, WasmEdgeError},
+    RefType,
+};
+
+/// A WasmEdge [Table] defines a WebAssembly table instance described by its [type](crate::TableType). A table is an array-like structure and stores function references.
+///
+/// This [example](https://github.com/WasmEdge/WasmEdge/tree/master/bindings/rust/wasmedge-sys/examples/table_and_funcref.rs) shows how to use [Table] to store and retrieve function references.
+#[derive(Debug)]
+pub struct Table {
+    pub(crate) inner: Arc<Mutex<InnerTable>>,
+    pub(crate) registered: bool,
+}
+impl Table {
+    /// Creates a new [Table] to be associated with the given element type and the size.
+    ///
+    /// # Arguments
+    ///
+    /// - `ty` specifies the type of the new [Table].
+    ///
+    /// # Error
+    ///
+    /// * If fail to create the table instance, then WasmEdgeError::Table(TableError::Create)(crate::error::TableError) is returned.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use wasmedge_sys::{TableType, Table};
+    /// use wasmedge_types::RefType;
+    ///
+    /// // create a TableType instance
+    /// let ty = TableType::create(RefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+    ///
+    /// // create a Table instance
+    /// let table = Table::create(&ty).expect("fail to create a Table");
+    /// ```
+    pub fn create(ty: &TableType) -> WasmEdgeResult<Self> {
+        let ctx = unsafe { ffi::WasmEdge_TableInstanceCreate(ty.inner.0) };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Table(TableError::Create))),
+            false => Ok(Table {
+                inner: Arc::new(Mutex::new(InnerTable(ctx))),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Returns the [TableType] of the [Table].
+    ///
+    /// # Error
+    ///
+    /// If fail to get type, then an error is returned.
+    pub fn ty(&self) -> WasmEdgeResult<TableType> {
+        let ty_ctx = unsafe { ffi::WasmEdge_TableInstanceGetTableType(self.inner.lock().0) };
+        match ty_ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Table(TableError::Type))),
+            false => Ok(TableType {
+                inner: InnerTableType(ty_ctx as *mut _),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Returns the element value at a specific position in the [Table].
+    ///
+    /// # Arguments
+    ///
+    /// - `idx` specifies the position in the [Table], at which the [WasmValue](crate::WasmValue) is returned.
+    ///
+    /// # Error
+    ///
+    /// If fail to get the data, then an error is returned.
+    pub fn get_data(&self, idx: u32) -> WasmEdgeResult<WasmValue> {
+        let raw_val = unsafe {
+            let mut data = ffi::WasmEdge_ValueGenI32(0);
+            check(ffi::WasmEdge_TableInstanceGetData(
+                self.inner.lock().0,
+                &mut data as *mut _,
+                idx,
+            ))?;
+            data
+        };
+        Ok(raw_val.into())
+    }
+
+    /// Sets a new element value at a specific position in the [Table].
+    ///
+    /// # Arguments
+    ///
+    /// - `data` specifies the new data.
+    ///
+    /// - `idx` specifies the position of the new data to be stored in the [Table].
+    ///
+    /// # Error
+    ///
+    /// If fail to set data, then an error is returned.
+    pub fn set_data(&mut self, data: WasmValue, idx: u32) -> WasmEdgeResult<()> {
+        unsafe {
+            check(ffi::WasmEdge_TableInstanceSetData(
+                self.inner.lock().0,
+                data.as_raw(),
+                idx,
+            ))
+        }
+    }
+
+    /// Returns the capacity of the [Table].
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use wasmedge_sys::{TableType, Table};
+    /// use wasmedge_types::RefType;
+    ///
+    /// // create a TableType instance and a Table
+    /// let ty = TableType::create(RefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+    /// let table = Table::create(&ty).expect("fail to create a Table");
+    ///
+    /// // check capacity
+    /// assert_eq!(table.capacity(), 10);
+    /// ```
+    ///
+    pub fn capacity(&self) -> usize {
+        unsafe { ffi::WasmEdge_TableInstanceGetSize(self.inner.lock().0) as usize }
+    }
+
+    /// Increases the capacity of the [Table].
+    ///
+    /// After growing, the new capacity must be in the range defined by `limit` when the table is created.
+    ///
+    /// # Argument
+    ///
+    /// - `size` specifies the size to be added to the [Table].
+    ///
+    /// # Error
+    ///
+    /// If fail to increase the size of the [Table], then an error is returned.
+    pub fn grow(&mut self, size: u32) -> WasmEdgeResult<()> {
+        unsafe { check(ffi::WasmEdge_TableInstanceGrow(self.inner.lock().0, size)) }
+    }
+
+    /// Provides a raw pointer to the inner table context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_TableInstanceContext {
+        self.inner.lock().0 as *const _
+    }
+}
+impl Drop for Table {
+    fn drop(&mut self) {
+        if self.registered {
+            self.inner.lock().0 = std::ptr::null_mut();
+        } else if Arc::strong_count(&self.inner) == 1 && !self.inner.lock().0.is_null() {
+            unsafe { ffi::WasmEdge_TableInstanceDelete(self.inner.lock().0) };
+        }
+    }
+}
+impl Clone for Table {
+    fn clone(&self) -> Self {
+        Table {
+            inner: self.inner.clone(),
+            registered: self.registered,
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerTable(pub(crate) *mut ffi::WasmEdge_TableInstanceContext);
+unsafe impl Send for InnerTable {}
+unsafe impl Sync for InnerTable {}
+
+/// A WasmEdge [TableType] classifies a [Table] instance over elements of element types within a size range.
+#[derive(Debug)]
+pub struct TableType {
+    pub(crate) inner: InnerTableType,
+    pub(crate) registered: bool,
+}
+impl Drop for TableType {
+    fn drop(&mut self) {
+        if !self.registered && !self.inner.0.is_null() {
+            unsafe {
+                ffi::WasmEdge_TableTypeDelete(self.inner.0);
+            }
+        }
+    }
+}
+impl TableType {
+    /// Creates a new [TableType] to be associated with the given limit range of the size and the reference type.
+    ///
+    /// # Arguments
+    ///
+    /// * `elem_type` - The element type.
+    ///
+    /// * `min` - The initial size of the table to be created.
+    ///
+    /// * `max` - The maximum size of the table to be created.
+    ///
+    /// # Error
+    ///
+    /// If fail to create a [TableType], then an error is returned.
+    ///
+    /// # Example
+    ///
+    /// ```ignore
+    /// let ty = TableType::create(WasmRefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+    /// ```
+    ///
+    pub fn create(elem_ty: RefType, min: u32, max: Option<u32>) -> WasmEdgeResult<Self> {
+        let ctx = unsafe {
+            ffi::WasmEdge_TableTypeCreate(
+                elem_ty.into(),
+                WasmEdgeLimit::new(min, max, false).into(),
+            )
+        };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::TableTypeCreate)),
+            false => Ok(Self {
+                inner: InnerTableType(ctx),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Returns the element type.
+    pub fn elem_ty(&self) -> RefType {
+        let ty = unsafe { ffi::WasmEdge_TableTypeGetRefType(self.inner.0) };
+        ty.into()
+    }
+
+    /// Returns the initial size of the [Table].
+    pub fn min(&self) -> u32 {
+        let limit = unsafe { ffi::WasmEdge_TableTypeGetLimit(self.inner.0) };
+        let limit: WasmEdgeLimit = limit.into();
+        limit.min()
+    }
+
+    /// Returns the maximum size of the [Table].
+    pub fn max(&self) -> Option<u32> {
+        let limit = unsafe { ffi::WasmEdge_TableTypeGetLimit(self.inner.0) };
+        let limit: WasmEdgeLimit = limit.into();
+        limit.max()
+    }
+
+    /// Provides a raw pointer to the inner table type context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_TableTypeContext {
+        self.inner.0 as *const _
+    }
+}
+impl From<wasmedge_types::TableType> for TableType {
+    fn from(ty: wasmedge_types::TableType) -> Self {
+        TableType::create(ty.elem_ty(), ty.minimum(), ty.maximum()).expect(
+            "[wasmedge] Failed to convert wasmedge_types::TableType into wasmedge_sys::TableType.",
+        )
+    }
+}
+impl From<TableType> for wasmedge_types::TableType {
+    fn from(ty: TableType) -> Self {
+        wasmedge_types::TableType::new(ty.elem_ty(), ty.min(), ty.max())
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerTableType(pub(crate) *mut ffi::WasmEdge_TableTypeContext);
+unsafe impl Send for InnerTableType {}
+unsafe impl Sync for InnerTableType {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{CallingFrame, FuncType, Function};
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_macro::sys_host_function;
+    use wasmedge_types::{error::HostFuncError, NeverType, RefType, ValType};
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_table_type() {
+        // create a TableType instance
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+        assert!(!ty.registered);
+
+        // check element type
+        assert_eq!(ty.elem_ty(), RefType::FuncRef);
+        // check limit
+        assert_eq!(ty.min(), 10);
+        assert_eq!(ty.max(), Some(20));
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_table() {
+        // create a TableType instance
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+
+        // create a Table instance
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let mut table = result.unwrap();
+
+        // check capacity
+        assert_eq!(table.capacity(), 10);
+
+        // get type
+        let result = table.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        assert!(!ty.inner.0.is_null());
+        assert!(ty.registered);
+
+        // check limit and element type
+        assert_eq!(ty.min(), 10);
+        assert_eq!(ty.max(), Some(20));
+        assert_eq!(ty.elem_ty(), RefType::FuncRef);
+
+        // grow the capacity of table
+        let result = table.grow(5);
+        assert!(result.is_ok());
+        // check capacity
+        assert_eq!(table.capacity(), 15);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_table_data() {
+        // create a FuncType
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        // create a host function
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+
+        // create a TableType instance
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+
+        // create a Table instance
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let mut table = result.unwrap();
+
+        // check capacity
+        assert_eq!(table.capacity(), 10);
+
+        // get data in the scope of the capacity
+        let result = table.get_data(9);
+        assert!(result.is_ok());
+        let value = result.unwrap();
+        assert!(value.is_null_ref());
+        assert_eq!(value.ty(), ValType::FuncRef);
+
+        // call set_data to store a function reference at the given index of the table instance
+        let result = table.set_data(WasmValue::from_func_ref(host_func.as_ref()), 3);
+        assert!(result.is_ok());
+        // call get_data to recover the function reference from the value at the given index of the table instance
+        let result = table.get_data(3);
+        assert!(result.is_ok());
+        let value = result.unwrap();
+        let result = value.func_ref();
+        assert!(result.is_some());
+        let func_ref = result.unwrap();
+
+        // get the function type by func_ref
+        let result = func_ref.ty();
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        assert_eq!(func_ty.params_len(), 2);
+        let param_tys = func_ty.params_type_iter().collect::<Vec<_>>();
+        assert_eq!(param_tys, [ValType::I32, ValType::I32]);
+        assert_eq!(func_ty.returns_len(), 1);
+        let return_tys = func_ty.returns_type_iter().collect::<Vec<_>>();
+        assert_eq!(return_tys, [ValType::I32]);
+    }
+
+    #[test]
+    fn test_table_send() {
+        // create a TableType instance
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+
+        // create a Table instance
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            assert!(!table.inner.lock().0.is_null());
+
+            // check capacity
+            assert_eq!(table.capacity(), 10);
+
+            // get type
+            let result = table.ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            assert!(!ty.inner.0.is_null());
+            assert!(ty.registered);
+
+            // check limit and element type
+            assert_eq!(ty.min(), 10);
+            assert_eq!(ty.max(), Some(20));
+            assert_eq!(ty.elem_ty(), RefType::FuncRef);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    fn test_table_sync() {
+        // create a TableType instance
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+
+        // create a Table instance
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let table = Arc::new(Mutex::new(result.unwrap()));
+
+        let table_cloned = Arc::clone(&table);
+        let handle = thread::spawn(move || {
+            let result = table_cloned.lock();
+            assert!(result.is_ok());
+            let table = result.unwrap();
+
+            // check capacity
+            assert_eq!(table.capacity(), 10);
+
+            // get type
+            let result = table.ty();
+            assert!(result.is_ok());
+            let ty = result.unwrap();
+            assert!(!ty.inner.0.is_null());
+            assert!(ty.registered);
+
+            // check limit and element type
+            assert_eq!(ty.min(), 10);
+            assert_eq!(ty.max(), Some(20));
+            assert_eq!(ty.elem_ty(), RefType::FuncRef);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    fn test_table_clone() {
+        // create a TableType instance
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+
+        // create a Table instance
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let table = result.unwrap();
+
+        // check capacity
+        assert_eq!(table.capacity(), 10);
+
+        let table_cloned = table.clone();
+        assert_eq!(table_cloned.capacity(), table.capacity());
+
+        drop(table);
+
+        assert_eq!(table_cloned.capacity(), 10);
+    }
+
+    #[sys_host_function]
+    fn real_add(
+        _frame: CallingFrame,
+        input: Vec<WasmValue>,
+    ) -> Result<Vec<WasmValue>, HostFuncError> {
+        println!("Rust: Entering Rust function real_add");
+
+        if input.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if input[0].ty() == ValType::I32 {
+            input[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if input[1].ty() == ValType::I32 {
+            input[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+        println!("Rust: calcuating in real_add c: {c:?}");
+
+        println!("Rust: Leaving Rust function real_add");
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/io.rs.html b/src/wasmedge_sys/io.rs.html new file mode 100644 index 000000000..2350e6285 --- /dev/null +++ b/src/wasmedge_sys/io.rs.html @@ -0,0 +1,341 @@ +io.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+
use crate::WasmValue;
+use std::marker::PhantomData;
+
+fn match_value(s: &str) -> WasmValue {
+    match s {
+        "i8" => WasmValue::from_i32(0),
+        "u8" => WasmValue::from_i32(0),
+        "i16" => WasmValue::from_i32(0),
+        "u16" => WasmValue::from_i32(0),
+        "i32" => WasmValue::from_i32(0),
+        "u32" => WasmValue::from_i64(0),
+        "i64" => WasmValue::from_i64(0),
+        "f32" => WasmValue::from_f32(0.),
+        "f64" => WasmValue::from_f64(0.),
+        "u128" => WasmValue::from_v128(0),
+        _ => panic!("unsupported type for WasmFnIO"),
+    }
+}
+pub trait WasmFnIO {
+    fn parameters() -> Vec<WasmValue>
+    where
+        Self: Sized,
+    {
+        Vec::new()
+    }
+}
+
+macro_rules! factory_io {
+    ($i:ident, ($($o:ident),+)) => {
+        #[allow(non_snake_case)]
+        pub struct $i<$($o),+> {
+            $($o: PhantomData<$o>),+
+        }
+
+        impl<$($o),+> WasmFnIO for $i<$($o),+> {
+            fn parameters() -> Vec<WasmValue> {
+                vec![$(match_value(std::any::type_name::<$o>())),+]
+            }
+        }
+    }
+}
+
+factory_io!(I1, (O1));
+factory_io!(I2, (O1, O2));
+factory_io!(I3, (O1, O2, O3));
+factory_io!(I4, (O1, O2, O3, O4));
+factory_io!(I5, (O1, O2, O3, O4, O5));
+factory_io!(I6, (O1, O2, O3, O4, O5, O6));
+factory_io!(I7, (O1, O2, O3, O4, O5, O6, O7));
+factory_io!(I8, (O1, O2, O3, O4, O5, O6, O7, O8));
+factory_io!(I9, (O1, O2, O3, O4, O5, O6, O7, O8, O9));
+factory_io!(I10, (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10));
+factory_io!(I11, (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11));
+factory_io!(I12, (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12));
+factory_io!(
+    I13,
+    (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13)
+);
+factory_io!(
+    I14,
+    (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14)
+);
+factory_io!(
+    I15,
+    (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15)
+);
+factory_io!(
+    I16,
+    (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16)
+);
+factory_io!(
+    I17,
+    (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17)
+);
+factory_io!(
+    I18,
+    (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18)
+);
+factory_io!(
+    I19,
+    (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19)
+);
+factory_io!(
+    I20,
+    (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20)
+);
+factory_io!(
+    I21,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21
+    )
+);
+factory_io!(
+    I22,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22
+    )
+);
+factory_io!(
+    I23,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23
+    )
+);
+factory_io!(
+    I24,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24
+    )
+);
+factory_io!(
+    I25,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24, O25
+    )
+);
+factory_io!(
+    I26,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24, O25, O26
+    )
+);
+factory_io!(
+    I27,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24, O25, O26, O27
+    )
+);
+factory_io!(
+    I28,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24, O25, O26, O27, O28
+    )
+);
+factory_io!(
+    I29,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24, O25, O26, O27, O28, O29
+    )
+);
+factory_io!(
+    I30,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24, O25, O26, O27, O28, O29, O30
+    )
+);
+factory_io!(
+    I31,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24, O25, O26, O27, O28, O29, O30, O31
+    )
+);
+factory_io!(
+    I32,
+    (
+        O1, O2, O3, O4, O5, O6, O7, O8, O9, O10, O11, O12, O13, O14, O15, O16, O17, O18, O19, O20,
+        O21, O22, O23, O24, O25, O26, O27, O28, O29, O30, O31, O32
+    )
+);
+
\ No newline at end of file diff --git a/src/wasmedge_sys/lib.rs.html b/src/wasmedge_sys/lib.rs.html new file mode 100644 index 000000000..2abd0510d --- /dev/null +++ b/src/wasmedge_sys/lib.rs.html @@ -0,0 +1,419 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
#![doc(
+    html_logo_url = "https://github.com/cncf/artwork/blob/master/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.png?raw=true",
+    html_favicon_url = "https://raw.githubusercontent.com/cncf/artwork/49169bdbc88a7ce3c4a722c641cc2d548bd5c340/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.svg"
+)]
+
+//! # Overview
+//! The [wasmedge-sys](https://crates.io/crates/wasmedge-sys) crate defines a group of low-level Rust APIs for WasmEdge, a light-weight, high-performance, and extensible WebAssembly runtime for cloud-native, edge, and decentralized applications.
+//!
+//! For developers, it is strongly recommended that the APIs in `wasmedge-sys` are used to construct high-level libraries, while `wasmedge-sdk` is for building up business applications.
+//!
+//! * Notice that [wasmedge-sys](https://crates.io/crates/wasmedge-sys) requires **Rust v1.71 or above** in the **stable** channel.
+//!
+
+//! ## Build
+//!
+//! To use or build the `wasmedge-sys` crate, the `WasmEdge` library is required. Please refer to [WasmEdge Installation and Uninstallation](https://wasmedge.org/book/en/quick_start/install.html) to install the `WasmEdge` library.
+//!
+//! * The following table provides the versioning information about each crate of WasmEdge Rust bindings.
+//!
+//!   | wasmedge-sdk  | WasmEdge lib  | wasmedge-sys  | wasmedge-types| wasmedge-macro| async-wasi|
+//!   | :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
+//!   | 0.13.1        | 0.13.5        | 0.17.3        | 0.4.4         | 0.6.1         | 0.1.0     |
+//!   | 0.13.0        | 0.13.5        | 0.17.3        | 0.4.4         | 0.6.1         | 0.1.0     |
+//!   | 0.12.2        | 0.13.4        | 0.17.2        | 0.4.4         | 0.6.1         | 0.1.0     |
+//!   | 0.12.1        | 0.13.4        | 0.17.1        | 0.4.4         | 0.6.1         | 0.1.0     |
+//!   | 0.12.0        | 0.13.4        | 0.17.0        | 0.4.4         | 0.6.1         | 0.1.0     |
+//!   | 0.11.2        | 0.13.3        | 0.16.2        | 0.4.3         | 0.6.1         | 0.1.0     |
+//!   | 0.11.0        | 0.13.3        | 0.16.0        | 0.4.3         | 0.6.0         | 0.0.3     |
+//!   | 0.10.1        | 0.13.3        | 0.15.1        | 0.4.2         | 0.5.0         | 0.0.2     |
+//!   | 0.10.0        | 0.13.2        | 0.15.0        | 0.4.2         | 0.5.0         | 0.0.2     |
+//!   | 0.9.0         | 0.13.1        | 0.14.0        | 0.4.2         | 0.4.0         | 0.0.1     |
+//!   | 0.9.0         | 0.13.0        | 0.14.0        | 0.4.2         | 0.4.0         | 0.0.1     |
+//!   | 0.8.1         | 0.12.1        | 0.13.1        | 0.4.1         | 0.3.0         | -         |
+//!   | 0.8.0         | 0.12.0        | 0.13.0        | 0.4.1         | 0.3.0         | -         |
+//!   | 0.7.1         | 0.11.2        | 0.12.2        | 0.3.1         | 0.3.0         | -         |
+//!   | 0.7.0         | 0.11.2        | 0.12          | 0.3.1         | 0.3.0         | -         |
+//!   | 0.6.0         | 0.11.2        | 0.11          | 0.3.0         | 0.2.0         | -         |
+//!   | 0.5.0         | 0.11.1        | 0.10          | 0.3.0         | 0.1.0         | -         |
+//!   | 0.4.0         | 0.11.0        | 0.9           | 0.2.1         | -             | -         |
+//!   | 0.3.0         | 0.10.1        | 0.8           | 0.2           | -             | -         |
+//!   | 0.1.0         | 0.10.0        | 0.7           | 0.1           | -             | -         |
+//!
+//! ## API Reference
+//!
+//! * [wasmedge-sys API Reference](https://wasmedge.github.io/wasmedge-rust-sdk/wasmedge_sys/index.html)
+//! * [wasmedge-sys Async API Reference](https://second-state.github.io/wasmedge-async-rust-sdk/wasmedge_sys/index.html)
+//!
+//! ## See also
+//!
+//! * [WasmEdge Runtime Official Website](https://wasmedge.org/)
+//! * [WasmEdge Docs](https://wasmedge.org/book/en/)
+//! * [WasmEdge C API Documentation](https://github.com/WasmEdge/WasmEdge/blob/master/docs/c_api.md)
+
+#![deny(rust_2018_idioms, unreachable_pub)]
+#![cfg_attr(docsrs, feature(doc_cfg))]
+
+#[macro_use]
+extern crate lazy_static;
+
+use parking_lot::{Mutex, RwLock};
+use std::{collections::HashMap, sync::Arc};
+
+#[allow(warnings)]
+/// Foreign function interfaces generated from WasmEdge C-API.
+pub mod ffi {
+    include!(concat!(env!("OUT_DIR"), "/wasmedge.rs"));
+}
+#[doc(hidden)]
+pub mod ast_module;
+#[cfg(all(feature = "async", target_os = "linux"))]
+#[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+pub mod r#async;
+#[doc(hidden)]
+#[cfg(feature = "aot")]
+pub mod compiler;
+#[doc(hidden)]
+pub mod config;
+#[doc(hidden)]
+pub mod executor;
+pub mod frame;
+pub mod instance;
+#[doc(hidden)]
+pub mod io;
+#[doc(hidden)]
+pub mod loader;
+pub mod plugin;
+#[doc(hidden)]
+pub mod statistics;
+#[doc(hidden)]
+pub mod store;
+pub mod types;
+pub mod utils;
+#[doc(hidden)]
+pub mod validator;
+
+#[doc(inline)]
+pub use ast_module::{ExportType, ImportType, Module};
+#[doc(inline)]
+#[cfg(feature = "aot")]
+#[cfg_attr(docsrs, doc(cfg(feature = "aot")))]
+pub use compiler::Compiler;
+#[doc(inline)]
+pub use config::Config;
+#[doc(inline)]
+pub use executor::Executor;
+#[doc(inline)]
+pub use frame::CallingFrame;
+#[doc(inline)]
+#[cfg(not(feature = "async"))]
+pub use instance::module::WasiModule;
+#[doc(inline)]
+pub use instance::{
+    function::{FuncRef, FuncType, Function},
+    global::{Global, GlobalType},
+    memory::{MemType, Memory},
+    module::{AsImport, AsInstance, ImportModule, Instance, WasiInstance},
+    table::{Table, TableType},
+};
+#[doc(inline)]
+pub use loader::Loader;
+#[doc(inline)]
+pub use statistics::Statistics;
+#[doc(inline)]
+pub use store::Store;
+#[doc(inline)]
+pub use types::WasmValue;
+#[doc(inline)]
+pub use validator::Validator;
+use wasmedge_types::{error::HostFuncError, WasmEdgeResult};
+
+/// Type of wasi context that is used to configure the wasi environment.
+#[cfg(all(feature = "async", target_os = "linux"))]
+#[cfg_attr(docsrs, doc(cfg(all(feature = "async", target_os = "linux"))))]
+pub type WasiCtx = ::async_wasi::snapshots::WasiCtx;
+
+pub(crate) type BoxedFn = Box<
+    dyn Fn(
+            CallingFrame,
+            Vec<WasmValue>,
+            *mut std::os::raw::c_void,
+        ) -> Result<Vec<WasmValue>, HostFuncError>
+        + Send
+        + Sync,
+>;
+
+lazy_static! {
+    pub(crate) static ref HOST_FUNCS: RwLock<HashMap<usize, Arc<Mutex<BoxedFn>>>> =
+        RwLock::new(HashMap::new());
+}
+
+/// Type alias for a boxed native function. This type is used in thread-safe cases.
+pub(crate) type BoxedAsyncFn = Box<
+    dyn Fn(
+            CallingFrame,
+            Vec<WasmValue>,
+            *mut std::os::raw::c_void,
+        )
+            -> Box<dyn std::future::Future<Output = Result<Vec<WasmValue>, HostFuncError>> + Send>
+        + Send
+        + Sync,
+>;
+
+lazy_static! {
+    pub(crate) static ref ASYNC_HOST_FUNCS: RwLock<HashMap<usize, Arc<Mutex<BoxedAsyncFn>>>> =
+        RwLock::new(HashMap::new());
+}
+
+// Stores the mapping from the address of each host function pointer to the key of the `HOST_FUNCS`.
+lazy_static! {
+    pub(crate) static ref HOST_FUNC_FOOTPRINTS: Mutex<HashMap<usize, usize>> =
+        Mutex::new(HashMap::new());
+}
+
+/// The object that is used to perform a [host function](crate::Function) is required to implement this trait.
+pub trait Engine {
+    /// Runs a host function instance and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func` - The function instance to run.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    fn run_func(
+        &self,
+        func: &Function,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>>;
+
+    /// Runs a host function instance by calling its reference and returns the results.
+    ///
+    /// # Arguments
+    ///
+    /// * `func_ref` - A reference to the target host function instance.
+    ///
+    /// * `params` - The arguments to pass to the function.
+    ///
+    /// # Errors
+    ///
+    /// If fail to run the host function, then an error is returned.
+    fn run_func_ref(
+        &self,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue>,
+    ) -> WasmEdgeResult<Vec<WasmValue>>;
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/loader.rs.html b/src/wasmedge_sys/loader.rs.html new file mode 100644 index 000000000..0d4c5bd0e --- /dev/null +++ b/src/wasmedge_sys/loader.rs.html @@ -0,0 +1,633 @@ +loader.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+
//! Defines WasmEdge Loader struct.
+
+use crate::{
+    ast_module::{InnerModule, Module},
+    ffi, utils,
+    utils::check,
+    Config, WasmEdgeResult,
+};
+use std::{path::Path, sync::Arc};
+use wasmedge_types::error::WasmEdgeError;
+
+/// [Loader](crate::Loader) is used to load WASM modules from the given WASM files or buffers.
+#[derive(Debug)]
+pub struct Loader {
+    pub(crate) inner: InnerLoader,
+    pub(crate) registered: bool,
+}
+impl Loader {
+    /// Create a new [Loader](crate::Loader) to be associated with the given global configuration.
+    ///
+    /// # Arguments
+    ///
+    /// * `config` - A global configuration.
+    ///
+    /// # Error
+    ///
+    /// If fail to create a [Loader](crate), then an error is returned.
+    pub fn create(config: Option<&Config>) -> WasmEdgeResult<Self> {
+        let ctx = match config {
+            Some(config) => unsafe { ffi::WasmEdge_LoaderCreate(config.inner.0) },
+            None => unsafe { ffi::WasmEdge_LoaderCreate(std::ptr::null_mut()) },
+        };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::LoaderCreate)),
+            false => Ok(Self {
+                inner: InnerLoader(ctx),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Loads a WASM module from a WASM file.
+    ///
+    /// # Arguments
+    ///
+    /// * `file` - A wasm file or an AOT wasm file.
+    ///
+    /// # Error
+    ///
+    /// If fail to load, then an error is returned.
+    ///
+    /// # Example
+    ///
+    /// ```ignore
+    /// let file = "path/to/foo.wasm"
+    /// let module = loader.from_file(file)?;
+    /// ```
+    pub fn from_file(&self, file: impl AsRef<Path>) -> WasmEdgeResult<Module> {
+        match file.as_ref().extension() {
+            Some(extension) => match extension.to_str() {
+                Some("wasm") => self.load_from_wasm_or_aot_file(&file),
+                #[cfg(target_os = "macos")]
+                Some("dylib") => self.load_from_wasm_or_aot_file(&file),
+                #[cfg(target_os = "linux")]
+                Some("so") => self.load_from_wasm_or_aot_file(&file),
+                #[cfg(target_os = "windows")]
+                Some("dll") => self.load_from_wasm_or_aot_file(&file),
+                Some("wat") => {
+                    let bytes = wat::parse_file(file.as_ref())
+                        .map_err(|_| WasmEdgeError::Operation("Failed to parse wat file".into()))?;
+                    self.from_bytes(bytes)
+                }
+                _ => Err(Box::new(WasmEdgeError::Operation(
+                    "The source file's extension should be one of `wasm`, `wat`, `dylib` on macOS, `so` on Linux or `dll` on Windows.".into(),
+                ))),
+            },
+            None => self.load_from_wasm_or_aot_file(&file),
+        }
+    }
+
+    fn load_from_wasm_or_aot_file(&self, file: impl AsRef<Path>) -> WasmEdgeResult<Module> {
+        let c_path = utils::path_to_cstring(file.as_ref())?;
+        let mut mod_ctx = std::ptr::null_mut();
+        unsafe {
+            check(ffi::WasmEdge_LoaderParseFromFile(
+                self.inner.0,
+                &mut mod_ctx,
+                c_path.as_ptr(),
+            ))?;
+        }
+
+        match mod_ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::ModuleCreate)),
+            false => Ok(Module {
+                inner: Arc::new(InnerModule(mod_ctx)),
+            }),
+        }
+    }
+
+    /// Loads a WASM module from a in-memory bytes.
+    ///
+    /// # Arguments
+    ///
+    /// * `bytes` - A in-memory WASM bytes.
+    ///
+    /// # Error
+    ///
+    /// If fail to load, then an error is returned.
+    ///
+    /// # Example
+    ///
+    /// ```ignore
+    /// let bytes = b"\0asm\x01\0\0\0";
+    /// let module = loader.from_bytes(&bytes)?;
+    /// ```
+    ///
+    /// Note that the text format is not accepted:
+    ///
+    /// ```ignore
+    /// assert!(loader.from_bytes(b"(module)").is_err());
+    /// ```
+    pub fn from_bytes(&self, bytes: impl AsRef<[u8]>) -> WasmEdgeResult<Module> {
+        let mut mod_ctx: *mut ffi::WasmEdge_ASTModuleContext = std::ptr::null_mut();
+
+        unsafe {
+            let ptr = libc::malloc(bytes.as_ref().len());
+            let dst = ::core::slice::from_raw_parts_mut(
+                ptr.cast::<std::mem::MaybeUninit<u8>>(),
+                bytes.as_ref().len(),
+            );
+            let src = ::core::slice::from_raw_parts(
+                bytes.as_ref().as_ptr().cast::<std::mem::MaybeUninit<u8>>(),
+                bytes.as_ref().len(),
+            );
+            dst.copy_from_slice(src);
+
+            check(ffi::WasmEdge_LoaderParseFromBuffer(
+                self.inner.0,
+                &mut mod_ctx,
+                ptr as *const u8,
+                bytes.as_ref().len() as u32,
+            ))?;
+
+            libc::free(ptr);
+        }
+
+        match mod_ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::ModuleCreate)),
+            false => Ok(Module {
+                inner: Arc::new(InnerModule(mod_ctx)),
+            }),
+        }
+    }
+
+    /// Provides a raw pointer to the inner Loader context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_LoaderContext {
+        self.inner.0 as *const _
+    }
+}
+impl Drop for Loader {
+    fn drop(&mut self) {
+        if !self.registered && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_LoaderDelete(self.inner.0) }
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerLoader(pub(crate) *mut ffi::WasmEdge_LoaderContext);
+unsafe impl Send for InnerLoader {}
+unsafe impl Sync for InnerLoader {}
+
+#[cfg(test)]
+mod tests {
+    use super::Loader;
+    use crate::Config;
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_types::error::{CoreError, CoreLoadError, WasmEdgeError};
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_loader() {
+        // create a Loader instance without configuration
+        let result = Loader::create(None);
+        assert!(result.is_ok());
+
+        // create a Loader instance with configuration
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.reference_types(true);
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+
+        // load from file
+        {
+            // load .wasm file
+            let path = std::env::current_dir()
+                .unwrap()
+                .ancestors()
+                .nth(2)
+                .unwrap()
+                .join("examples/wasmedge-sys/data/fibonacci.wat");
+            let result = loader.from_file(path);
+            assert!(result.is_ok());
+            let module = result.unwrap();
+            assert!(!module.inner.0.is_null());
+
+            let path = std::env::current_dir()
+                .unwrap()
+                .ancestors()
+                .nth(2)
+                .unwrap()
+                .join("examples/wasmedge-sys/data/fibonacci.wat");
+            let result = loader.from_file(path);
+            assert!(result.is_ok());
+
+            let result = loader.from_file("not_exist_file.wasm");
+            assert!(result.is_err());
+            assert_eq!(
+                result.unwrap_err(),
+                Box::new(WasmEdgeError::Core(CoreError::Load(
+                    CoreLoadError::IllegalPath
+                )))
+            );
+        }
+
+        // load from buffer
+        {
+            let buffer = b"\0asm\x01\0\0\0";
+            let result = loader.from_bytes(buffer);
+            assert!(result.is_ok());
+            let module = result.unwrap();
+            assert!(!module.inner.0.is_null());
+
+            // the text format is not accepted
+            let result = loader.from_bytes(b"(module)");
+            assert!(result.is_err());
+            assert_eq!(
+                result.unwrap_err(),
+                Box::new(WasmEdgeError::Core(CoreError::Load(
+                    CoreLoadError::MalformedMagic
+                )))
+            );
+
+            // empty is not accepted
+            let result = loader.from_bytes([]);
+            assert!(result.is_err());
+            assert_eq!(
+                result.unwrap_err(),
+                Box::new(WasmEdgeError::Core(CoreError::Load(
+                    CoreLoadError::UnexpectedEnd
+                )))
+            );
+        }
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_loader_send() {
+        // create a Loader instance without configuration
+        let result = Loader::create(None);
+        assert!(result.is_ok());
+
+        // create a Loader instance with configuration
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.reference_types(true);
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            assert!(!loader.inner.0.is_null());
+            println!("{:?}", loader.inner);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_loader_sync() {
+        // create a Loader instance without configuration
+        let result = Loader::create(None);
+        assert!(result.is_ok());
+
+        // create a Loader instance with configuration
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.reference_types(true);
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = Arc::new(Mutex::new(result.unwrap()));
+
+        let loader_cloned = Arc::clone(&loader);
+        let handle = thread::spawn(move || {
+            let result = loader_cloned.lock();
+            assert!(result.is_ok());
+            let loader = result.unwrap();
+
+            assert!(!loader.inner.0.is_null());
+        });
+
+        handle.join().unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/plugin.rs.html b/src/wasmedge_sys/plugin.rs.html new file mode 100644 index 000000000..256fb436a --- /dev/null +++ b/src/wasmedge_sys/plugin.rs.html @@ -0,0 +1,1719 @@ +plugin.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+
//! Defines PluginManager and Plugin structs.
+
+use super::ffi;
+use crate::{
+    instance::{module::InnerInstance, Function, Global, Memory, Table},
+    types::WasmEdgeString,
+    utils, AsImport, Instance, WasmEdgeResult,
+};
+use parking_lot::Mutex;
+use std::{
+    ffi::{c_void, CString},
+    sync::Arc,
+};
+use wasmedge_types::error::{InstanceError, PluginError, WasmEdgeError};
+
+/// Defines the APIs for loading plugins and check the basic information of the loaded plugins.
+#[derive(Debug)]
+pub struct PluginManager {}
+impl PluginManager {
+    /// Load plugins from the default path. The default plugin path could be one of the following:
+    ///
+    /// * The environment variable "WASMEDGE_PLUGIN_PATH".
+    ///   
+    /// * The `../plugin/` directory related to the WasmEdge installation path.
+    ///
+    /// * The `wasmedge/` directory under the library path if the WasmEdge is installed under the "/usr".
+    pub fn load_plugins_from_default_paths() {
+        unsafe { ffi::WasmEdge_PluginLoadWithDefaultPaths() }
+    }
+
+    /// Load a single or multiple plugins from a given path.
+    ///
+    /// * If the path is pointing at a file , then it indicates that a single plugin will be loaded from the file.
+    ///
+    /// * If the path is pointing at a directory, then the method will load plugins from the files in the directory.
+    ///
+    /// # Argument
+    ///
+    /// * `param` - A path to a plugin file or a directory holding plugin files.
+    ///
+    /// # Error
+    ///
+    /// * If the path contains invalid characters, then an [WasmEdgeError::FoundNulByte](wasmedge_types::error::WasmEdgeError::FoundNulByte) error is returned.
+    pub fn load_plugins(path: impl AsRef<std::path::Path>) -> WasmEdgeResult<()> {
+        let c_path = utils::path_to_cstring(path.as_ref())?;
+        unsafe { ffi::WasmEdge_PluginLoadFromPath(c_path.as_ptr()) }
+
+        Ok(())
+    }
+
+    #[cfg(feature = "wasi_nn")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "wasi_nn")))]
+    pub fn nn_preload(preloads: Vec<&str>) {
+        let c_args: Vec<CString> = preloads
+            .iter()
+            .map(|&x| std::ffi::CString::new(x).unwrap())
+            .collect();
+        let c_strs: Vec<*const i8> = c_args.iter().map(|x| x.as_ptr()).collect();
+        let len = c_strs.len() as u32;
+        unsafe { ffi::WasmEdge_PluginInitWASINN(c_strs.as_ptr(), len) }
+    }
+
+    /// Returns the count of loaded plugins.
+    pub fn count() -> u32 {
+        unsafe { ffi::WasmEdge_PluginListPluginsLength() }
+    }
+
+    /// Returns the names of all loaded plugins.
+    pub fn names() -> Vec<String> {
+        let count = Self::count();
+        let mut names = Vec::with_capacity(count as usize);
+
+        unsafe {
+            ffi::WasmEdge_PluginListPlugins(names.as_mut_ptr(), count);
+            names.set_len(count as usize);
+        };
+
+        names.into_iter().map(|x| x.into()).collect::<Vec<String>>()
+    }
+
+    /// Returns the target plugin by its name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target plugin.
+    ///
+    /// # Error
+    ///
+    /// If not found the plugin, then return [PluginError::NotFound](wasmedge_types::error::PluginError::NotFound) error.
+    pub fn find(name: impl AsRef<str>) -> WasmEdgeResult<Plugin> {
+        let plugin_name: WasmEdgeString = name.as_ref().into();
+
+        let ctx = unsafe { ffi::WasmEdge_PluginFind(plugin_name.as_raw()) };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Plugin(PluginError::NotFound(
+                name.as_ref().into(),
+            )))),
+            false => Ok(Plugin {
+                inner: InnerPlugin(ctx as *mut _),
+            }),
+        }
+    }
+
+    /// Initializes the `wasmedge_process` plugin module instance with the parameters.
+    ///
+    /// # Arguments
+    ///
+    /// * `allowed_cmds` - A white list of commands.
+    ///
+    /// * `allowed` - Determines if wasmedge_process is allowed to execute all commands on the white list.
+    #[cfg(all(
+        target_os = "linux",
+        feature = "wasmedge_process",
+        not(feature = "static")
+    ))]
+    #[cfg_attr(
+        docsrs,
+        doc(cfg(all(
+            target_os = "linux",
+            feature = "wasmedge_process",
+            not(feature = "static")
+        )))
+    )]
+    pub fn init_wasmedge_process(allowed_cmds: Option<Vec<&str>>, allowed: bool) {
+        // parse cmds
+        let cstr_cmds: Vec<_> = match allowed_cmds {
+            Some(cmds) => cmds
+                .iter()
+                .map(|&x| std::ffi::CString::new(x).unwrap())
+                .collect(),
+            None => vec![],
+        };
+        let mut p_cmds: Vec<_> = cstr_cmds.iter().map(|x| x.as_ptr()).collect();
+        let p_cmds_len = p_cmds.len();
+        p_cmds.push(std::ptr::null());
+
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceInitWasmEdgeProcess(
+                p_cmds.as_ptr(),
+                p_cmds_len as u32,
+                allowed,
+            )
+        }
+    }
+}
+
+/// Represents a loaded plugin. It provides the APIs for accessing the plugin.
+#[derive(Debug)]
+pub struct Plugin {
+    pub(crate) inner: InnerPlugin,
+}
+impl Plugin {
+    /// Returns the name of this plugin.
+    pub fn name(&self) -> String {
+        let name = unsafe { ffi::WasmEdge_PluginGetPluginName(self.inner.0) };
+        name.into()
+    }
+
+    /// Returns the count of the module instances in this plugin.
+    pub fn mod_count(&self) -> u32 {
+        unsafe { ffi::WasmEdge_PluginListModuleLength(self.inner.0) }
+    }
+
+    /// Returns the names of all module instances in this plugin.
+    pub fn mod_names(&self) -> Vec<String> {
+        let count = self.mod_count();
+        let mut names = Vec::with_capacity(count as usize);
+
+        unsafe {
+            ffi::WasmEdge_PluginListModule(self.inner.0, names.as_mut_ptr(), count);
+            names.set_len(count as usize);
+        }
+
+        names.into_iter().map(|x| x.into()).collect::<Vec<String>>()
+    }
+
+    /// Returns a plugin module instance that is generated from the module with the given name in this plugin.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the target module.
+    ///
+    /// # Error
+    ///
+    /// If failed to return the plugin module instance, then return [PluginError::Create](wasmedge_types::error::PluginError::Create) error.
+    pub fn mod_instance(&self, name: impl AsRef<str>) -> WasmEdgeResult<Instance> {
+        let mod_name: WasmEdgeString = name.as_ref().into();
+
+        let ctx = unsafe { ffi::WasmEdge_PluginCreateModule(self.inner.0, mod_name.as_raw()) };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Plugin(PluginError::Create(
+                name.as_ref().into(),
+            )))),
+            false => Ok(Instance {
+                inner: Arc::new(Mutex::new(InnerInstance(ctx))),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Provides a raw pointer to the inner Plugin context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_PluginContext {
+        self.inner.0 as *const _
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerPlugin(pub(crate) *mut ffi::WasmEdge_PluginContext);
+unsafe impl Send for InnerPlugin {}
+unsafe impl Sync for InnerPlugin {}
+
+/// Defines the type of the program options.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum ProgramOptionType {
+    None = 0,
+    Toggle = 1,
+    I8 = 2,
+    I16 = 3,
+    I32 = 4,
+    I64 = 5,
+    U8 = 6,
+    U16 = 7,
+    U32 = 8,
+    U64 = 9,
+    F32 = 10,
+    F64 = 11,
+    String = 12,
+}
+impl From<ffi::WasmEdge_ProgramOptionType> for ProgramOptionType {
+    fn from(ty: ffi::WasmEdge_ProgramOptionType) -> Self {
+        match ty {
+            ffi::WasmEdge_ProgramOptionType_None => ProgramOptionType::None,
+            ffi::WasmEdge_ProgramOptionType_Toggle => ProgramOptionType::Toggle,
+            ffi::WasmEdge_ProgramOptionType_Int8 => ProgramOptionType::I8,
+            ffi::WasmEdge_ProgramOptionType_Int16 => ProgramOptionType::I16,
+            ffi::WasmEdge_ProgramOptionType_Int32 => ProgramOptionType::I32,
+            ffi::WasmEdge_ProgramOptionType_Int64 => ProgramOptionType::I64,
+            ffi::WasmEdge_ProgramOptionType_UInt8 => ProgramOptionType::U8,
+            ffi::WasmEdge_ProgramOptionType_UInt16 => ProgramOptionType::U16,
+            ffi::WasmEdge_ProgramOptionType_UInt32 => ProgramOptionType::U32,
+            ffi::WasmEdge_ProgramOptionType_UInt64 => ProgramOptionType::U64,
+            ffi::WasmEdge_ProgramOptionType_Float => ProgramOptionType::F32,
+            ffi::WasmEdge_ProgramOptionType_Double => ProgramOptionType::F64,
+            ffi::WasmEdge_ProgramOptionType_String => ProgramOptionType::String,
+            _ => {
+                panic!("[wasmedge-sys] Unsupported ffi::WasmEdge_ProgramOptionType value: {ty}");
+            }
+        }
+    }
+}
+impl From<ProgramOptionType> for ffi::WasmEdge_ProgramOptionType {
+    fn from(value: ProgramOptionType) -> Self {
+        match value {
+            ProgramOptionType::None => ffi::WasmEdge_ProgramOptionType_None,
+            ProgramOptionType::Toggle => ffi::WasmEdge_ProgramOptionType_Toggle,
+            ProgramOptionType::I8 => ffi::WasmEdge_ProgramOptionType_Int8,
+            ProgramOptionType::I16 => ffi::WasmEdge_ProgramOptionType_Int16,
+            ProgramOptionType::I32 => ffi::WasmEdge_ProgramOptionType_Int32,
+            ProgramOptionType::I64 => ffi::WasmEdge_ProgramOptionType_Int64,
+            ProgramOptionType::U8 => ffi::WasmEdge_ProgramOptionType_UInt8,
+            ProgramOptionType::U16 => ffi::WasmEdge_ProgramOptionType_UInt16,
+            ProgramOptionType::U32 => ffi::WasmEdge_ProgramOptionType_UInt32,
+            ProgramOptionType::U64 => ffi::WasmEdge_ProgramOptionType_UInt64,
+            ProgramOptionType::F32 => ffi::WasmEdge_ProgramOptionType_Float,
+            ProgramOptionType::F64 => ffi::WasmEdge_ProgramOptionType_Double,
+            ProgramOptionType::String => ffi::WasmEdge_ProgramOptionType_String,
+        }
+    }
+}
+
+/// Defines the program option for plugins.
+#[derive(Debug)]
+pub struct ProgramOption {
+    name: CString,
+    desc: CString,
+    pub inner: ffi::WasmEdge_ProgramOption,
+}
+impl ProgramOption {
+    /// Creates a new program option.
+    pub fn create(
+        name: impl AsRef<str>,
+        desc: impl AsRef<str>,
+        ty: ProgramOptionType,
+    ) -> WasmEdgeResult<Self> {
+        let name = std::ffi::CString::new(name.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        let desc = std::ffi::CString::new(desc.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        let mut po = Self {
+            name,
+            desc,
+            inner: ffi::WasmEdge_ProgramOption {
+                Name: std::ptr::null(),
+                Description: std::ptr::null(),
+                Type: ty.into(),
+                Storage: std::ptr::null_mut(),
+                DefaultValue: std::ptr::null(),
+            },
+        };
+        po.inner.Name = po.name.as_ptr();
+        po.inner.Description = po.desc.as_ptr();
+
+        Ok(po)
+    }
+}
+unsafe impl Send for ProgramOption {}
+unsafe impl Sync for ProgramOption {}
+
+/// Defines the module descriptor for plugins.
+#[derive(Debug)]
+pub struct ModuleDescriptor {
+    name: CString,
+    desc: CString,
+    create: Option<ModuleInstanceCreateFn>,
+    inner: ffi::WasmEdge_ModuleDescriptor,
+}
+impl ModuleDescriptor {
+    /// Creates a new module descriptor.
+    pub fn create(
+        name: impl AsRef<str>,
+        desc: impl AsRef<str>,
+        f: Option<ModuleInstanceCreateFn>,
+    ) -> WasmEdgeResult<Self> {
+        // module name
+        let name = std::ffi::CString::new(name.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        // module description
+        let desc = std::ffi::CString::new(desc.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        let mut md = Self {
+            name,
+            desc,
+            create: f,
+            inner: ffi::WasmEdge_ModuleDescriptor {
+                Name: std::ptr::null(),
+                Description: std::ptr::null(),
+                Create: None,
+            },
+        };
+        md.inner.Name = md.name.as_ptr();
+        md.inner.Description = md.desc.as_ptr();
+        md.inner.Create = md.create;
+
+        Ok(md)
+    }
+
+    /// Returns the raw pointer to the inner `WasmEdge_ModuleDescriptor`.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_raw_ptr(&self) -> *const ffi::WasmEdge_ModuleDescriptor {
+        &self.inner
+    }
+}
+
+/// Defines the type of the function that creates a module instance for a plugin.
+pub type ModuleInstanceCreateFn = unsafe extern "C" fn(
+    arg1: *const ffi::WasmEdge_ModuleDescriptor,
+) -> *mut ffi::WasmEdge_ModuleInstanceContext;
+
+/// Defines the version of a plugin.
+#[derive(Debug)]
+pub struct PluginVersion {
+    pub major: u32,
+    pub minor: u32,
+    pub patch: u32,
+    pub build: u32,
+}
+impl PluginVersion {
+    /// Creates a new plugin version.
+    pub fn create(major: u32, minor: u32, patch: u32, build: u32) -> Self {
+        Self {
+            major,
+            minor,
+            patch,
+            build,
+        }
+    }
+}
+impl From<PluginVersion> for ffi::WasmEdge_PluginVersionData {
+    fn from(value: PluginVersion) -> Self {
+        Self {
+            Major: value.major,
+            Minor: value.minor,
+            Patch: value.patch,
+            Build: value.build,
+        }
+    }
+}
+
+/// Represents Plugin descriptor for plugins.
+#[derive(Debug)]
+pub struct PluginDescriptor {
+    name: CString,
+    desc: CString,
+    module_descriptors_name_desc: Vec<(CString, CString)>,
+    module_descriptors: Vec<ffi::WasmEdge_ModuleDescriptor>,
+    program_options_name_desc: Vec<(CString, CString)>,
+    program_options: Vec<ffi::WasmEdge_ProgramOption>,
+    inner: ffi::WasmEdge_PluginDescriptor,
+}
+impl PluginDescriptor {
+    pub fn create(
+        name: impl AsRef<str>,
+        desc: impl AsRef<str>,
+        version: PluginVersion,
+    ) -> WasmEdgeResult<Self> {
+        // plugin name
+        let name = std::ffi::CString::new(name.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        // plugin description
+        let desc = std::ffi::CString::new(desc.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        let mut pd = Self {
+            name,
+            desc,
+            module_descriptors_name_desc: Vec::new(),
+            module_descriptors: Vec::new(),
+            program_options_name_desc: Vec::new(),
+            program_options: Vec::new(),
+            inner: ffi::WasmEdge_PluginDescriptor {
+                Name: std::ptr::null(),
+                Description: std::ptr::null(),
+                APIVersion: ffi::WasmEdge_Plugin_CurrentAPIVersion,
+                Version: version.into(),
+                ModuleCount: 0,
+                ModuleDescriptions: std::ptr::null_mut(),
+                ProgramOptionCount: 0,
+                ProgramOptions: std::ptr::null_mut(),
+            },
+        };
+        pd.inner.Name = pd.name.as_ptr();
+        pd.inner.Description = pd.desc.as_ptr();
+
+        Ok(pd)
+    }
+
+    pub fn add_module_descriptor(
+        mut self,
+        name: impl AsRef<str>,
+        desc: impl AsRef<str>,
+        f: Option<ModuleInstanceCreateFn>,
+    ) -> WasmEdgeResult<Self> {
+        // module name
+        let name = std::ffi::CString::new(name.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        // module description
+        let desc = std::ffi::CString::new(desc.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        self.module_descriptors
+            .push(ffi::WasmEdge_ModuleDescriptor {
+                Name: name.as_ptr(),
+                Description: desc.as_ptr(),
+                Create: f,
+            });
+        self.module_descriptors_name_desc.push((name, desc));
+
+        self.inner.ModuleCount = self.module_descriptors.len() as u32;
+        self.inner.ModuleDescriptions = self.module_descriptors.as_mut_ptr();
+
+        Ok(self)
+    }
+
+    pub fn add_program_option(
+        mut self,
+        name: impl AsRef<str>,
+        desc: impl AsRef<str>,
+        ty: ProgramOptionType,
+    ) -> WasmEdgeResult<Self> {
+        let name = std::ffi::CString::new(name.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        let desc = std::ffi::CString::new(desc.as_ref()).map_err(WasmEdgeError::FoundNulByte)?;
+
+        self.program_options.push(ffi::WasmEdge_ProgramOption {
+            Name: name.as_ptr(),
+            Description: desc.as_ptr(),
+            Type: ty.into(),
+            Storage: std::ptr::null_mut(),
+            DefaultValue: std::ptr::null(),
+        });
+        self.program_options_name_desc.push((name, desc));
+
+        self.inner.ProgramOptionCount = self.program_options.len() as u32;
+        self.inner.ProgramOptions = self.program_options.as_mut_ptr();
+
+        Ok(self)
+    }
+
+    /// Returns the raw pointer to the inner `WasmEdge_PluginDescriptor`.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_raw_ptr(&self) -> *const ffi::WasmEdge_PluginDescriptor {
+        &self.inner
+    }
+}
+
+/// Represents a Plugin module instance.
+#[derive(Debug, Clone)]
+pub struct PluginModule {
+    pub(crate) inner: Arc<InnerInstance>,
+    pub(crate) registered: bool,
+    name: String,
+    funcs: Vec<Function>,
+}
+impl Drop for PluginModule {
+    fn drop(&mut self) {
+        if !self.registered && Arc::strong_count(&self.inner) == 1 && !self.inner.0.is_null() {
+            unsafe {
+                ffi::WasmEdge_ModuleInstanceDelete(self.inner.0);
+            }
+
+            // drop the registered host functions
+            self.funcs.drain(..);
+        }
+    }
+}
+impl PluginModule {
+    /// Creates a module instance which is used to import host functions, tables, memories, and globals into a wasm module.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the import module instance.
+    ///
+    /// * `host_data` - The host context data to be used in the module instance.
+    ///
+    /// * `finalizer` - the function to drop the host data. This argument is only available when `host_data` is set.
+    ///
+    /// # Error
+    ///
+    /// If fail to create the import module instance, then an error is returned.
+    pub fn create<T>(name: impl AsRef<str>, host_data: Option<Box<T>>) -> WasmEdgeResult<Self>
+    where
+        T: ?Sized + Send + Sync + Clone,
+    {
+        let raw_name = WasmEdgeString::from(name.as_ref());
+
+        let ctx = match host_data {
+            Some(data) => unsafe {
+                ffi::WasmEdge_ModuleInstanceCreateWithData(
+                    raw_name.as_raw(),
+                    Box::into_raw(data) as *mut c_void,
+                    Some(host_data_finalizer::<T>),
+                )
+            },
+            None => unsafe { ffi::WasmEdge_ModuleInstanceCreate(raw_name.as_raw()) },
+        };
+
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Instance(
+                InstanceError::CreateImportModule,
+            ))),
+            false => Ok(Self {
+                inner: std::sync::Arc::new(InnerInstance(ctx)),
+                registered: false,
+                name: name.as_ref().to_string(),
+                funcs: Vec::new(),
+            }),
+        }
+    }
+
+    /// Provides a raw pointer to the inner module instance context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_raw_ptr(&self) -> *const ffi::WasmEdge_ModuleInstanceContext {
+        self.inner.0 as *const _
+    }
+}
+impl AsImport for PluginModule {
+    fn name(&self) -> &str {
+        self.name.as_str()
+    }
+
+    fn add_func(&mut self, name: impl AsRef<str>, func: Function) {
+        self.funcs.push(func);
+        let f = self.funcs.last_mut().unwrap();
+
+        let func_name: WasmEdgeString = name.into();
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceAddFunction(
+                self.inner.0,
+                func_name.as_raw(),
+                f.inner.lock().0,
+            );
+        }
+    }
+
+    fn add_table(&mut self, name: impl AsRef<str>, table: Table) {
+        let table_name: WasmEdgeString = name.as_ref().into();
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceAddTable(
+                self.inner.0,
+                table_name.as_raw(),
+                table.inner.lock().0,
+            );
+        }
+        table.inner.lock().0 = std::ptr::null_mut();
+    }
+
+    fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory) {
+        let mem_name: WasmEdgeString = name.as_ref().into();
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceAddMemory(
+                self.inner.0,
+                mem_name.as_raw(),
+                memory.inner.lock().0,
+            );
+        }
+        memory.inner.lock().0 = std::ptr::null_mut();
+    }
+
+    fn add_global(&mut self, name: impl AsRef<str>, global: Global) {
+        let global_name: WasmEdgeString = name.as_ref().into();
+        unsafe {
+            ffi::WasmEdge_ModuleInstanceAddGlobal(
+                self.inner.0,
+                global_name.as_raw(),
+                global.inner.lock().0,
+            );
+        }
+        global.inner.lock().0 = std::ptr::null_mut();
+    }
+}
+
+pub(crate) unsafe extern "C" fn host_data_finalizer<T: Sized + Send>(
+    raw: *mut ::std::os::raw::c_void,
+) {
+    let host_data: Box<T> = Box::from_raw(raw as *mut T);
+    drop(host_data);
+}
+
+#[cfg(test)]
+mod tests {
+
+    #[cfg(all(
+        target_os = "linux",
+        feature = "wasmedge_process",
+        not(feature = "static")
+    ))]
+    #[test]
+    #[ignore]
+    fn test_plugin_wasmedge_process() {
+        use super::*;
+
+        PluginManager::load_plugins_from_default_paths();
+        assert!(PluginManager::count() >= 1);
+        assert!(PluginManager::names()
+            .iter()
+            .any(|x| x == "wasmedge_process"));
+
+        // get `wasmedge_process` plugin
+        let result = PluginManager::find("wasmedge_process");
+        assert!(result.is_ok());
+        let plugin = result.unwrap();
+        assert_eq!(plugin.name(), "wasmedge_process");
+        assert_eq!(plugin.mod_count(), 1);
+        assert!(plugin.mod_names().iter().any(|x| x == "wasmedge_process"));
+
+        // get module instance from plugin
+        let result = plugin.mod_instance("wasmedge_process");
+        assert!(result.is_ok());
+        let instance = result.unwrap();
+
+        assert_eq!(instance.name().unwrap(), "wasmedge_process");
+        assert_eq!(instance.func_len(), 11);
+        assert_eq!(
+            instance.func_names().unwrap(),
+            [
+                "wasmedge_process_add_arg",
+                "wasmedge_process_add_env",
+                "wasmedge_process_add_stdin",
+                "wasmedge_process_get_exit_code",
+                "wasmedge_process_get_stderr",
+                "wasmedge_process_get_stderr_len",
+                "wasmedge_process_get_stdout",
+                "wasmedge_process_get_stdout_len",
+                "wasmedge_process_run",
+                "wasmedge_process_set_prog_name",
+                "wasmedge_process_set_timeout",
+            ]
+        );
+        assert_eq!(instance.mem_len(), 0);
+        assert_eq!(instance.table_len(), 0);
+        assert_eq!(instance.global_len(), 0);
+    }
+
+    #[cfg(all(target_os = "linux", feature = "wasi_crypto", not(feature = "static")))]
+    #[test]
+    fn test_plugin_wasi_crypto() {
+        use super::*;
+
+        PluginManager::load_plugins_from_default_paths();
+        assert!(PluginManager::count() >= 1);
+        assert!(
+            PluginManager::names().iter().any(|x| x == "wasi_crypto"),
+            "Not found the `wasi_crypto` plugin"
+        );
+
+        // get `wasmedge_process` plugin
+        let result = PluginManager::find("wasi_crypto");
+        assert!(result.is_some());
+        let plugin = result.unwrap();
+        assert_eq!(plugin.name(), "wasi_crypto");
+        assert_eq!(plugin.mod_count(), 5);
+        assert_eq!(
+            plugin.mod_names(),
+            [
+                "wasi_crypto_asymmetric_common",
+                "wasi_crypto_common",
+                "wasi_crypto_kx",
+                "wasi_crypto_signatures",
+                "wasi_crypto_symmetric",
+            ]
+        );
+
+        // get `wasi_crypto_asymmetric_common` module instance from plugin
+        {
+            let result = plugin.mod_instance("wasi_crypto_asymmetric_common");
+            assert!(result.is_some());
+            let instance = result.unwrap();
+            assert_eq!(
+                instance.name().unwrap(),
+                "wasi_ephemeral_crypto_asymmetric_common"
+            );
+            assert_eq!(instance.func_len(), 20);
+            assert_eq!(
+                instance.func_names().unwrap(),
+                [
+                    "keypair_close",
+                    "keypair_export",
+                    "keypair_from_id",
+                    "keypair_from_pk_and_sk",
+                    "keypair_generate",
+                    "keypair_generate_managed",
+                    "keypair_id",
+                    "keypair_import",
+                    "keypair_publickey",
+                    "keypair_replace_managed",
+                    "keypair_secretkey",
+                    "keypair_store_managed",
+                    "publickey_close",
+                    "publickey_export",
+                    "publickey_from_secretkey",
+                    "publickey_import",
+                    "publickey_verify",
+                    "secretkey_close",
+                    "secretkey_export",
+                    "secretkey_import",
+                ],
+            );
+        }
+
+        // get `wasi_crypto_common` module instance from plugin
+        {
+            let result = plugin.mod_instance("wasi_crypto_common");
+            assert!(result.is_some());
+            let instance = result.unwrap();
+            assert_eq!(instance.name().unwrap(), "wasi_ephemeral_crypto_common");
+            assert_eq!(instance.func_len(), 10);
+            assert_eq!(
+                instance.func_names().unwrap(),
+                [
+                    "array_output_len",
+                    "array_output_pull",
+                    "options_close",
+                    "options_open",
+                    "options_set",
+                    "options_set_guest_buffer",
+                    "options_set_u64",
+                    "secrets_manager_close",
+                    "secrets_manager_invalidate",
+                    "secrets_manager_open",
+                ],
+            );
+        }
+
+        // get `wasi_crypto_kx` module instance from plugin
+        {
+            let result = plugin.mod_instance("wasi_crypto_kx");
+            assert!(result.is_some());
+            let instance = result.unwrap();
+            assert_eq!(instance.name().unwrap(), "wasi_ephemeral_crypto_kx");
+            assert_eq!(instance.func_len(), 3);
+            assert_eq!(
+                instance.func_names().unwrap(),
+                ["kx_decapsulate", "kx_dh", "kx_encapsulate",],
+            );
+        }
+
+        // get `wasi_crypto_signatures` module instance from plugin
+        {
+            let result = plugin.mod_instance("wasi_crypto_signatures");
+            assert!(result.is_some());
+            let instance = result.unwrap();
+            assert_eq!(instance.name().unwrap(), "wasi_ephemeral_crypto_signatures");
+            assert_eq!(instance.func_len(), 11);
+            assert_eq!(
+                instance.func_names().unwrap(),
+                [
+                    "signature_close",
+                    "signature_export",
+                    "signature_import",
+                    "signature_state_close",
+                    "signature_state_open",
+                    "signature_state_sign",
+                    "signature_state_update",
+                    "signature_verification_state_close",
+                    "signature_verification_state_open",
+                    "signature_verification_state_update",
+                    "signature_verification_state_verify",
+                ],
+            );
+        }
+
+        // get `wasi_crypto_symmetric` module instance from plugin
+        {
+            let result = plugin.mod_instance("wasi_crypto_symmetric");
+            assert!(result.is_some());
+            let instance = result.unwrap();
+            assert_eq!(instance.name().unwrap(), "wasi_ephemeral_crypto_symmetric");
+            assert_eq!(instance.func_len(), 28);
+            assert_eq!(
+                instance.func_names().unwrap(),
+                [
+                    "symmetric_key_close",
+                    "symmetric_key_export",
+                    "symmetric_key_from_id",
+                    "symmetric_key_generate",
+                    "symmetric_key_generate_managed",
+                    "symmetric_key_id",
+                    "symmetric_key_import",
+                    "symmetric_key_replace_managed",
+                    "symmetric_key_store_managed",
+                    "symmetric_state_absorb",
+                    "symmetric_state_clone",
+                    "symmetric_state_close",
+                    "symmetric_state_decrypt",
+                    "symmetric_state_decrypt_detached",
+                    "symmetric_state_encrypt",
+                    "symmetric_state_encrypt_detached",
+                    "symmetric_state_max_tag_len",
+                    "symmetric_state_open",
+                    "symmetric_state_options_get",
+                    "symmetric_state_options_get_u64",
+                    "symmetric_state_ratchet",
+                    "symmetric_state_squeeze",
+                    "symmetric_state_squeeze_key",
+                    "symmetric_state_squeeze_tag",
+                    "symmetric_tag_close",
+                    "symmetric_tag_len",
+                    "symmetric_tag_pull",
+                    "symmetric_tag_verify",
+                ],
+            );
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/statistics.rs.html b/src/wasmedge_sys/statistics.rs.html new file mode 100644 index 000000000..bd240f4cc --- /dev/null +++ b/src/wasmedge_sys/statistics.rs.html @@ -0,0 +1,1265 @@ +statistics.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+
//! Defines WasmEdge Statistics struct.
+
+use crate::{ffi, WasmEdgeResult};
+use std::sync::Arc;
+use wasmedge_types::error::WasmEdgeError;
+
+#[derive(Debug, Clone)]
+/// Struct of WasmEdge Statistics.
+pub struct Statistics {
+    pub(crate) inner: Arc<InnerStat>,
+}
+impl Statistics {
+    /// Creates a new [Statistics].
+    ///
+    /// # Error
+    ///
+    /// If fail to create a [Statistics], then an error is returned.
+    pub fn create() -> WasmEdgeResult<Self> {
+        let ctx = unsafe { ffi::WasmEdge_StatisticsCreate() };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::StatisticsCreate)),
+            false => Ok(Statistics {
+                inner: Arc::new(InnerStat(ctx)),
+            }),
+        }
+    }
+
+    /// Returns the instruction count in execution.
+    pub fn instr_count(&self) -> u64 {
+        unsafe { ffi::WasmEdge_StatisticsGetInstrCount(self.inner.0) }
+    }
+
+    /// Returns the instruction count per second in execution.
+    ///
+    /// # Notice
+    ///
+    /// For the following cases,
+    /// * [Statistics] is not enabled, or
+    /// * the total execution time is 0
+    ///
+    /// The instructions per second could be `NaN`, which represents `divided-by-zero`.
+    /// Use the `is_nan` function of F64 to check the return value before use it,
+    /// for example,
+    ///
+    /// ```
+    /// use wasmedge_sys::Statistics;
+    ///
+    /// // create a Statistics instance
+    /// let stat = Statistics::create().expect("fail to create a Statistics");
+    ///
+    /// // check instruction count per second
+    /// assert!(stat.instr_per_sec().is_nan());
+    /// ```
+    pub fn instr_per_sec(&self) -> f64 {
+        unsafe { ffi::WasmEdge_StatisticsGetInstrPerSecond(self.inner.0) }
+    }
+
+    /// Returns the total cost in execution.
+    pub fn cost_in_total(&self) -> u64 {
+        unsafe { ffi::WasmEdge_StatisticsGetTotalCost(self.inner.0) }
+    }
+
+    /// Sets the cost of instructions.
+    ///
+    /// # Arguments
+    ///
+    /// * `cost_table` - The slice of cost table.
+    pub fn set_cost_table(&mut self, cost_table: impl AsRef<[u64]>) {
+        unsafe {
+            ffi::WasmEdge_StatisticsSetCostTable(
+                self.inner.0,
+                cost_table.as_ref().as_ptr() as *mut _,
+                cost_table.as_ref().len() as u32,
+            )
+        }
+    }
+
+    /// Sets the cost limit in execution.
+    ///
+    /// # Arguments
+    ///
+    /// * `limit` - The cost limit.
+    pub fn set_cost_limit(&mut self, limit: u64) {
+        unsafe { ffi::WasmEdge_StatisticsSetCostLimit(self.inner.0, limit) }
+    }
+
+    /// Clears the data in this statistics.
+    pub fn clear(&mut self) {
+        unsafe { ffi::WasmEdge_StatisticsClear(self.inner.0) }
+    }
+
+    /// Provides a raw pointer to the inner Statistics context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_StatisticsContext {
+        self.inner.0 as *const _
+    }
+}
+impl Drop for Statistics {
+    fn drop(&mut self) {
+        if Arc::strong_count(&self.inner) == 1 && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_StatisticsDelete(self.inner.0) }
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerStat(pub(crate) *mut ffi::WasmEdge_StatisticsContext);
+unsafe impl Send for InnerStat {}
+unsafe impl Sync for InnerStat {}
+
+#[cfg(test)]
+mod tests {
+    use crate::{Config, Engine, Executor, Loader, Statistics, Store, Validator, WasmValue};
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_types::error::{
+        CoreError, CoreExecutionError, InstanceError, StoreError, WasmEdgeError,
+    };
+
+    #[test]
+    fn test_stat_send() {
+        let result = Statistics::create();
+        assert!(result.is_ok());
+        let stat = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            assert!(!stat.inner.0.is_null());
+            println!("{:?}", stat.inner);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    fn test_stat_sync() {
+        let result = Statistics::create();
+        assert!(result.is_ok());
+        let stat = Arc::new(Mutex::new(result.unwrap()));
+
+        let stat_cloned = Arc::clone(&stat);
+        let handle = thread::spawn(move || {
+            let result = stat_cloned.lock();
+            assert!(result.is_ok());
+            let stat = result.unwrap();
+
+            assert!(!stat.inner.0.is_null());
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[allow(unused_assignments)]
+    #[ignore = "need to update `test.wat`"]
+    #[test]
+    fn test_executor_with_statistics() {
+        // create a Config context
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        // enable Statistics
+        config.count_instructions(true);
+        config.measure_time(true);
+        config.measure_cost(true);
+
+        // create a Statistics context
+        let result = Statistics::create();
+        assert!(result.is_ok());
+        let mut stat = result.unwrap();
+        // set cost table
+        stat.set_cost_table([]);
+        let mut cost_table = vec![20u64; 512];
+        stat.set_cost_table(&mut cost_table);
+        // set cost limit
+        stat.set_cost_limit(100_000_000_000_000);
+
+        // create an Executor context
+        let result = Executor::create(Some(&config), Some(&mut stat));
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        // create an ImportObj module
+        let import = common::create_extern_module("extern");
+
+        // create a Store context
+        let result = Store::create();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+
+        // register the import_obj module into the store context
+        let result = executor.register_import_module(&mut store, &import);
+        assert!(result.is_ok());
+
+        // load module from a wasm file
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/test.wat");
+        let result = loader.from_file(path);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // validate module
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+        let result = Validator::create(Some(&config));
+        assert!(result.is_ok());
+        let validator = result.unwrap();
+        let result = validator.validate(&module);
+        assert!(result.is_ok());
+
+        // register a wasm module into the store context
+        let result = executor.register_named_module(&mut store, &module, "module");
+        assert!(result.is_ok());
+
+        // load module from a wasm file
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/test.wat");
+        let result = loader.from_file(path);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+
+        // validate module
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+        let result = Validator::create(Some(&config));
+        assert!(result.is_ok());
+        let validator = result.unwrap();
+        let result = validator.validate(&module);
+        assert!(result.is_ok());
+
+        // register a wasm module as an active module
+        let result = executor.register_active_module(&mut store, &module);
+        assert!(result.is_ok());
+        let active_instance = result.unwrap();
+
+        // get the exported functions from the active module
+        let result = active_instance.get_func("func-mul-2");
+        assert!(result.is_ok());
+        let func_mul_2 = result.unwrap();
+        let result = executor.run_func(
+            &func_mul_2,
+            [WasmValue::from_i32(123), WasmValue::from_i32(456)],
+        );
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        let returns = returns.iter().map(|x| x.to_i32()).collect::<Vec<_>>();
+        assert_eq!(returns, vec![246, 912]);
+
+        // function type mismatched
+        let result = executor.run_func(&func_mul_2, []);
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Core(CoreError::Execution(
+                CoreExecutionError::FuncTypeMismatch
+            )))
+        );
+
+        // function type mismatched
+        let result = executor.run_func(
+            &func_mul_2,
+            [WasmValue::from_i64(123), WasmValue::from_i32(456)],
+        );
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Core(CoreError::Execution(
+                CoreExecutionError::FuncTypeMismatch
+            )))
+        );
+
+        // try to get non-existent exported function
+        let result = active_instance.get_func("func-mul-3");
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Instance(InstanceError::NotFoundFunc(
+                "func-mul-3".into()
+            )))
+        );
+
+        // call host function by using external reference
+        let result = active_instance.get_table("tab-ext");
+        assert!(result.is_ok());
+        let mut table = result.unwrap();
+
+        let mut test_value = 0u32;
+        let test_value_ref = &mut test_value;
+
+        let data = WasmValue::from_extern_ref(test_value_ref);
+        let result = table.set_data(data, 0);
+        assert!(result.is_ok());
+        let result = table.set_data(data, 1);
+        assert!(result.is_ok());
+        let result = table.set_data(data, 2);
+        assert!(result.is_ok());
+        let result = table.set_data(data, 3);
+        assert!(result.is_ok());
+
+        // get the exported host function named "func-host-add"
+        let result = active_instance.get_func("func-host-add");
+        assert!(result.is_ok());
+        let func_host_add = result.unwrap();
+        // Call add: (777) + (223)
+        test_value = 777;
+        let result = executor.run_func(&func_host_add, [WasmValue::from_i32(223)]);
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns[0].to_i32(), 1000);
+
+        // get the exported host function named "func-host-add"
+        let result = active_instance.get_func("func-host-sub");
+        assert!(result.is_ok());
+        let func_host_sub = result.unwrap();
+        // Call sub: (123) - (456)
+        test_value = 123;
+        let result = executor.run_func(&func_host_sub, [WasmValue::from_i32(456)]);
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns[0].to_i32(), -333);
+
+        // get the exported host function named "func-host-add"
+        let result = active_instance.get_func("func-host-mul");
+        assert!(result.is_ok());
+        let func_host_mul = result.unwrap();
+        // Call mul: (-30) * (-66)
+        test_value = -30i32 as u32;
+        let result = executor.run_func(&func_host_mul, [WasmValue::from_i32(-66)]);
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns[0].to_i32(), 1980);
+
+        // get the exported host function named "func-host-add"
+        let result = active_instance.get_func("func-host-div");
+        assert!(result.is_ok());
+        let func_host_div = result.unwrap();
+        // Call div: (-9999) / (1234)
+        test_value = -9999i32 as u32;
+        let result = executor.run_func(&func_host_div, [WasmValue::from_i32(1234)]);
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns[0].to_i32(), -8);
+
+        // get the module instance named "extern"
+        let result = store.module("extern");
+        assert!(result.is_ok());
+        let extern_instance = result.unwrap();
+
+        // get the exported host function named "func-add"
+        let result = extern_instance.get_func("func-add");
+        assert!(result.is_ok());
+        let func_add = result.unwrap();
+        // Invoke the functions in the registered module
+        test_value = 5000;
+        let result = executor.run_func(
+            &func_add,
+            [
+                WasmValue::from_extern_ref(&mut test_value),
+                WasmValue::from_i32(1500),
+            ],
+        );
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns[0].to_i32(), 6500);
+        // Function type mismatch
+        let result = executor.run_func(&func_add, []);
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Core(CoreError::Execution(
+                CoreExecutionError::FuncTypeMismatch
+            )))
+        );
+        // Function type mismatch
+        let result = executor.run_func(
+            &func_add,
+            [
+                WasmValue::from_extern_ref(&mut test_value),
+                WasmValue::from_i64(1500),
+            ],
+        );
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Core(CoreError::Execution(
+                CoreExecutionError::FuncTypeMismatch
+            )))
+        );
+        // Module not found
+        let result = store.module("error-name");
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Store(StoreError::NotFoundModule(
+                "error-name".into()
+            )))
+        );
+        // Function not found
+        let result = extern_instance.get_func("func-add2");
+        assert!(result.is_err());
+        assert_eq!(
+            result.unwrap_err(),
+            Box::new(WasmEdgeError::Instance(InstanceError::NotFoundFunc(
+                "func-add2".into()
+            )))
+        );
+
+        // get the exported host function named "func-term"
+        let result = extern_instance.get_func("func-term");
+        assert!(result.is_ok());
+        let func_term = result.unwrap();
+        // Invoke host function to terminate execution
+        let result = executor.run_func(&func_term, []);
+        assert!(result.is_ok());
+        let returns = result.unwrap();
+        assert_eq!(returns[0].to_i32(), 1234);
+
+        // get the exported host function named "func-term"
+        let result = extern_instance.get_func("func-fail");
+        assert!(result.is_ok());
+        let func_fail = result.unwrap();
+        // Invoke host function to fail execution
+        let result = executor.run_func(&func_fail, []);
+        assert!(result.is_err());
+        assert_eq!(result.unwrap_err(), Box::new(WasmEdgeError::User(2)));
+    }
+
+    mod common {
+        use crate::{AsImport, CallingFrame, FuncType, Function, ImportModule, WasmValue};
+        use wasmedge_macro::sys_host_function;
+        use wasmedge_types::{error::HostFuncError, NeverType, ValType};
+
+        pub(crate) fn create_extern_module(name: impl AsRef<str>) -> ImportModule<NeverType> {
+            // create an import module
+            let result = ImportModule::<NeverType>::create(name, None);
+            assert!(result.is_ok());
+            let mut import = result.unwrap();
+
+            // add host function: "func-add"
+            let result =
+                FuncType::create(vec![ValType::ExternRef, ValType::I32], vec![ValType::I32]);
+            let func_ty = result.unwrap();
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(extern_add), None, 0);
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            import.add_func("func-add", host_func);
+
+            // add host function: "func-sub"
+            let result =
+                FuncType::create(vec![ValType::ExternRef, ValType::I32], vec![ValType::I32]);
+            let func_ty = result.unwrap();
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(extern_sub), None, 0);
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            import.add_func("func-sub", host_func);
+
+            // add host function: "func-mul"
+            let result =
+                FuncType::create(vec![ValType::ExternRef, ValType::I32], vec![ValType::I32]);
+            let func_ty = result.unwrap();
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(extern_mul), None, 0);
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            import.add_func("func-mul", host_func);
+
+            // add host function: "func-div"
+            let result =
+                FuncType::create(vec![ValType::ExternRef, ValType::I32], vec![ValType::I32]);
+            let func_ty = result.unwrap();
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(extern_div), None, 0);
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            import.add_func("func-div", host_func);
+
+            // add host function: "func-term"
+            let result = FuncType::create([], [ValType::I32]);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(extern_term), None, 0);
+            let host_func = result.unwrap();
+            import.add_func("func-term", host_func);
+
+            // add host function: "func-fail"
+            let result = FuncType::create([], [ValType::I32]);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(extern_fail), None, 0);
+            let host_func = result.unwrap();
+            import.add_func("func-fail", host_func);
+
+            import
+        }
+
+        #[sys_host_function]
+        fn extern_add(
+            _frame: CallingFrame,
+            inputs: Vec<WasmValue>,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            let val1 = if inputs[0].ty() == ValType::ExternRef {
+                inputs[0]
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+            let val1 = val1
+                .extern_ref::<i32>()
+                .expect("fail to get i32 from an ExternRef");
+
+            let val2 = if inputs[1].ty() == ValType::I32 {
+                inputs[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            Ok(vec![WasmValue::from_i32(val1 + val2)])
+        }
+
+        #[sys_host_function]
+        fn extern_sub(
+            _frame: CallingFrame,
+            inputs: Vec<WasmValue>,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            let val1 = if inputs[0].ty() == ValType::ExternRef {
+                inputs[0]
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+
+            let val1 = val1
+                .extern_ref::<i32>()
+                .expect("fail to get i32 from an ExternRef");
+
+            let val2 = if inputs[1].ty() == ValType::I32 {
+                inputs[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            Ok(vec![WasmValue::from_i32(val1 - val2)])
+        }
+
+        #[sys_host_function]
+        fn extern_mul(
+            _frame: CallingFrame,
+            inputs: Vec<WasmValue>,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            let val1 = if inputs[0].ty() == ValType::ExternRef {
+                inputs[0]
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+            let val1 = val1
+                .extern_ref::<i32>()
+                .expect("fail to get i32 from an ExternRef");
+
+            let val2 = if inputs[1].ty() == ValType::I32 {
+                inputs[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            Ok(vec![WasmValue::from_i32(val1 * val2)])
+        }
+
+        #[sys_host_function]
+        fn extern_div(
+            _frame: CallingFrame,
+            inputs: Vec<WasmValue>,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            let val1 = if inputs[0].ty() == ValType::ExternRef {
+                inputs[0]
+            } else {
+                return Err(HostFuncError::User(2));
+            };
+            let val1 = val1
+                .extern_ref::<i32>()
+                .expect("fail to get i32 from an ExternRef");
+
+            let val2 = if inputs[1].ty() == ValType::I32 {
+                inputs[1].to_i32()
+            } else {
+                return Err(HostFuncError::User(3));
+            };
+
+            Ok(vec![WasmValue::from_i32(val1 / val2)])
+        }
+
+        #[sys_host_function]
+        fn extern_term(
+            _frame: CallingFrame,
+            _inputs: Vec<WasmValue>,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            Ok(vec![WasmValue::from_i32(1234)])
+        }
+
+        #[sys_host_function]
+        fn extern_fail(
+            _frame: CallingFrame,
+            _inputs: Vec<WasmValue>,
+        ) -> Result<Vec<WasmValue>, HostFuncError> {
+            Err(HostFuncError::User(2))
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/store.rs.html b/src/wasmedge_sys/store.rs.html new file mode 100644 index 000000000..f9ded4b27 --- /dev/null +++ b/src/wasmedge_sys/store.rs.html @@ -0,0 +1,741 @@ +store.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+
//! Defines WasmEdge Store struct.
+
+use crate::{
+    ffi,
+    instance::module::{InnerInstance, Instance},
+    types::WasmEdgeString,
+    WasmEdgeResult,
+};
+use parking_lot::Mutex;
+use std::sync::Arc;
+use wasmedge_types::error::{StoreError, WasmEdgeError};
+
+/// A [Store] represents all global state that can be manipulated by WebAssembly programs. It consists of the runtime representation of all instances of [functions](crate::Function), [tables](crate::Table), [memories](crate::Memory), and [globals](crate::Global).
+#[derive(Debug, Clone)]
+pub struct Store {
+    pub(crate) inner: Arc<InnerStore>,
+    pub(crate) registered: bool,
+}
+impl Store {
+    /// Creates a new [Store].
+    ///
+    /// # Error
+    ///
+    /// If fail to create, then an error is returned.
+    pub fn create() -> WasmEdgeResult<Self> {
+        let ctx = unsafe { ffi::WasmEdge_StoreCreate() };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Store(StoreError::Create))),
+            false => Ok(Store {
+                inner: Arc::new(InnerStore(ctx)),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Returns the length of the registered [modules](crate::Module).
+    pub fn module_len(&self) -> u32 {
+        unsafe { ffi::WasmEdge_StoreListModuleLength(self.inner.0 as *const _) }
+    }
+
+    /// Returns the names of all registered [modules](crate::Module).
+    pub fn module_names(&self) -> Option<Vec<String>> {
+        let len_mod_names = self.module_len();
+        match len_mod_names > 0 {
+            true => {
+                let mut mod_names = Vec::with_capacity(len_mod_names as usize);
+                unsafe {
+                    ffi::WasmEdge_StoreListModule(
+                        self.inner.0,
+                        mod_names.as_mut_ptr(),
+                        len_mod_names,
+                    );
+                    mod_names.set_len(len_mod_names as usize);
+                };
+
+                let names = mod_names
+                    .into_iter()
+                    .map(|x| x.into())
+                    .collect::<Vec<String>>();
+                Some(names)
+            }
+            false => None,
+        }
+    }
+
+    /// Returns the module instance by the module name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the module instance to get.
+    ///
+    /// # Error
+    ///
+    /// If fail to find the target [module instance](crate::Instance), then an error is returned.
+    pub fn module(&self, name: impl AsRef<str>) -> WasmEdgeResult<Instance> {
+        let mod_name: WasmEdgeString = name.as_ref().into();
+        let ctx = unsafe { ffi::WasmEdge_StoreFindModule(self.inner.0, mod_name.as_raw()) };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::Store(StoreError::NotFoundModule(
+                name.as_ref().to_string(),
+            )))),
+            false => Ok(Instance {
+                inner: Arc::new(Mutex::new(InnerInstance(ctx as *mut _))),
+                registered: true,
+            }),
+        }
+    }
+
+    /// Checks if the [Store] contains a module of which the name matches the given name.
+    ///
+    /// # Argument
+    ///
+    /// * `name` - The name of the module to search.
+    ///
+    pub fn contains(&self, name: impl AsRef<str>) -> bool {
+        if self.module_len() == 0 {
+            return false;
+        }
+
+        match self.module_names() {
+            Some(names) => names.iter().any(|x| x == name.as_ref()),
+            None => false,
+        }
+    }
+
+    /// Provides a raw pointer to the inner Store context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_StoreContext {
+        self.inner.0 as *const _
+    }
+}
+impl Drop for Store {
+    fn drop(&mut self) {
+        if !self.registered && Arc::strong_count(&self.inner) == 1 && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_StoreDelete(self.inner.0) }
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerStore(pub(crate) *mut ffi::WasmEdge_StoreContext);
+unsafe impl Send for InnerStore {}
+unsafe impl Sync for InnerStore {}
+
+#[cfg(test)]
+mod tests {
+    use super::Store;
+    use crate::{
+        instance::{Function, Global, GlobalType, MemType, Memory, Table, TableType},
+        types::WasmValue,
+        AsImport, CallingFrame, Config, Engine, Executor, FuncType, ImportModule, Loader,
+        Validator,
+    };
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    use wasmedge_macro::sys_host_function;
+    use wasmedge_types::{error::HostFuncError, Mutability, NeverType, RefType, ValType};
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_store_basic() {
+        let module_name = "extern_module";
+
+        let result = Store::create();
+        assert!(result.is_ok());
+        let mut store = result.unwrap();
+        assert!(!store.inner.0.is_null());
+        assert!(!store.registered);
+
+        // check the length of registered module list in store before instantiation
+        assert_eq!(store.module_len(), 0);
+        assert!(store.module_names().is_none());
+
+        // create ImportObject instance
+        let result = ImportModule::<NeverType>::create(module_name, None);
+        assert!(result.is_ok());
+        let mut import = result.unwrap();
+
+        // add host function
+        let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+        assert!(result.is_ok());
+        let func_ty = result.unwrap();
+        let result = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+        assert!(result.is_ok());
+        let host_func = result.unwrap();
+        import.add_func("add", host_func);
+
+        // add table
+        let result = TableType::create(RefType::FuncRef, 0, Some(u32::MAX));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let table = result.unwrap();
+        import.add_table("table", table);
+
+        // add memory
+        let memory = {
+            let result = MemType::create(10, Some(20), false);
+            assert!(result.is_ok());
+            let mem_ty = result.unwrap();
+            let result = Memory::create(&mem_ty);
+            assert!(result.is_ok());
+            result.unwrap()
+        };
+        import.add_memory("mem", memory);
+
+        // add globals
+        let result = GlobalType::create(ValType::F32, Mutability::Const);
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Global::create(&ty, WasmValue::from_f32(3.5));
+        assert!(result.is_ok());
+        let global = result.unwrap();
+        import.add_global("global", global);
+
+        let result = Config::create();
+        assert!(result.is_ok());
+        let config = result.unwrap();
+        let result = Executor::create(Some(&config), None);
+        assert!(result.is_ok());
+        let mut executor = result.unwrap();
+
+        let result = executor.register_import_module(&mut store, &import);
+        assert!(result.is_ok());
+
+        // check the module list after instantiation
+        assert_eq!(store.module_len(), 1);
+        assert!(store.module_names().is_some());
+        assert_eq!(store.module_names().unwrap()[0], module_name);
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_store_send() {
+        let result = Store::create();
+        assert!(result.is_ok());
+        let store = result.unwrap();
+        assert!(!store.inner.0.is_null());
+        assert!(!store.registered);
+
+        let handle = thread::spawn(move || {
+            let s = store;
+            assert!(!s.inner.0.is_null());
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_store_sync() {
+        let result = Store::create();
+        assert!(result.is_ok());
+        let store = Arc::new(Mutex::new(result.unwrap()));
+
+        let store_cloned = Arc::clone(&store);
+        let handle = thread::spawn(move || {
+            // create ImportObject instance
+            let result = ImportModule::<NeverType>::create("extern_module", None);
+            assert!(result.is_ok());
+            let mut import = result.unwrap();
+
+            // add host function
+            let result = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]);
+            assert!(result.is_ok());
+            let func_ty = result.unwrap();
+            let result =
+                Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0);
+            assert!(result.is_ok());
+            let host_func = result.unwrap();
+            import.add_func("add", host_func);
+
+            // create an Executor
+            let result = Config::create();
+            assert!(result.is_ok());
+            let config = result.unwrap();
+            let result = Executor::create(Some(&config), None);
+            assert!(result.is_ok());
+            let mut executor = result.unwrap();
+
+            let result = store_cloned.lock();
+            assert!(result.is_ok());
+            let mut store = result.unwrap();
+
+            let result = executor.register_import_module(&mut store, &import);
+            assert!(result.is_ok());
+
+            // get module instance
+            let result = store.module("extern_module");
+            assert!(result.is_ok());
+            let instance = result.unwrap();
+
+            // get function instance
+            let result = instance.get_func("add");
+            assert!(result.is_ok());
+            let add = result.unwrap();
+
+            // run the function
+            let result =
+                executor.run_func(&add, vec![WasmValue::from_i32(12), WasmValue::from_i32(21)]);
+            assert!(result.is_ok());
+            let returns = result.unwrap();
+            assert_eq!(returns[0].to_i32(), 33);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_store_named_module() -> Result<(), Box<dyn std::error::Error>> {
+        // create a Config context
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.bulk_memory_operations(true);
+        assert!(config.bulk_memory_operations_enabled());
+
+        // create an executor with the given config
+        let mut executor = Executor::create(Some(&config), None)?;
+
+        // create a store
+        let mut store = Store::create()?;
+
+        // register a wasm module from a wasm file
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/fibonacci.wat");
+        let module = Loader::create(Some(&config))?.from_file(path)?;
+        Validator::create(Some(&config))?.validate(&module)?;
+        let instance = executor.register_named_module(&mut store, &module, "extern")?;
+
+        // check the name of the module
+        assert!(instance.name().is_some());
+        assert_eq!(instance.name().unwrap(), "extern");
+
+        // get the exported function named "fib"
+        let result = instance.get_func("fib");
+        assert!(result.is_ok());
+        let func = result.unwrap();
+
+        // check the type of the function
+        let result = func.ty();
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+
+        // check the parameter types
+        let param_types = ty.params_type_iter().collect::<Vec<ValType>>();
+        assert_eq!(param_types, [ValType::I32]);
+
+        // check the return types
+        let return_types = ty.returns_type_iter().collect::<Vec<ValType>>();
+        assert_eq!(return_types, [ValType::I32]);
+
+        Ok(())
+    }
+
+    #[sys_host_function]
+    fn real_add(
+        _frame: CallingFrame,
+        inputs: Vec<WasmValue>,
+    ) -> Result<Vec<WasmValue>, HostFuncError> {
+        if inputs.len() != 2 {
+            return Err(HostFuncError::User(1));
+        }
+
+        let a = if inputs[0].ty() == ValType::I32 {
+            inputs[0].to_i32()
+        } else {
+            return Err(HostFuncError::User(2));
+        };
+
+        let b = if inputs[1].ty() == ValType::I32 {
+            inputs[1].to_i32()
+        } else {
+            return Err(HostFuncError::User(3));
+        };
+
+        let c = a + b;
+
+        Ok(vec![WasmValue::from_i32(c)])
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/types.rs.html b/src/wasmedge_sys/types.rs.html new file mode 100644 index 000000000..e2b3f6120 --- /dev/null +++ b/src/wasmedge_sys/types.rs.html @@ -0,0 +1,1219 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+
//! Defines the WebAssembly primitive types.
+
+use crate::{ffi, instance::function::InnerFuncRef, FuncRef};
+use core::ffi::c_void;
+use std::{ffi::CString, str::FromStr};
+use wasmedge_types::{RefType, ValType};
+
+#[derive(Debug, Clone)]
+pub(crate) struct WasmEdgeLimit {
+    min: u32,
+    max: Option<u32>,
+    shared: bool,
+}
+impl WasmEdgeLimit {
+    pub(crate) fn new(min: u32, max: Option<u32>, shared: bool) -> Self {
+        Self { min, max, shared }
+    }
+
+    pub(crate) fn min(&self) -> u32 {
+        self.min
+    }
+
+    pub(crate) fn max(&self) -> Option<u32> {
+        self.max
+    }
+
+    pub(crate) fn shared(&self) -> bool {
+        self.shared
+    }
+}
+impl From<WasmEdgeLimit> for ffi::WasmEdge_Limit {
+    fn from(limit: WasmEdgeLimit) -> Self {
+        let max = match limit.max() {
+            Some(max) => max,
+            None => u32::MAX,
+        };
+
+        Self {
+            Min: limit.min(),
+            Max: max,
+            HasMax: limit.max().is_some(),
+            Shared: limit.shared,
+        }
+    }
+}
+impl From<ffi::WasmEdge_Limit> for WasmEdgeLimit {
+    fn from(limit: ffi::WasmEdge_Limit) -> Self {
+        let max = match limit.HasMax {
+            true => Some(limit.Max),
+            false => None,
+        };
+        WasmEdgeLimit::new(limit.Min, max, limit.Shared)
+    }
+}
+
+/// Struct of WasmEdge String.
+#[derive(Debug)]
+pub(crate) struct WasmEdgeString {
+    inner: InnerWasmEdgeString,
+}
+impl Drop for WasmEdgeString {
+    fn drop(&mut self) {
+        unsafe { ffi::WasmEdge_StringDelete(self.inner.0) }
+    }
+}
+impl WasmEdgeString {
+    pub(crate) fn as_raw(&self) -> ffi::WasmEdge_String {
+        self.inner.0
+    }
+}
+impl<T: AsRef<str>> From<T> for WasmEdgeString {
+    fn from(s: T) -> Self {
+        let ctx = if s.as_ref().contains('\0') {
+            let buffer = s.as_ref().as_bytes();
+            unsafe {
+                ffi::WasmEdge_StringCreateByBuffer(buffer.as_ptr() as *const _, buffer.len() as u32)
+            }
+        } else {
+            let cs = CString::new(s.as_ref()).expect(
+                "Failed to create a CString: the supplied bytes contain an internal 0 byte",
+            );
+            unsafe { ffi::WasmEdge_StringCreateByCString(cs.as_ptr()) }
+        };
+
+        Self {
+            inner: InnerWasmEdgeString(ctx),
+        }
+    }
+}
+impl PartialEq for WasmEdgeString {
+    fn eq(&self, other: &Self) -> bool {
+        unsafe { ffi::WasmEdge_StringIsEqual(self.inner.0, other.inner.0) }
+    }
+}
+impl Eq for WasmEdgeString {}
+impl From<WasmEdgeString> for String {
+    fn from(s: WasmEdgeString) -> Self {
+        let bytes: &[u8] = unsafe {
+            std::slice::from_raw_parts(s.as_raw().Buf as *const u8, s.as_raw().Length as usize)
+        };
+        let x =
+            std::str::from_utf8(bytes).expect("Fail to generate string slice: invalid utf8 bytes");
+        String::from_str(x).expect("Ill-formatted string")
+    }
+}
+impl From<ffi::WasmEdge_String> for String {
+    fn from(s: ffi::WasmEdge_String) -> Self {
+        let cstr = unsafe { std::ffi::CStr::from_ptr(s.Buf as *const _) };
+        cstr.to_string_lossy().into_owned()
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerWasmEdgeString(pub(crate) ffi::WasmEdge_String);
+unsafe impl Send for InnerWasmEdgeString {}
+unsafe impl Sync for InnerWasmEdgeString {}
+
+/// Defines a WebAssembly value.
+#[derive(Debug, Clone, Copy)]
+pub struct WasmValue {
+    ctx: ffi::WasmEdge_Value,
+    ty: ValType,
+}
+impl WasmValue {
+    /// Returns the raw `WasmEdge_Value`.
+    pub fn as_raw(&self) -> ffi::WasmEdge_Value {
+        self.ctx
+    }
+
+    /// Returns the type of a [WasmValue].
+    pub fn ty(&self) -> ValType {
+        self.ty
+    }
+
+    /// Creates a [WasmValue] from a `i32` value.
+    ///
+    /// # Argument
+    ///
+    /// * `val` - The source `i32` value.
+    pub fn from_i32(val: i32) -> Self {
+        Self {
+            ctx: unsafe { ffi::WasmEdge_ValueGenI32(val) },
+            ty: ValType::I32,
+        }
+    }
+
+    /// Generates a `i32` value from a [WasmValue].
+    pub fn to_i32(&self) -> i32 {
+        unsafe { ffi::WasmEdge_ValueGetI32(self.ctx) }
+    }
+
+    /// Creates a [WasmValue] from a `i64` value.
+    ///
+    /// # Argument
+    ///
+    /// * `val` - The source `i64` value.
+    pub fn from_i64(val: i64) -> Self {
+        Self {
+            ctx: unsafe { ffi::WasmEdge_ValueGenI64(val) },
+            ty: ValType::I64,
+        }
+    }
+
+    /// Generates a `i64` value from a [WasmValue].
+    pub fn to_i64(&self) -> i64 {
+        unsafe { ffi::WasmEdge_ValueGetI64(self.ctx) }
+    }
+
+    /// Creates a [WasmValue] from a `f32` value.
+    ///
+    /// # Argument
+    ///
+    /// * `val` - The source `f32` value.
+    pub fn from_f32(val: f32) -> Self {
+        Self {
+            ctx: unsafe { ffi::WasmEdge_ValueGenF32(val) },
+            ty: ValType::F32,
+        }
+    }
+
+    /// Generates a `f32` value from a [WasmValue].
+    pub fn to_f32(&self) -> f32 {
+        unsafe { ffi::WasmEdge_ValueGetF32(self.ctx) }
+    }
+
+    /// Creates a [WasmValue] from a `f64` value.
+    ///
+    /// # Argument
+    ///
+    /// * `val` - The source `f64` value.
+    pub fn from_f64(val: f64) -> Self {
+        Self {
+            ctx: unsafe { ffi::WasmEdge_ValueGenF64(val) },
+            ty: ValType::F64,
+        }
+    }
+
+    /// Generates a `f64` value from a [WasmValue].
+    pub fn to_f64(&self) -> f64 {
+        unsafe { ffi::WasmEdge_ValueGetF64(self.ctx) }
+    }
+
+    /// Creates a [WasmValue] from a `i128` value.
+    ///
+    /// # Argument
+    ///
+    /// * `val` - The source `i128` value.
+    pub fn from_v128(val: i128) -> Self {
+        Self {
+            ctx: unsafe { ffi::WasmEdge_ValueGenV128(val) },
+            ty: ValType::V128,
+        }
+    }
+
+    /// Generates a `v128` value from a [WasmValue].
+    pub fn to_v128(&self) -> i128 {
+        unsafe { ffi::WasmEdge_ValueGetV128(self.ctx) }
+    }
+
+    /// Creates a [WasmValue] from a [RefType](wasmedge_types::RefType) value.
+    ///
+    /// # Argument
+    ///
+    /// * `val` - The `[`RefType`] value.
+    pub fn from_null_ref(ref_ty: RefType) -> Self {
+        Self {
+            ctx: unsafe { ffi::WasmEdge_ValueGenNullRef(ref_ty.into()) },
+            ty: match ref_ty {
+                RefType::FuncRef => ValType::FuncRef,
+                RefType::ExternRef => ValType::ExternRef,
+            },
+        }
+    }
+
+    /// Checks if a [WasmValue] is NullRef or not.
+    pub fn is_null_ref(&self) -> bool {
+        unsafe { ffi::WasmEdge_ValueIsNullRef(self.ctx) }
+    }
+
+    /// Creates a [WasmValue] from a [FuncRef](crate::FuncRef).
+    ///
+    /// Notice that the [WasmValue]s generated from [FuncRef](crate::FuncRef)s are only meaningful when the `bulk_memory_operations` or `reference_types` option is enabled in the [Config](crate::Config).
+    ///
+    /// # Argument
+    ///
+    /// * `func_ref` - A [FuncRef] instance.
+    pub fn from_func_ref(func_ref: FuncRef) -> Self {
+        Self {
+            ctx: unsafe { ffi::WasmEdge_ValueGenFuncRef(func_ref.inner.0) },
+            ty: ValType::FuncRef,
+        }
+    }
+
+    /// Returns the FuncRef(crate::FuncRef).
+    ///
+    /// If the [WasmValue] is a `NullRef`, then `None` is returned.
+    pub fn func_ref(&self) -> Option<FuncRef> {
+        unsafe {
+            match ffi::WasmEdge_ValueIsNullRef(self.ctx) {
+                true => None,
+                false => {
+                    let ctx = ffi::WasmEdge_ValueGetFuncRef(self.ctx);
+                    Some(FuncRef {
+                        inner: InnerFuncRef(ctx),
+                    })
+                }
+            }
+        }
+    }
+
+    /// Creates a [WasmValue] from a reference to an external object.
+    ///
+    /// The [WasmValue]s generated by this function are only meaningful when the `reference_types` option is enabled in
+    /// the [Config](crate::Config).
+    ///
+    /// # Argument
+    ///
+    /// * `extern_obj` - The reference to an external object.
+    pub fn from_extern_ref<T>(extern_obj: &mut T) -> Self {
+        let ptr = extern_obj as *mut T as *mut c_void;
+        Self {
+            ctx: unsafe { ffi::WasmEdge_ValueGenExternRef(ptr) },
+            ty: ValType::ExternRef,
+        }
+    }
+
+    /// Returns the reference to an external object.
+    ///
+    /// If the [WasmValue] is a `NullRef`, then `None` is returned.
+    pub fn extern_ref<T>(&self) -> Option<&T> {
+        unsafe {
+            match ffi::WasmEdge_ValueIsNullRef(self.ctx) {
+                true => None,
+                false => {
+                    let ptr = ffi::WasmEdge_ValueGetExternRef(self.ctx);
+                    let x = ptr as *mut T;
+                    Some(&*x)
+                }
+            }
+        }
+    }
+}
+impl From<ffi::WasmEdge_Value> for WasmValue {
+    fn from(raw_val: ffi::WasmEdge_Value) -> Self {
+        match raw_val.Type {
+            ffi::WasmEdge_ValType_I32 => Self {
+                ctx: raw_val,
+                ty: ValType::I32,
+            },
+            ffi::WasmEdge_ValType_I64 => Self {
+                ctx: raw_val,
+                ty: ValType::I64,
+            },
+            ffi::WasmEdge_ValType_F32 => Self {
+                ctx: raw_val,
+                ty: ValType::F32,
+            },
+            ffi::WasmEdge_ValType_F64 => Self {
+                ctx: raw_val,
+                ty: ValType::F64,
+            },
+            ffi::WasmEdge_ValType_V128 => Self {
+                ctx: raw_val,
+                ty: ValType::V128,
+            },
+            ffi::WasmEdge_ValType_FuncRef => Self {
+                ctx: raw_val,
+                ty: ValType::FuncRef,
+            },
+            ffi::WasmEdge_ValType_ExternRef => Self {
+                ctx: raw_val,
+                ty: ValType::ExternRef,
+            },
+            _ => panic!("unknown WasmEdge_ValType `{}`", raw_val.Type),
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    #[cfg(unix)]
+    use crate::{Table, TableType};
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+    #[cfg(unix)]
+    use wasmedge_types::RefType;
+
+    #[test]
+    #[cfg(unix)]
+    fn test_types_value() {
+        // I32
+        let val = WasmValue::from_i32(1314);
+        assert_eq!(val.ty(), ValType::I32);
+
+        // I64
+        let val = WasmValue::from_i64(1314);
+        assert_eq!(val.ty(), ValType::I64);
+
+        // F32
+        let val = WasmValue::from_f32(13.14);
+        assert_eq!(val.ty(), ValType::F32);
+
+        // F64
+        let val = WasmValue::from_f64(13.14);
+        assert_eq!(val.ty(), ValType::F64);
+
+        // V128
+        let val = WasmValue::from_v128(1314);
+        assert_eq!(val.ty(), ValType::V128);
+
+        // ExternRef
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let mut table = result.unwrap();
+        let value = WasmValue::from_extern_ref(&mut table);
+        assert_eq!(value.ty(), ValType::ExternRef);
+        assert!(value.extern_ref::<Table>().is_some());
+
+        // NullRef(FuncRef)
+        let val = WasmValue::from_null_ref(RefType::FuncRef);
+        assert_eq!(val.ty(), ValType::FuncRef);
+        assert!(val.is_null_ref());
+        assert_eq!(val.ty(), ValType::FuncRef);
+
+        // NullRef(ExternRef)
+        let val = WasmValue::from_null_ref(RefType::ExternRef);
+        assert_eq!(val.ty(), ValType::ExternRef);
+        assert!(val.is_null_ref());
+        assert_eq!(val.ty(), ValType::ExternRef);
+
+        let val1 = WasmValue::from_i32(1314);
+        let val2 = WasmValue::from_i32(1314);
+        assert_eq!(val1.to_i32(), val2.to_i32());
+    }
+
+    #[test]
+    #[cfg(unix)]
+    fn test_types_value_send() {
+        // I32
+        let val_i32 = WasmValue::from_i32(1314);
+        // I64
+        let val_i64 = WasmValue::from_i64(1314);
+        // F32
+        let val_f32 = WasmValue::from_f32(13.14);
+        // F64
+        let val_f64 = WasmValue::from_f64(13.14);
+        // V128
+        let val_v128 = WasmValue::from_v128(1314);
+
+        // ExternRef
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let mut table = result.unwrap();
+        let val_extern_ref = WasmValue::from_extern_ref(&mut table);
+
+        // NullRef(FuncRef)
+        let val_null_func_ref = WasmValue::from_null_ref(RefType::FuncRef);
+
+        // NullRef(ExternRef)
+        let val_null_extern_ref = WasmValue::from_null_ref(RefType::ExternRef);
+
+        let handle = thread::spawn(move || {
+            let val_i32_c = val_i32;
+            assert_eq!(val_i32_c.ty(), ValType::I32);
+
+            let val_i64_c = val_i64;
+            assert_eq!(val_i64_c.ty(), ValType::I64);
+
+            let val_f32_c = val_f32;
+            assert_eq!(val_f32_c.ty(), ValType::F32);
+
+            let val_f64_c = val_f64;
+            assert_eq!(val_f64_c.ty(), ValType::F64);
+
+            let val_v128_c = val_v128;
+            assert_eq!(val_v128_c.ty(), ValType::V128);
+
+            let val_extern_ref_c = val_extern_ref;
+            assert_eq!(val_extern_ref_c.ty(), ValType::ExternRef);
+            assert!(val_extern_ref_c.extern_ref::<Table>().is_some());
+
+            let val_null_func_ref_c = val_null_func_ref;
+            assert_eq!(val_null_func_ref_c.ty(), ValType::FuncRef);
+            assert!(val_null_func_ref_c.is_null_ref());
+            assert_eq!(val_null_func_ref_c.ty(), ValType::FuncRef);
+
+            let val_null_extern_ref_c = val_null_extern_ref;
+            assert_eq!(val_null_extern_ref_c.ty(), ValType::ExternRef);
+            assert!(val_null_extern_ref_c.is_null_ref());
+            assert_eq!(val_null_extern_ref_c.ty(), ValType::ExternRef);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[cfg(unix)]
+    fn test_types_value_sync() {
+        // I32
+        let val_i32 = Arc::new(Mutex::new(WasmValue::from_i32(1314)));
+        let val_i32_cloned = Arc::clone(&val_i32);
+
+        // I64
+        let val_i64 = Arc::new(Mutex::new(WasmValue::from_i64(1314)));
+        let val_i64_cloned = Arc::clone(&val_i64);
+
+        // F32
+        let val_f32 = Arc::new(Mutex::new(WasmValue::from_f32(13.14)));
+        let val_f32_cloned = Arc::clone(&val_f32);
+
+        // F64
+        let val_f64 = Arc::new(Mutex::new(WasmValue::from_f64(13.14)));
+        let val_f64_cloned = Arc::clone(&val_f64);
+
+        // V128
+        let val_v128 = Arc::new(Mutex::new(WasmValue::from_v128(1314)));
+        let val_v128_cloned = Arc::clone(&val_v128);
+
+        // ExternRef
+        let result = TableType::create(RefType::FuncRef, 10, Some(20));
+        assert!(result.is_ok());
+        let ty = result.unwrap();
+        let result = Table::create(&ty);
+        assert!(result.is_ok());
+        let mut table = result.unwrap();
+        let val_extern_ref = Arc::new(Mutex::new(WasmValue::from_extern_ref(&mut table)));
+        let val_extern_ref_cloned = Arc::clone(&val_extern_ref);
+
+        // NullRef(FuncRef)
+        let val_null_func_ref = Arc::new(Mutex::new(WasmValue::from_null_ref(RefType::FuncRef)));
+        let val_null_func_ref_cloned = Arc::clone(&val_null_func_ref);
+
+        // NullRef(ExternRef)
+        let val_null_extern_ref =
+            Arc::new(Mutex::new(WasmValue::from_null_ref(RefType::ExternRef)));
+        let val_null_extern_ref_cloned = Arc::clone(&val_null_extern_ref);
+
+        let handle = thread::spawn(move || {
+            let result = val_i32_cloned.lock();
+            assert!(result.is_ok());
+            let val_i32_c = result.unwrap();
+            assert_eq!(val_i32_c.ty(), ValType::I32);
+
+            let result = val_i64_cloned.lock();
+            assert!(result.is_ok());
+            let val_i64_c = result.unwrap();
+            assert_eq!(val_i64_c.ty(), ValType::I64);
+
+            let result = val_f32_cloned.lock();
+            assert!(result.is_ok());
+            let val_f32_c = result.unwrap();
+            assert_eq!(val_f32_c.ty(), ValType::F32);
+
+            let result = val_f64_cloned.lock();
+            assert!(result.is_ok());
+            let val_f64_c = result.unwrap();
+            assert_eq!(val_f64_c.ty(), ValType::F64);
+
+            let result = val_v128_cloned.lock();
+            assert!(result.is_ok());
+            let val_v128_c = result.unwrap();
+            assert_eq!(val_v128_c.ty(), ValType::V128);
+
+            let result = val_extern_ref_cloned.lock();
+            assert!(result.is_ok());
+            let val_extern_ref_c = result.unwrap();
+            assert_eq!(val_extern_ref_c.ty(), ValType::ExternRef);
+            assert!(val_extern_ref_c.extern_ref::<Table>().is_some());
+
+            let result = val_null_func_ref_cloned.lock();
+            assert!(result.is_ok());
+            let val_null_func_ref_c = result.unwrap();
+            assert_eq!(val_null_func_ref_c.ty(), ValType::FuncRef);
+            assert!(val_null_func_ref_c.is_null_ref());
+            assert_eq!(val_null_func_ref_c.ty(), ValType::FuncRef);
+
+            let result = val_null_extern_ref_cloned.lock();
+            assert!(result.is_ok());
+            let val_null_extern_ref_c = result.unwrap();
+            assert_eq!(val_null_extern_ref_c.ty(), ValType::ExternRef);
+            assert!(val_null_extern_ref_c.is_null_ref());
+            assert_eq!(val_null_extern_ref_c.ty(), ValType::ExternRef);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    fn test_types_string() {
+        let s: WasmEdgeString = "hello".into();
+        let t: WasmEdgeString = "hello".into();
+        assert_eq!(s, t);
+
+        let s: WasmEdgeString = "hello".into();
+        let t = String::from(s);
+        assert_eq!(t, "hello");
+
+        let s: WasmEdgeString = "hello".into();
+        let t: WasmEdgeString = "hello\0".into();
+        assert_ne!(s, t);
+
+        let s: WasmEdgeString = "hello\0".into();
+        let t = String::from(s);
+        assert_eq!(t, "hello\0");
+
+        let s: WasmEdgeString = "he\0llo\0".into();
+        let t = String::from(s);
+        assert_eq!(t, "he\0llo\0");
+    }
+
+    #[test]
+    fn test_types_string_send() {
+        let s: WasmEdgeString = "hello".into();
+
+        let handle = thread::spawn(move || {
+            let t: WasmEdgeString = "hello".into();
+            assert_eq!(s, t);
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    fn test_types_string_sync() {
+        let s: WasmEdgeString = "hello".into();
+        let p = Arc::new(Mutex::new(s));
+
+        let s_cloned = Arc::clone(&p);
+        let handle = thread::spawn(move || {
+            let result = s_cloned.lock();
+            assert!(result.is_ok());
+            let s = result.unwrap();
+
+            let t: WasmEdgeString = "hello".into();
+            assert_eq!(*s, t);
+        });
+
+        handle.join().unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/utils.rs.html b/src/wasmedge_sys/utils.rs.html new file mode 100644 index 000000000..93900feb3 --- /dev/null +++ b/src/wasmedge_sys/utils.rs.html @@ -0,0 +1,811 @@ +utils.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+
//! Defines the versioning and logging functions.
+
+use crate::{
+    ffi::{self, WasmEdge_Result, WasmEdge_ResultGetCode, WasmEdge_ResultOK},
+    WasmEdgeResult,
+};
+use std::{
+    ffi::{CStr, CString},
+    path::Path,
+};
+use wasmedge_types::error::{
+    CoreCommonError, CoreError, CoreExecutionError, CoreInstantiationError, CoreLoadError,
+    CoreValidationError, WasmEdgeError,
+};
+
+#[cfg(unix)]
+pub(crate) fn path_to_cstring(path: &Path) -> WasmEdgeResult<CString> {
+    use std::os::unix::ffi::OsStrExt;
+    CString::new(path.as_os_str().as_bytes())
+        .map_err(|err| Box::new(WasmEdgeError::FoundNulByte(err)))
+}
+
+#[cfg(windows)]
+pub(crate) fn path_to_cstring(path: &Path) -> WasmEdgeResult<CString> {
+    match path.to_str() {
+        Some(s) => CString::new(s).map_err(|err| Box::new(WasmEdgeError::FoundNulByte(err))),
+        None => Err(Box::new(WasmEdgeError::WindowsPathConversion(
+            path.to_string_lossy().to_string(),
+        ))),
+    }
+}
+
+/// Logs the debug information.
+pub fn log_debug_info() {
+    unsafe { ffi::WasmEdge_LogSetDebugLevel() }
+}
+
+/// Logs the error information.
+pub fn log_error_info() {
+    unsafe { ffi::WasmEdge_LogSetErrorLevel() }
+}
+
+/// Sets the logging system off.
+pub fn log_off() {
+    unsafe { ffi::WasmEdge_LogOff() }
+}
+
+// Checks the result of a `FFI` function.
+pub(crate) fn check(result: WasmEdge_Result) -> WasmEdgeResult<()> {
+    let category = unsafe { ffi::WasmEdge_ResultGetCategory(result) };
+    let code = unsafe {
+        if !WasmEdge_ResultOK(result) {
+            WasmEdge_ResultGetCode(result)
+        } else {
+            0u32
+        }
+    };
+
+    match category {
+        ffi::WasmEdge_ErrCategory_UserLevelError => Err(Box::new(WasmEdgeError::User(code))),
+        ffi::WasmEdge_ErrCategory_WASM => gen_runtime_error(code),
+        _ => panic!("Invalid category value: {category}"),
+    }
+}
+
+fn gen_runtime_error(code: u32) -> WasmEdgeResult<()> {
+    match code {
+        // Success or terminated (exit and return success)
+        0x00 | 0x01 => Ok(()),
+
+        // Common errors
+        0x02 => Err(Box::new(WasmEdgeError::Core(CoreError::Common(
+            CoreCommonError::RuntimeError,
+        )))),
+        0x03 => Err(Box::new(WasmEdgeError::Core(CoreError::Common(
+            CoreCommonError::CostLimitExceeded,
+        )))),
+        0x04 => Err(Box::new(WasmEdgeError::Core(CoreError::Common(
+            CoreCommonError::WrongVMWorkflow,
+        )))),
+        0x05 => Err(Box::new(WasmEdgeError::Core(CoreError::Common(
+            CoreCommonError::FuncNotFound,
+        )))),
+        0x06 => Err(Box::new(WasmEdgeError::Core(CoreError::Common(
+            CoreCommonError::AOTDisabled,
+        )))),
+        0x07 => Err(Box::new(WasmEdgeError::Core(CoreError::Common(
+            CoreCommonError::Interrupted,
+        )))),
+        0x08 => Err(Box::new(WasmEdgeError::Core(CoreError::Common(
+            CoreCommonError::NotValidated,
+        )))),
+        0x09 => Err(Box::new(WasmEdgeError::Core(CoreError::Common(
+            CoreCommonError::UserDefError,
+        )))),
+
+        // Load phase
+        0x20 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::IllegalPath,
+        )))),
+        0x21 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::ReadError,
+        )))),
+        0x22 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::UnexpectedEnd,
+        )))),
+        0x23 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedMagic,
+        )))),
+        0x24 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedVersion,
+        )))),
+        0x25 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedSection,
+        )))),
+        0x26 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::SectionSizeMismatch,
+        )))),
+        0x27 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::NameSizeOutOfBounds,
+        )))),
+        0x28 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::JunkSection,
+        )))),
+        0x29 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::IncompatibleFuncCode,
+        )))),
+        0x2A => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::IncompatibleDataCount,
+        )))),
+        0x2B => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::DataCountRequired,
+        )))),
+        0x2C => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedImportKind,
+        )))),
+        0x2D => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedExportKind,
+        )))),
+        0x2E => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::ExpectedZeroByte,
+        )))),
+        0x2F => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::InvalidMut,
+        )))),
+        0x30 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::TooManyLocals,
+        )))),
+        0x31 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedValType,
+        )))),
+        0x32 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedElemType,
+        )))),
+        0x33 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedRefType,
+        )))),
+        0x34 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::MalformedUTF8,
+        )))),
+        0x35 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::IntegerTooLarge,
+        )))),
+        0x36 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::IntegerTooLong,
+        )))),
+        0x37 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::IllegalOpCode,
+        )))),
+        0x38 => Err(Box::new(WasmEdgeError::Core(CoreError::Load(
+            CoreLoadError::IllegalGrammar,
+        )))),
+
+        // Validation phase
+        0x40 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidAlignment,
+        )))),
+        0x41 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::TypeCheckFailed,
+        )))),
+        0x42 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidLabelIdx,
+        )))),
+        0x43 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidLocalIdx,
+        )))),
+        0x44 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidFuncTypeIdx,
+        )))),
+        0x45 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidFuncIdx,
+        )))),
+        0x46 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidTableIdx,
+        )))),
+        0x47 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidMemoryIdx,
+        )))),
+        0x48 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidGlobalIdx,
+        )))),
+        0x49 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidElemIdx,
+        )))),
+        0x4A => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidDataIdx,
+        )))),
+        0x4B => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidRefIdx,
+        )))),
+        0x4C => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::ConstExprRequired,
+        )))),
+        0x4D => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::DupExportName,
+        )))),
+        0x4E => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::ImmutableGlobal,
+        )))),
+        0x4F => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidResultArity,
+        )))),
+        0x50 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::MultiTables,
+        )))),
+        0x51 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::MultiMemories,
+        )))),
+        0x52 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidLimit,
+        )))),
+        0x53 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidMemPages,
+        )))),
+        0x54 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidStartFunc,
+        )))),
+        0x55 => Err(Box::new(WasmEdgeError::Core(CoreError::Validation(
+            CoreValidationError::InvalidLaneIdx,
+        )))),
+
+        // Instantiation phase
+        0x60 => Err(Box::new(WasmEdgeError::Core(CoreError::Instantiation(
+            CoreInstantiationError::ModuleNameConflict,
+        )))),
+        0x61 => Err(Box::new(WasmEdgeError::Core(CoreError::Instantiation(
+            CoreInstantiationError::IncompatibleImportType,
+        )))),
+        0x62 => Err(Box::new(WasmEdgeError::Core(CoreError::Instantiation(
+            CoreInstantiationError::UnknownImport,
+        )))),
+        0x63 => Err(Box::new(WasmEdgeError::Core(CoreError::Instantiation(
+            CoreInstantiationError::DataSegDoesNotFit,
+        )))),
+        0x64 => Err(Box::new(WasmEdgeError::Core(CoreError::Instantiation(
+            CoreInstantiationError::ElemSegDoesNotFit,
+        )))),
+
+        // Execution phase
+        0x80 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::WrongInstanceAddress,
+        )))),
+        0x81 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::WrongInstanceIndex,
+        )))),
+        0x82 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::InstrTypeMismatch,
+        )))),
+        0x83 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::FuncTypeMismatch,
+        )))),
+        0x84 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::DivideByZero,
+        )))),
+        0x85 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::IntegerOverflow,
+        )))),
+        0x86 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::InvalidConvToInt,
+        )))),
+        0x87 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::TableOutOfBounds,
+        )))),
+        0x88 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::MemoryOutOfBounds,
+        )))),
+        0x89 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::Unreachable,
+        )))),
+        0x8A => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::UninitializedElement,
+        )))),
+        0x8B => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::UndefinedElement,
+        )))),
+        0x8C => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::IndirectCallTypeMismatch,
+        )))),
+        0x8D => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::HostFuncFailed,
+        )))),
+        0x8E => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::RefTypeMismatch,
+        )))),
+        0x8F => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::UnalignedAtomicAccess,
+        )))),
+        0x90 => Err(Box::new(WasmEdgeError::Core(CoreError::Execution(
+            CoreExecutionError::ExpectSharedMemory,
+        )))),
+
+        _ => panic!("unknown error code: {code}"),
+    }
+}
+
+/// Returns the major version value.
+pub fn version_major_value() -> u32 {
+    unsafe { ffi::WasmEdge_VersionGetMajor() }
+}
+
+/// Returns the minor version value.
+pub fn version_minor_value() -> u32 {
+    unsafe { ffi::WasmEdge_VersionGetMinor() }
+}
+
+/// Returns the patch version value.
+pub fn version_patch_value() -> u32 {
+    unsafe { ffi::WasmEdge_VersionGetPatch() }
+}
+
+/// Returns the version string.
+pub fn version_string() -> String {
+    unsafe {
+        CStr::from_ptr(ffi::WasmEdge_VersionGet())
+            .to_string_lossy()
+            .into_owned()
+    }
+}
+
+/// Triggers the WasmEdge AOT compiler tool
+pub fn driver_aot_compiler<I, V>(args: I) -> i32
+where
+    I: IntoIterator<Item = V>,
+    V: AsRef<str>,
+{
+    // create a vector of zero terminated strings
+    let args = args
+        .into_iter()
+        .map(|arg| CString::new(arg.as_ref()).unwrap())
+        .collect::<Vec<CString>>();
+
+    // convert the strings to raw pointers
+    let mut c_args = args
+        .iter()
+        .map(|arg| arg.as_ptr())
+        .collect::<Vec<*const std::os::raw::c_char>>();
+
+    unsafe {
+        ffi::WasmEdge_Driver_Compiler(c_args.len() as std::os::raw::c_int, c_args.as_mut_ptr())
+    }
+}
+
+/// Triggers the WasmEdge runtime tool
+pub fn driver_runtime_tool<I, V>(args: I) -> i32
+where
+    I: IntoIterator<Item = V>,
+    V: AsRef<str>,
+{
+    // create a vector of zero terminated strings
+    let args = args
+        .into_iter()
+        .map(|arg| CString::new(arg.as_ref()).unwrap())
+        .collect::<Vec<CString>>();
+
+    // convert the strings to raw pointers
+    let mut c_args = args
+        .iter()
+        .map(|arg| arg.as_ptr())
+        .collect::<Vec<*const std::os::raw::c_char>>();
+
+    unsafe { ffi::WasmEdge_Driver_Tool(c_args.len() as std::os::raw::c_int, c_args.as_mut_ptr()) }
+}
+
+/// Triggers the WasmEdge unified tool
+pub fn driver_unified_tool<I, V>(args: I) -> i32
+where
+    I: IntoIterator<Item = V>,
+    V: AsRef<str>,
+{
+    // create a vector of zero terminated strings
+    let args = args
+        .into_iter()
+        .map(|arg| CString::new(arg.as_ref()).unwrap())
+        .collect::<Vec<CString>>();
+
+    // convert the strings to raw pointers
+    let mut c_args = args
+        .iter()
+        .map(|arg| arg.as_ptr())
+        .collect::<Vec<*const std::os::raw::c_char>>();
+
+    unsafe {
+        ffi::WasmEdge_Driver_UniTool(c_args.len() as std::os::raw::c_int, c_args.as_mut_ptr())
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_sys/validator.rs.html b/src/wasmedge_sys/validator.rs.html new file mode 100644 index 000000000..174973f0a --- /dev/null +++ b/src/wasmedge_sys/validator.rs.html @@ -0,0 +1,385 @@ +validator.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+
//! Defines WasmEdge Validator struct.
+
+use crate::{ffi, utils::check, Config, Module, WasmEdgeResult};
+use wasmedge_types::error::WasmEdgeError;
+
+/// Struct of WasmEdge Validator.
+#[derive(Debug)]
+pub struct Validator {
+    pub(crate) inner: InnerValidator,
+    pub(crate) registered: bool,
+}
+impl Validator {
+    /// Creates a new [Validator] to be associated with the given global configuration.
+    ///
+    /// # Arguments
+    ///
+    /// * `config` - The global environment configuration.
+    ///
+    /// # Error
+    ///
+    /// If fail to create a [Validator], then an error is returned.
+    pub fn create(config: Option<&Config>) -> WasmEdgeResult<Self> {
+        let ctx = match config {
+            Some(config) => unsafe { ffi::WasmEdge_ValidatorCreate(config.inner.0) },
+            None => unsafe { ffi::WasmEdge_ValidatorCreate(std::ptr::null_mut()) },
+        };
+        match ctx.is_null() {
+            true => Err(Box::new(WasmEdgeError::CompilerCreate)),
+            false => Ok(Self {
+                inner: InnerValidator(ctx),
+                registered: false,
+            }),
+        }
+    }
+
+    /// Validates a given WasmEdge [Module](crate::Module).
+    ///
+    /// [Module](crate::Module)s are valid when all components they contain are valid. Furthermore, most definitions are themselves classified with a suitable type.
+    ///
+    /// # Arguments
+    ///
+    /// * `module` - The [Module](crate::Module) to be validated.
+    ///
+    /// # Error
+    ///
+    /// If the validation fails, then an error is returned.
+    pub fn validate(&self, module: &Module) -> WasmEdgeResult<()> {
+        unsafe {
+            check(ffi::WasmEdge_ValidatorValidate(
+                self.inner.0,
+                module.inner.0,
+            ))
+        }
+    }
+
+    /// Provides a raw pointer to the inner Validator context.
+    #[cfg(feature = "ffi")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
+    pub fn as_ptr(&self) -> *const ffi::WasmEdge_ValidatorContext {
+        self.inner.0 as *const _
+    }
+}
+impl Drop for Validator {
+    fn drop(&mut self) {
+        if !self.registered && !self.inner.0.is_null() {
+            unsafe { ffi::WasmEdge_ValidatorDelete(self.inner.0) }
+        }
+    }
+}
+
+#[derive(Debug)]
+pub(crate) struct InnerValidator(pub(crate) *mut ffi::WasmEdge_ValidatorContext);
+unsafe impl Send for InnerValidator {}
+unsafe impl Sync for InnerValidator {}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::{Config, Loader};
+    use std::{
+        sync::{Arc, Mutex},
+        thread,
+    };
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_validator() {
+        // create a Validator context without configuration
+        let result = Validator::create(None);
+        assert!(result.is_ok());
+
+        // create a Loader context with configuration
+        let result = Config::create();
+        assert!(result.is_ok());
+        let mut config = result.unwrap();
+        config.reference_types(true);
+        let result = Loader::create(Some(&config));
+        assert!(result.is_ok());
+        let loader = result.unwrap();
+
+        // load a WASM module
+        let path = std::env::current_dir()
+            .unwrap()
+            .ancestors()
+            .nth(2)
+            .unwrap()
+            .join("examples/wasmedge-sys/data/test.wasm");
+        let result = loader.from_file(path);
+        assert!(result.is_ok());
+        let module = result.unwrap();
+        assert!(!module.inner.0.is_null());
+
+        // create a Validator context without configuration
+        let result = Validator::create(None);
+        assert!(result.is_ok());
+        let validator = result.unwrap();
+
+        // validate the module loaded.
+        let result = validator.validate(&module);
+        assert!(result.is_ok());
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_validator_send() {
+        // create a Validator
+        let result = Validator::create(None);
+        assert!(result.is_ok());
+        let validator = result.unwrap();
+
+        let handle = thread::spawn(move || {
+            let result = Loader::create(None);
+            assert!(result.is_ok());
+            let loader = result.unwrap();
+
+            // load a WASM module
+            let path = std::env::current_dir()
+                .unwrap()
+                .ancestors()
+                .nth(2)
+                .unwrap()
+                .join("examples/wasmedge-sys/data/test.wasm");
+            let result = loader.from_file(path);
+            assert!(result.is_ok());
+            let module = result.unwrap();
+            assert!(!module.inner.0.is_null());
+
+            // validate the module loaded.
+            let result = validator.validate(&module);
+            assert!(result.is_ok());
+        });
+
+        handle.join().unwrap();
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_result_states)]
+    fn test_validator_sync() {
+        // create a Validator
+        let result = Validator::create(None);
+        assert!(result.is_ok());
+        let validator = Arc::new(Mutex::new(result.unwrap()));
+
+        let validator_cloned = Arc::clone(&validator);
+        let handle = thread::spawn(move || {
+            let result = Loader::create(None);
+            assert!(result.is_ok());
+            let loader = result.unwrap();
+
+            // load a WASM module
+            let path = std::env::current_dir()
+                .unwrap()
+                .ancestors()
+                .nth(2)
+                .unwrap()
+                .join("examples/wasmedge-sys/data/test.wasm");
+            let result = loader.from_file(path);
+            assert!(result.is_ok());
+            let module = result.unwrap();
+            assert!(!module.inner.0.is_null());
+
+            // validate the module loaded.
+            let result = validator_cloned.lock();
+            assert!(result.is_ok());
+            let validator = result.unwrap();
+            let result = validator.validate(&module);
+            assert!(result.is_ok());
+        });
+
+        handle.join().unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/src/wasmedge_types/error.rs.html b/src/wasmedge_types/error.rs.html new file mode 100644 index 000000000..363540412 --- /dev/null +++ b/src/wasmedge_types/error.rs.html @@ -0,0 +1,981 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+
//! Defines WasmEdge error types.
+
+use crate::ExternalInstanceType;
+use thiserror::Error;
+
+/// The error types used by both wasmedge-sys and wasmedge crates.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum WasmEdgeError {
+    // For general operation error
+    #[error("{0}")]
+    Operation(String),
+
+    // For user-defined error
+    #[error("{0}")]
+    User(u32),
+
+    /// Errors raised by WasmEdge Core.
+    #[error("{0}")]
+    Core(CoreError),
+
+    #[error("Fail to create ImportObj module")]
+    ImportObjCreate,
+    #[error("Fail to create Executor context")]
+    ExecutorCreate,
+    #[error("{0}")]
+    Store(StoreError),
+    #[error("Fail to create Statistics context")]
+    StatisticsCreate,
+    #[error("Fail to create Module")]
+    ModuleCreate,
+    #[error("Fail to create Loader")]
+    LoaderCreate,
+    #[error("Fail to create Config")]
+    ConfigCreate,
+    #[error("Fail to create AOT Compiler")]
+    CompilerCreate,
+    #[error("Fail to create Validator")]
+    ValidatorCreate,
+    #[error("{0}")]
+    Vm(VmError),
+
+    // instances
+    #[error("{0}")]
+    Func(FuncError),
+    #[error("Fail to create FuncType")]
+    FuncTypeCreate,
+    #[error("Execution Timed Out")]
+    ExecuteTimeout,
+    #[error("{0}")]
+    Mem(MemError),
+    #[error("Fail to create MemType")]
+    MemTypeCreate,
+    #[error("{0}")]
+    Global(GlobalError),
+    #[error("Fail to create GlobalType")]
+    GlobalTypeCreate,
+    #[error("{0}")]
+    Table(TableError),
+    #[error("Fail to create TableType")]
+    TableTypeCreate,
+    #[error("{0}")]
+    Import(ImportError),
+    #[error("{0}")]
+    Export(ExportError),
+    #[error("{0}")]
+    Instance(InstanceError),
+    #[error("{0}")]
+    Plugin(PluginError),
+
+    // std
+    #[error("Found an internal 0 byte")]
+    FoundNulByte(#[from] std::ffi::NulError),
+    #[error("Fail to find a nul byte in the expected position")]
+    NotFoundNulByte(#[from] std::ffi::FromBytesWithNulError),
+    #[error("Fail to interpret a sequence of u8 as a string")]
+    Utf8(#[from] std::str::Utf8Error),
+    #[error("Fail to convert a vector of bytes to a string")]
+    FromUtf8(#[from] std::string::FromUtf8Error),
+
+    // Windows platform
+    #[error("Fail to convert path on Windows: {0}")]
+    WindowsPathConversion(String),
+}
+
+/// The error types for WasmEdge Function.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum FuncError {
+    #[error("Fail to create Function instance")]
+    Create,
+    #[error("{0}")]
+    CreateBinding(String),
+    #[error("Fail to get the function type")]
+    Type,
+}
+
+/// The error types for WasmEdge Memory.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum MemError {
+    #[error("Fail to create Memory instance")]
+    Create,
+    #[error("Fail to create shared memory type. The 'max' field must not be None.")]
+    CreateSharedType,
+    #[error("Fail to get the memory type")]
+    Type,
+    #[error("Fail to get the const pointer to data")]
+    ConstPtr,
+    #[error("Fail to get the pointer to data")]
+    MutPtr,
+    #[error("Fail to convert a raw pointer to a reference")]
+    Ptr2Ref,
+}
+
+/// The error types for WasmEdge Global.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum GlobalError {
+    #[error("Fail to create Global instance")]
+    Create,
+    #[error("Fail to get the global type")]
+    Type,
+    #[error("Trying to set value to a const global variable")]
+    ModifyConst,
+    #[error("")]
+    UnmatchedValType,
+}
+
+/// The error types for WasmEdge Table.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum TableError {
+    #[error("Fail to create Table instance")]
+    Create,
+    #[error("Fail to get the table type")]
+    Type,
+}
+
+/// The error types for WasmEdge ImportType.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum ImportError {
+    #[error("The expected Import type is {expected:?}, but found {actual:?}")]
+    Type {
+        expected: ExternalInstanceType,
+        actual: ExternalInstanceType,
+    },
+    #[error("{0}")]
+    FuncType(String),
+    #[error("{0}")]
+    TableType(String),
+    #[error("{0}")]
+    MemType(String),
+    #[error("{0}")]
+    GlobalType(String),
+}
+
+/// The error types for WasmEdge ExportType.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum ExportError {
+    #[error("The expected Export type is {expected:?}, but found {actual:?}")]
+    Type {
+        expected: ExternalInstanceType,
+        actual: ExternalInstanceType,
+    },
+    #[error("{0}")]
+    FuncType(String),
+    #[error("{0}")]
+    TableType(String),
+    #[error("{0}")]
+    MemType(String),
+    #[error("{0}")]
+    GlobalType(String),
+}
+
+/// The error types for WasmEdge Instance.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum InstanceError {
+    #[error("Fail to create Instance context")]
+    Create,
+    #[error("Fail to create WasiModule context")]
+    CreateWasi,
+    #[error("Fail to create WasmEdgeProcessModule context")]
+    CreateWasmEdgeProcess,
+    #[error("Fail to create ImportModule context")]
+    CreateImportModule,
+    #[error("Not found the target function ({0})")]
+    NotFoundFunc(String),
+    #[error("Not found the target table ({0})")]
+    NotFoundTable(String),
+    #[error("Not found the target memory ({0})")]
+    NotFoundMem(String),
+    #[error("Not found the target global ({0})")]
+    NotFoundGlobal(String),
+    #[error("Not found the given mapped Fd/handler")]
+    NotFoundMappedFdHandler,
+}
+
+/// The error types for WasmEdge plugin.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum PluginError {
+    #[error("Failed to create a plugin instance named '{0}'. Make sure that the plugin instance name is correct.")]
+    Create(String),
+    #[error("Not found the plugin named '{0}'. Make sure that the plugin name is correct.")]
+    NotFound(String),
+}
+
+/// The error types for WasmEdge Store.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum StoreError {
+    #[error("Fail to create Store context")]
+    Create,
+    #[error("Fail to find the target function ({0})")]
+    NotFoundFunc(String),
+    #[error("Fail to find the target function ({func_name}) in the module ({mod_name})")]
+    NotFoundFuncRegistered { func_name: String, mod_name: String },
+    #[error("Fail to find the target table ({0})")]
+    NotFoundTable(String),
+    #[error("Fail to find the target table ({table_name}) in the module ({mod_name})")]
+    NotFoundTableRegistered {
+        table_name: String,
+        mod_name: String,
+    },
+    #[error("Fail to find the target memory ({0})")]
+    NotFoundMem(String),
+    #[error("Fail to find the target memory ({mem_name}) in the module ({mod_name})")]
+    NotFoundMemRegistered { mem_name: String, mod_name: String },
+    #[error("Fail to find the target global ({0})")]
+    NotFoundGlobal(String),
+    #[error("Fail to find the target global ({global_name}) in the module ({mod_name})")]
+    NotFoundGlobalRegistered {
+        global_name: String,
+        mod_name: String,
+    },
+    #[error("Not found the target module ({0})")]
+    NotFoundModule(String),
+    #[error("Not found the active module")]
+    NotFoundActiveModule,
+}
+
+/// The error types for WasmEdge Vm.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum VmError {
+    #[error("Fail to create Vm context")]
+    Create,
+    #[error("Fail to create Vm context. It is required to provide a `WasiContext` instance for creating a Vm when the `wasi` config option is enabled.")]
+    CreateWithWasiContext,
+    #[error("Fail to get the type of the target function ({0})")]
+    NotFoundFuncType(String),
+    #[error("Fail to get module instance ({0})")]
+    NotFoundModule(String),
+    #[error("Fail to get Wasi module instance")]
+    NotFoundWasiModule,
+    #[error("Fail to get WasmEdge_Process module instance")]
+    NotFoundWasmEdgeProcessModule,
+    #[error("Fail to get WasiNn module instance")]
+    NotFoundWasiNnModule,
+    #[error("Fail to get WasiCryptoCommon module instance")]
+    NotFoundWasiCryptoCommonModule,
+    #[error("Fail to get WasiCryptoAsymmetricCommon module instance")]
+    NotFoundWasiCryptoAsymmetricCommonModule,
+    #[error("Fail to get WasiCryptoSymmetric module instance")]
+    NotFoundWasiCryptoSymmetricModule,
+    #[error("Fail to get WasiCryptoKx module instance")]
+    NotFoundWasiCryptoKxModule,
+    #[error("Fail to get WasiCryptoSignatures module instance")]
+    NotFoundWasiCryptoSignaturesModule,
+    #[error("Fail to get Store context")]
+    NotFoundStore,
+    #[error("Fail to get Statistics context")]
+    NotFoundStatistics,
+    #[error("Fail to get the target ImportModule (name: {0})")]
+    NotFoundImportModule(String),
+    #[error(
+        "Fail to register import module named {0}. Another import module with the same name has already existed."
+    )]
+    DuplicateImportModule(String),
+    #[error(
+        "Fail to register module named {0}. Another module instance with the same name has already existed."
+    )]
+    DuplicateModuleInstance(String),
+    #[error("Fail to get Loader context")]
+    NotFoundLoader,
+    #[error("Fail to get Validator context")]
+    NotFoundValidator,
+    #[error("Fail to get Executor context")]
+    NotFoundExecutor,
+    #[error("Try to register an invalid import module")]
+    InvalidImportModule,
+    #[error("Not found active module instance")]
+    NotFoundActiveModule,
+}
+
+/// The error types raised by WasmEdge Core.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum CoreError {
+    #[error("{0}")]
+    Common(CoreCommonError),
+    #[error("{0}")]
+    Load(CoreLoadError),
+    #[error("{0}")]
+    Validation(CoreValidationError),
+    #[error("{0}")]
+    Instantiation(CoreInstantiationError),
+    #[error("{0}")]
+    Execution(CoreExecutionError),
+}
+
+/// The error type for the common errors from WasmEdge Core.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum CoreCommonError {
+    #[error("generic runtime error")]
+    RuntimeError,
+    #[error("cost limit exceeded")]
+    CostLimitExceeded,
+    #[error("wrong VM workflow")]
+    WrongVMWorkflow,
+    #[error("wasm function not found")]
+    FuncNotFound,
+    #[error("AOT runtime is disabled in this build")]
+    AOTDisabled,
+    #[error("execution interrupted")]
+    Interrupted,
+    #[error("user defined error code")]
+    UserDefError,
+    #[error("wasm module hasn't passed validation yet")]
+    NotValidated,
+}
+
+/// The error type for the load phase from WasmEdge Core.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum CoreLoadError {
+    #[error("Invalid file path")]
+    IllegalPath,
+    #[error("Read error")]
+    ReadError,
+    #[error("unexpected end")]
+    UnexpectedEnd,
+    #[error("magic header not detected")]
+    MalformedMagic,
+    #[error("unknown binary version")]
+    MalformedVersion,
+    #[error("malformed section id")]
+    MalformedSection,
+    #[error("section size mismatch")]
+    SectionSizeMismatch,
+    #[error("length out of bounds")]
+    NameSizeOutOfBounds,
+    #[error("unexpected content after last section")]
+    JunkSection,
+    #[error("function and code section have inconsistent lengths")]
+    IncompatibleFuncCode,
+    #[error("data count and data section have inconsistent lengths")]
+    IncompatibleDataCount,
+    #[error("data count section required")]
+    DataCountRequired,
+    #[error("malformed import kind")]
+    MalformedImportKind,
+    #[error("malformed export kind")]
+    MalformedExportKind,
+    #[error("zero byte expected")]
+    ExpectedZeroByte,
+    #[error("malformed mutability")]
+    InvalidMut,
+    #[error("too many locals")]
+    TooManyLocals,
+    #[error("malformed value type")]
+    MalformedValType,
+    #[error("malformed element type")]
+    MalformedElemType,
+    #[error("malformed reference type")]
+    MalformedRefType,
+    #[error("malformed UTF-8 encoding")]
+    MalformedUTF8,
+    #[error("integer too large")]
+    IntegerTooLarge,
+    #[error("integer representation too long")]
+    IntegerTooLong,
+    #[error("illegal opcode")]
+    IllegalOpCode,
+    #[error("invalid wasm grammar")]
+    IllegalGrammar,
+}
+
+/// The error type for the validation phase from WasmEdge Core.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum CoreValidationError {
+    #[error("alignment must not be larger than natural")]
+    InvalidAlignment,
+    #[error("type mismatch")]
+    TypeCheckFailed,
+    #[error("unknown label")]
+    InvalidLabelIdx,
+    #[error("unknown local")]
+    InvalidLocalIdx,
+    #[error("unknown type")]
+    InvalidFuncTypeIdx,
+    #[error("unknown function")]
+    InvalidFuncIdx,
+    #[error("unknown table")]
+    InvalidTableIdx,
+    #[error("unknown memory")]
+    InvalidMemoryIdx,
+    #[error("unknown global")]
+    InvalidGlobalIdx,
+    #[error("unknown elem segment")]
+    InvalidElemIdx,
+    #[error("unknown data segment")]
+    InvalidDataIdx,
+    #[error("undeclared function reference")]
+    InvalidRefIdx,
+    #[error("constant expression required")]
+    ConstExprRequired,
+    #[error("duplicate export name")]
+    DupExportName,
+    #[error("global is immutable")]
+    ImmutableGlobal,
+    #[error("invalid result arity")]
+    InvalidResultArity,
+    #[error("multiple tables")]
+    MultiTables,
+    #[error("multiple memories")]
+    MultiMemories,
+    #[error("size minimum must not be greater than maximum")]
+    InvalidLimit,
+    #[error("memory size must be at most 65536 pages (4GiB)")]
+    InvalidMemPages,
+    #[error("start function")]
+    InvalidStartFunc,
+    #[error("invalid lane index")]
+    InvalidLaneIdx,
+}
+
+/// The error type for the instantiation phase from WasmEdge Core.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum CoreInstantiationError {
+    #[error("module name conflict")]
+    ModuleNameConflict,
+    #[error("incompatible import type")]
+    IncompatibleImportType,
+    #[error("unknown import")]
+    UnknownImport,
+    #[error("data segment does not fit")]
+    DataSegDoesNotFit,
+    #[error("elements segment does not fit")]
+    ElemSegDoesNotFit,
+}
+
+/// The error type for the execution phase from WasmEdge Core.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum CoreExecutionError {
+    #[error("wrong instance address")]
+    WrongInstanceAddress,
+    #[error("wrong instance index")]
+    WrongInstanceIndex,
+    #[error("instruction type mismatch")]
+    InstrTypeMismatch,
+    #[error("function type mismatch")]
+    FuncTypeMismatch,
+    #[error("integer divide by zero")]
+    DivideByZero,
+    #[error("integer overflow")]
+    IntegerOverflow,
+    #[error("invalid conversion to integer")]
+    InvalidConvToInt,
+    #[error("out of bounds table access")]
+    TableOutOfBounds,
+    #[error("out of bounds memory access")]
+    MemoryOutOfBounds,
+    #[error("unreachable")]
+    Unreachable,
+    #[error("uninitialized element")]
+    UninitializedElement,
+    #[error("undefined element")]
+    UndefinedElement,
+    #[error("indirect call type mismatch")]
+    IndirectCallTypeMismatch,
+    #[error("host function failed")]
+    HostFuncFailed,
+    #[error("reference type mismatch")]
+    RefTypeMismatch,
+    #[error("unaligned atomic")]
+    UnalignedAtomicAccess,
+    #[error("expected shared memory")]
+    ExpectSharedMemory,
+}
+
+/// The error type for the host function definition.
+#[derive(Error, Clone, Debug, PartialEq, Eq)]
+pub enum HostFuncError {
+    #[error("User error: {0}")]
+    User(u32),
+    #[error("Runtime error: {0}")]
+    Runtime(u32),
+}
+
\ No newline at end of file diff --git a/src/wasmedge_types/lib.rs.html b/src/wasmedge_types/lib.rs.html new file mode 100644 index 000000000..5819e067d --- /dev/null +++ b/src/wasmedge_types/lib.rs.html @@ -0,0 +1,1165 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+
#![doc(
+    html_logo_url = "https://github.com/cncf/artwork/blob/master/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.png?raw=true",
+    html_favicon_url = "https://raw.githubusercontent.com/cncf/artwork/49169bdbc88a7ce3c4a722c641cc2d548bd5c340/projects/wasm-edge-runtime/icon/color/wasm-edge-runtime-icon-color.svg"
+)]
+
+//! The [wasmedge-types](https://crates.io/crates/wasmedge-types) crate defines a group of common data structures used by both [wasmedge-sdk](https://crates.io/crates/wasmedge-sdk) and [wasmedge-sys](https://crates.io/crates/wasmedge-sys) crates.
+//!
+//! See also
+//!
+//! * [WasmEdge Runtime](https://wasmedge.org/)
+
+pub mod error;
+
+/// Defines WasmEdge reference types.
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+pub enum RefType {
+    /// Refers to the infinite union of all references to host functions, regardless of their function types.
+    FuncRef,
+
+    /// Refers to the infinite union of all references to objects and that can be passed into WebAssembly under this type.
+    ExternRef,
+}
+impl From<u32> for RefType {
+    fn from(value: u32) -> Self {
+        match value {
+            112 => RefType::FuncRef,
+            111 => RefType::ExternRef,
+            _ => panic!("[wasmedge-types] Invalid WasmEdge_RefType: {value:#X}"),
+        }
+    }
+}
+impl From<RefType> for u32 {
+    fn from(value: RefType) -> Self {
+        match value {
+            RefType::FuncRef => 112,
+            RefType::ExternRef => 111,
+        }
+    }
+}
+impl From<i32> for RefType {
+    fn from(value: i32) -> Self {
+        match value {
+            112 => RefType::FuncRef,
+            111 => RefType::ExternRef,
+            _ => panic!("[wasmedge-types] Invalid WasmEdge_RefType: {value:#X}"),
+        }
+    }
+}
+impl From<RefType> for i32 {
+    fn from(value: RefType) -> Self {
+        match value {
+            RefType::FuncRef => 112,
+            RefType::ExternRef => 111,
+        }
+    }
+}
+
+/// Defines WasmEdge value types.
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+pub enum ValType {
+    /// 32-bit integer.
+    ///
+    /// Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.
+    I32,
+    /// 64-bit integer.
+    ///
+    /// Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.
+    I64,
+    /// 32-bit floating-point data as defined by the [IEEE 754-2019](https://ieeexplore.ieee.org/document/8766229).
+    F32,
+    /// 64-bit floating-point data as defined by the [IEEE 754-2019](https://ieeexplore.ieee.org/document/8766229).
+    F64,
+    /// 128-bit vector of packed integer or floating-point data.
+    ///
+    /// The packed data can be interpreted as signed or unsigned integers, single or double precision floating-point
+    /// values, or a single 128 bit type. The interpretation is determined by individual operations.
+    V128,
+    /// A reference to a host function.
+    FuncRef,
+    /// A reference to object.
+    ExternRef,
+}
+impl From<u32> for ValType {
+    fn from(value: u32) -> Self {
+        match value {
+            127 => ValType::I32,
+            126 => ValType::I64,
+            125 => ValType::F32,
+            124 => ValType::F64,
+            123 => ValType::V128,
+            112 => ValType::FuncRef,
+            111 => ValType::ExternRef,
+            _ => panic!("[wasmedge-types] Invalid WasmEdge_ValType: {value:#X}"),
+        }
+    }
+}
+impl From<ValType> for u32 {
+    fn from(value: ValType) -> Self {
+        match value {
+            ValType::I32 => 127,
+            ValType::I64 => 126,
+            ValType::F32 => 125,
+            ValType::F64 => 124,
+            ValType::V128 => 123,
+            ValType::FuncRef => 112,
+            ValType::ExternRef => 111,
+        }
+    }
+}
+impl From<i32> for ValType {
+    fn from(value: i32) -> Self {
+        match value {
+            127 => ValType::I32,
+            126 => ValType::I64,
+            125 => ValType::F32,
+            124 => ValType::F64,
+            123 => ValType::V128,
+            112 => ValType::FuncRef,
+            111 => ValType::ExternRef,
+            _ => panic!("[wasmedge-types] Invalid WasmEdge_ValType: {value:#X}"),
+        }
+    }
+}
+impl From<ValType> for i32 {
+    fn from(value: ValType) -> Self {
+        match value {
+            ValType::I32 => 127,
+            ValType::I64 => 126,
+            ValType::F32 => 125,
+            ValType::F64 => 124,
+            ValType::V128 => 123,
+            ValType::FuncRef => 112,
+            ValType::ExternRef => 111,
+        }
+    }
+}
+
+/// Defines the mutability property of WasmEdge Global variables.
+///
+/// `Mutability` determines the mutability property of a WasmEdge Global variable is either mutable or immutable.
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+pub enum Mutability {
+    /// Identifies an immutable global variable.
+    Const,
+    /// Identifies a mutable global variable.
+    Var,
+}
+impl From<u32> for Mutability {
+    fn from(value: u32) -> Self {
+        match value {
+            0 => Mutability::Const,
+            1 => Mutability::Var,
+            _ => panic!("[wasmedge-types] Invalid WasmEdge_Mutability: {value:#X}"),
+        }
+    }
+}
+impl From<Mutability> for u32 {
+    fn from(value: Mutability) -> Self {
+        match value {
+            Mutability::Const => 0,
+            Mutability::Var => 1,
+        }
+    }
+}
+impl From<i32> for Mutability {
+    fn from(value: i32) -> Self {
+        match value {
+            0 => Mutability::Const,
+            1 => Mutability::Var,
+            _ => panic!("[wasmedge-types] Invalid WasmEdge_Mutability: {value:#X}"),
+        }
+    }
+}
+impl From<Mutability> for i32 {
+    fn from(value: Mutability) -> Self {
+        match value {
+            Mutability::Const => 0,
+            Mutability::Var => 1,
+        }
+    }
+}
+
+/// Defines WasmEdge AOT compiler optimization level.
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum CompilerOptimizationLevel {
+    /// Disable as many optimizations as possible.
+    O0,
+
+    /// Optimize quickly without destroying debuggability.
+    O1,
+
+    /// Optimize for fast execution as much as possible without triggering significant incremental compile time or code size growth.
+    O2,
+
+    ///  Optimize for fast execution as much as possible.
+    O3,
+
+    ///  Optimize for small code size as much as possible without triggering
+    ///  significant incremental compile time or execution time slowdowns.
+    Os,
+
+    /// Optimize for small code size as much as possible.
+    Oz,
+}
+impl From<u32> for CompilerOptimizationLevel {
+    fn from(val: u32) -> CompilerOptimizationLevel {
+        match val {
+            0 => CompilerOptimizationLevel::O0,
+            1 => CompilerOptimizationLevel::O1,
+            2 => CompilerOptimizationLevel::O2,
+            3 => CompilerOptimizationLevel::O3,
+            4 => CompilerOptimizationLevel::Os,
+            5 => CompilerOptimizationLevel::Oz,
+            _ => panic!("Unknown CompilerOptimizationLevel value: {val}"),
+        }
+    }
+}
+impl From<CompilerOptimizationLevel> for u32 {
+    fn from(val: CompilerOptimizationLevel) -> u32 {
+        match val {
+            CompilerOptimizationLevel::O0 => 0,
+            CompilerOptimizationLevel::O1 => 1,
+            CompilerOptimizationLevel::O2 => 2,
+            CompilerOptimizationLevel::O3 => 3,
+            CompilerOptimizationLevel::Os => 4,
+            CompilerOptimizationLevel::Oz => 5,
+        }
+    }
+}
+impl From<i32> for CompilerOptimizationLevel {
+    fn from(val: i32) -> CompilerOptimizationLevel {
+        match val {
+            0 => CompilerOptimizationLevel::O0,
+            1 => CompilerOptimizationLevel::O1,
+            2 => CompilerOptimizationLevel::O2,
+            3 => CompilerOptimizationLevel::O3,
+            4 => CompilerOptimizationLevel::Os,
+            5 => CompilerOptimizationLevel::Oz,
+            _ => panic!("Unknown CompilerOptimizationLevel value: {val}"),
+        }
+    }
+}
+impl From<CompilerOptimizationLevel> for i32 {
+    fn from(val: CompilerOptimizationLevel) -> i32 {
+        match val {
+            CompilerOptimizationLevel::O0 => 0,
+            CompilerOptimizationLevel::O1 => 1,
+            CompilerOptimizationLevel::O2 => 2,
+            CompilerOptimizationLevel::O3 => 3,
+            CompilerOptimizationLevel::Os => 4,
+            CompilerOptimizationLevel::Oz => 5,
+        }
+    }
+}
+
+/// Defines WasmEdge AOT compiler output binary format.
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum CompilerOutputFormat {
+    /// Native dynamic library format.
+    Native,
+
+    /// WebAssembly with AOT compiled codes in custom sections.
+    Wasm,
+}
+impl From<u32> for CompilerOutputFormat {
+    fn from(val: u32) -> CompilerOutputFormat {
+        match val {
+            0 => CompilerOutputFormat::Native,
+            1 => CompilerOutputFormat::Wasm,
+            _ => panic!("Unknown CompilerOutputFormat value: {val}"),
+        }
+    }
+}
+impl From<CompilerOutputFormat> for u32 {
+    fn from(val: CompilerOutputFormat) -> u32 {
+        match val {
+            CompilerOutputFormat::Native => 0,
+            CompilerOutputFormat::Wasm => 1,
+        }
+    }
+}
+impl From<i32> for CompilerOutputFormat {
+    fn from(val: i32) -> CompilerOutputFormat {
+        match val {
+            0 => CompilerOutputFormat::Native,
+            1 => CompilerOutputFormat::Wasm,
+            _ => panic!("Unknown CompilerOutputFormat value: {val}"),
+        }
+    }
+}
+impl From<CompilerOutputFormat> for i32 {
+    fn from(val: CompilerOutputFormat) -> i32 {
+        match val {
+            CompilerOutputFormat::Native => 0,
+            CompilerOutputFormat::Wasm => 1,
+        }
+    }
+}
+
+/// Defines WasmEdge host module registration enum.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
+pub enum HostRegistration {
+    Wasi,
+    WasmEdgeProcess,
+    WasiNn,
+    WasiCryptoCommon,
+    WasiCryptoAsymmetricCommon,
+    WasiCryptoKx,
+    WasiCryptoSignatures,
+    WasiCryptoSymmetric,
+}
+impl From<u32> for HostRegistration {
+    fn from(val: u32) -> Self {
+        match val {
+            0 => HostRegistration::Wasi,
+            1 => HostRegistration::WasmEdgeProcess,
+            2 => HostRegistration::WasiNn,
+            3 => HostRegistration::WasiCryptoCommon,
+            4 => HostRegistration::WasiCryptoAsymmetricCommon,
+            5 => HostRegistration::WasiCryptoKx,
+            6 => HostRegistration::WasiCryptoSignatures,
+            7 => HostRegistration::WasiCryptoSymmetric,
+            _ => panic!("Unknown WasmEdge_HostRegistration value: {val}"),
+        }
+    }
+}
+impl From<HostRegistration> for u32 {
+    fn from(val: HostRegistration) -> u32 {
+        match val {
+            HostRegistration::Wasi => 0,
+            HostRegistration::WasmEdgeProcess => 1,
+            HostRegistration::WasiNn => 2,
+            HostRegistration::WasiCryptoCommon => 3,
+            HostRegistration::WasiCryptoAsymmetricCommon => 4,
+            HostRegistration::WasiCryptoKx => 5,
+            HostRegistration::WasiCryptoSignatures => 6,
+            HostRegistration::WasiCryptoSymmetric => 7,
+        }
+    }
+}
+
+/// Defines the type of external WasmEdge instances.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub enum ExternalInstanceType {
+    /// A WasmEdge instance that is a WasmEdge Func.
+    Func(FuncType),
+    /// A WasmEdge instance that is a WasmEdge Table.
+    Table(TableType),
+    /// A WasmEdge instance that is a WasmEdge Memory.
+    Memory(MemoryType),
+    /// A WasmEdge instance that is a WasmEdge Global.
+    Global(GlobalType),
+}
+impl From<u32> for ExternalInstanceType {
+    fn from(value: u32) -> Self {
+        match value {
+            0 => ExternalInstanceType::Func(FuncType::default()),
+            1 => ExternalInstanceType::Table(TableType::default()),
+            2 => ExternalInstanceType::Memory(MemoryType::default()),
+            3 => ExternalInstanceType::Global(GlobalType::default()),
+            _ => panic!("[wasmedge-types] Invalid WasmEdge_ExternalType: {value:#X}",),
+        }
+    }
+}
+impl From<i32> for ExternalInstanceType {
+    fn from(value: i32) -> Self {
+        match value {
+            0 => ExternalInstanceType::Func(FuncType::default()),
+            1 => ExternalInstanceType::Table(TableType::default()),
+            2 => ExternalInstanceType::Memory(MemoryType::default()),
+            3 => ExternalInstanceType::Global(GlobalType::default()),
+            _ => panic!("[wasmedge-types] Invalid WasmEdge_ExternalType: {value:#X}",),
+        }
+    }
+}
+impl std::fmt::Display for ExternalInstanceType {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        let message = match self {
+            ExternalInstanceType::Func(_) => "function",
+            ExternalInstanceType::Table(_) => "table",
+            ExternalInstanceType::Memory(_) => "memory",
+            ExternalInstanceType::Global(_) => "global",
+        };
+        write!(f, "{message}")
+    }
+}
+
+/// Struct of WasmEdge FuncType.
+///
+/// A [FuncType] is used to declare the types of the parameters and return values of a WasmEdge Func to be created.
+#[derive(Debug, Clone, PartialEq, Eq, Default)]
+pub struct FuncType {
+    args: Option<Vec<ValType>>,
+    returns: Option<Vec<ValType>>,
+}
+impl FuncType {
+    /// Creates a new [FuncType] with the given types of arguments and returns.
+    ///
+    /// # Arguments
+    ///
+    /// * `args` - A vector of [ValType]s that represent the types of the arguments.
+    ///
+    /// * `returns` - A vector of [ValType]s that represent the types of the returns.
+    pub fn new(args: Option<Vec<ValType>>, returns: Option<Vec<ValType>>) -> Self {
+        Self { args, returns }
+    }
+
+    /// Returns the types of the arguments of a host function.
+    pub fn args(&self) -> Option<&[ValType]> {
+        match &self.args {
+            Some(args) => Some(args.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns the number of the arguments of a host function.
+    pub fn args_len(&self) -> u32 {
+        match &self.args {
+            Some(args) => args.len() as u32,
+            None => 0,
+        }
+    }
+
+    /// Returns the types of the returns of a host function.
+    pub fn returns(&self) -> Option<&[ValType]> {
+        match &self.returns {
+            Some(returns) => Some(returns.as_ref()),
+            None => None,
+        }
+    }
+
+    /// Returns the number of the returns of a host function.
+    pub fn returns_len(&self) -> u32 {
+        match &self.returns {
+            Some(returns) => returns.len() as u32,
+            None => 0,
+        }
+    }
+}
+
+/// Struct of WasmEdge TableType.
+///
+/// A [TableType] is used to declare the element type and the size range of a WasmEdge Table to be created.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct TableType {
+    elem_ty: RefType,
+    min: u32,
+    max: Option<u32>,
+}
+impl TableType {
+    /// Creates a new [TableType] with the given element type and the size range.
+    ///
+    /// # Arguments
+    ///
+    /// * `elem_ty` - The element type of the table to be created.
+    ///
+    /// * `min` - The minimum size of the table to be created.
+    ///
+    /// * `max` - The maximum size of the table to be created.    
+    pub fn new(elem_ty: RefType, min: u32, max: Option<u32>) -> Self {
+        Self { elem_ty, min, max }
+    }
+
+    /// Returns the element type defined in the [TableType].
+    pub fn elem_ty(&self) -> RefType {
+        self.elem_ty
+    }
+
+    /// Returns the minimum size defined in the [TableType].
+    pub fn minimum(&self) -> u32 {
+        self.min
+    }
+
+    /// Returns the maximum size defined in the [TableType].
+    pub fn maximum(&self) -> Option<u32> {
+        self.max
+    }
+}
+impl Default for TableType {
+    fn default() -> Self {
+        Self {
+            elem_ty: RefType::FuncRef,
+            min: 0,
+            max: None,
+        }
+    }
+}
+
+/// Struct of WasmEdge MemoryType.
+///
+/// A [MemoryType] is used to declare the size range of a WasmEdge Memory to be created.
+#[derive(Debug, Clone, PartialEq, Eq, Default)]
+pub struct MemoryType {
+    min: u32,
+    max: Option<u32>,
+    shared: bool,
+}
+impl MemoryType {
+    /// Creates a new [MemoryType] with the given size range.
+    ///
+    /// # Arguments
+    ///
+    /// * `min` - The minimum size of the memory to be created.
+    ///
+    /// * `max` - The maximum size of the memory to be created. If `shared` is set to true, `max` must be set.
+    ///
+    /// * `shared` - Enables shared memory if true.
+    pub fn new(min: u32, max: Option<u32>, shared: bool) -> WasmEdgeResult<Self> {
+        if shared && max.is_none() {
+            return Err(Box::new(error::WasmEdgeError::Mem(
+                error::MemError::CreateSharedType,
+            )));
+        }
+        Ok(Self { min, max, shared })
+    }
+
+    /// Returns the minimum size defined in the [MemoryType].
+    pub fn minimum(&self) -> u32 {
+        self.min
+    }
+
+    /// Returns the maximum size defined in the [MemoryType].
+    pub fn maximum(&self) -> Option<u32> {
+        self.max
+    }
+
+    /// Returns whether the memory is shared.
+    pub fn shared(&self) -> bool {
+        self.shared
+    }
+}
+
+/// Struct of WasmEdge GlobalType.
+///
+/// A [GlobalType] is used to declare the type of a WasmEdge Global to be created.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct GlobalType {
+    ty: ValType,
+    mutability: Mutability,
+}
+impl GlobalType {
+    /// Creates a new [GlobalType] with the given value type and mutability.
+    ///
+    /// # Arguments
+    ///
+    /// * `ty` - The value type of the global to be created.
+    ///
+    /// * `mutability` - The value mutability property of the global to be created.
+    pub fn new(ty: ValType, mutability: Mutability) -> Self {
+        Self { ty, mutability }
+    }
+
+    /// Returns the value type defined in the [GlobalType].
+    pub fn value_ty(&self) -> ValType {
+        self.ty
+    }
+
+    /// Returns the value mutability property defined in the [GlobalType].
+    pub fn mutability(&self) -> Mutability {
+        self.mutability
+    }
+}
+impl Default for GlobalType {
+    fn default() -> Self {
+        Self {
+            ty: ValType::I32,
+            mutability: Mutability::Var,
+        }
+    }
+}
+
+/// Parses in-memory bytes as either the [WebAssembly Text format](http://webassembly.github.io/spec/core/text/index.html), or a binary WebAssembly module.
+pub use wat::parse_bytes as wat2wasm;
+
+/// The WasmEdge result type.
+pub type WasmEdgeResult<T> = Result<T, Box<error::WasmEdgeError>>;
+
+/// This is a workaround solution to the [`never`](https://doc.rust-lang.org/std/primitive.never.html) type in Rust. It will be replaced by `!` once it is stable.
+#[derive(Debug, Clone)]
+pub enum NeverType {}
+unsafe impl Send for NeverType {}
+unsafe impl Sync for NeverType {}
+
\ No newline at end of file diff --git a/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/static.files/COPYRIGHT-23e9bde6c69aea69.txt new file mode 100644 index 000000000..1447df792 --- /dev/null +++ b/static.files/COPYRIGHT-23e9bde6c69aea69.txt @@ -0,0 +1,50 @@ +# REUSE-IgnoreStart + +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. + +# REUSE-IgnoreEnd diff --git a/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt new file mode 100644 index 000000000..d7e9c149b --- /dev/null +++ b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt @@ -0,0 +1,98 @@ +// REUSE-IgnoreStart + +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 new file mode 100644 index 000000000..7a1e5fc54 Binary files /dev/null and b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 differ diff --git a/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 new file mode 100644 index 000000000..e766e06cc Binary files /dev/null and b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 differ diff --git a/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/static.files/LICENSE-MIT-65090b722b3f6c56.txt new file mode 100644 index 000000000..31aa79387 --- /dev/null +++ b/static.files/LICENSE-MIT-65090b722b3f6c56.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 new file mode 100644 index 000000000..1866ad4bc Binary files /dev/null and b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 differ diff --git a/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt new file mode 100644 index 000000000..4b3edc29e --- /dev/null +++ b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt @@ -0,0 +1,103 @@ +// REUSE-IgnoreStart + +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 new file mode 100644 index 000000000..462c34efc Binary files /dev/null and b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 differ diff --git a/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt new file mode 100644 index 000000000..0d2941e14 --- /dev/null +++ b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt @@ -0,0 +1,97 @@ +// REUSE-IgnoreStart + +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 new file mode 100644 index 000000000..10b558e0b Binary files /dev/null and b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 differ diff --git a/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 new file mode 100644 index 000000000..5ec64eef0 Binary files /dev/null and b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 differ diff --git a/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 new file mode 100644 index 000000000..181a07f63 Binary files /dev/null and b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ diff --git a/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 new file mode 100644 index 000000000..2ae08a7be Binary files /dev/null and b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ diff --git a/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md new file mode 100644 index 000000000..175fa4f47 --- /dev/null +++ b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md @@ -0,0 +1,98 @@ + + +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. +Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + + diff --git a/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 new file mode 100644 index 000000000..0263fc304 Binary files /dev/null and b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ diff --git a/static.files/clipboard-7571035ce49a181d.svg b/static.files/clipboard-7571035ce49a181d.svg new file mode 100644 index 000000000..8adbd9963 --- /dev/null +++ b/static.files/clipboard-7571035ce49a181d.svg @@ -0,0 +1 @@ + diff --git a/static.files/favicon-16x16-8b506e7a72182f1c.png b/static.files/favicon-16x16-8b506e7a72182f1c.png new file mode 100644 index 000000000..ea4b45cae Binary files /dev/null and b/static.files/favicon-16x16-8b506e7a72182f1c.png differ diff --git a/static.files/favicon-2c020d218678b618.svg b/static.files/favicon-2c020d218678b618.svg new file mode 100644 index 000000000..8b34b5119 --- /dev/null +++ b/static.files/favicon-2c020d218678b618.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/static.files/favicon-32x32-422f7d1d52889060.png b/static.files/favicon-32x32-422f7d1d52889060.png new file mode 100644 index 000000000..69b8613ce Binary files /dev/null and b/static.files/favicon-32x32-422f7d1d52889060.png differ diff --git a/static.files/main-f06f02fd918e3bb3.js b/static.files/main-f06f02fd918e3bb3.js new file mode 100644 index 000000000..562893145 --- /dev/null +++ b/static.files/main-f06f02fd918e3bb3.js @@ -0,0 +1,12 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function elemIsInParent(elem,parent){while(elem&&elem!==document.body){if(elem===parent){return true}elem=elem.parentElement}return false}function blurHandler(event,parentElem,hideCallback){if(!elemIsInParent(document.activeElement,parentElem)&&!elemIsInParent(event.relatedTarget,parentElem)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerText=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}})}}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(link.href===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","));for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";if(window.rootPath!=="./"&&crate===window.currentCrate){link.className="current"}link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px")}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!elemIsInParent(ev.relatedTarget,e)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!elemIsInParent(document.activeElement,window.CURRENT_TOOLTIP_ELEMENT)&&!elemIsInParent(event.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT)&&!elemIsInParent(document.activeElement,window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE)&&!elemIsInParent(event.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!elemIsInParent(ev.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ +the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/static.files/normalize-76eba96aa4d2e634.css b/static.files/normalize-76eba96aa4d2e634.css new file mode 100644 index 000000000..469959f13 --- /dev/null +++ b/static.files/normalize-76eba96aa4d2e634.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/static.files/noscript-5d8b3c7633ad77ba.css b/static.files/noscript-5d8b3c7633ad77ba.css new file mode 100644 index 000000000..8c63ef065 --- /dev/null +++ b/static.files/noscript-5d8b3c7633ad77ba.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path{display:none;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);}@media (prefers-color-scheme:dark){:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);}} \ No newline at end of file diff --git a/static.files/rust-logo-151179464ae7ed46.svg b/static.files/rust-logo-151179464ae7ed46.svg new file mode 100644 index 000000000..62424d8ff --- /dev/null +++ b/static.files/rust-logo-151179464ae7ed46.svg @@ -0,0 +1,61 @@ + + + diff --git a/static.files/rustdoc-9ee3a5e31a2afa3e.css b/static.files/rustdoc-9ee3a5e31a2afa3e.css new file mode 100644 index 000000000..8749d0eb1 --- /dev/null +++ b/static.files/rustdoc-9ee3a5e31a2afa3e.css @@ -0,0 +1,10 @@ + :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.small-section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.sub-logo-container,.logo-container{line-height:0;display:block;}.sub-logo-container{margin-right:32px;}.sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 200px;overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;}.rustdoc.src .sidebar{flex-basis:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;z-index:1;}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}#src-sidebar-toggle>button:hover,#src-sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.src .sidebar>*:not(#src-sidebar-toggle){visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:300px;}.src-sidebar-expanded .src .sidebar>*:not(#src-sidebar-toggle){visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.5rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.5rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;margin-top:calc((-16px + 0.57rem ) / 2 );}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}.method .where,.fn .where,.where.fmt-newline{display:block;white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.small-section-header{display:block;position:relative;}.small-section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block a.current{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ + ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:2;margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ + \ + ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{min-height:36px;display:flex;padding:3px;margin-bottom:5px;align-items:center;vertical-align:text-bottom;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji{font-size:1.25rem;margin-right:0.3rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar-toggle{position:sticky;top:0;left:0;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:stretch;align-items:stretch;z-index:10;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid var(--border-color);margin-bottom:6px;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}#src-sidebar-toggle>button{font-size:inherit;font-weight:bold;background:none;color:inherit;text-align:center;border:none;outline:none;flex:1 1;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;display:flex;}#settings-menu>a,#help-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus{border-color:var(--settings-button-border-focus);}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;margin-left:10px;padding:0;padding-left:2px;border:0;width:33px;}#copy-path>img{filter:var(--copy-path-img-filter);}#copy-path:hover>img{filter:var(--copy-path-img-hover-filter);}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;}.mobile-topbar h2 a{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;color:var(--main-color);}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#src-sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;border:1px solid;border-left:0;}.src-sidebar-expanded #src-sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;position:sticky;border:0;border-bottom:1px solid;}#copy-path,#help-button{display:none;}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{max-width:100vw;width:100vw;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}.sub-logo-container>img{height:35px;width:35px;margin-bottom:var(--nav-sub-mobile-padding);}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"]{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a,:root[data-theme="ayu"] #source-sidebar>.title{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img{filter:invert(100);} \ No newline at end of file diff --git a/static.files/scrape-examples-ef1e698c1d417c0c.js b/static.files/scrape-examples-ef1e698c1d417c0c.js new file mode 100644 index 000000000..ba830e374 --- /dev/null +++ b/static.files/scrape-examples-ef1e698c1d417c0c.js @@ -0,0 +1 @@ +"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/static.files/search-8fbf244ebcf71464.js b/static.files/search-8fbf244ebcf71464.js new file mode 100644 index 000000000..168023b4b --- /dev/null +++ b/static.files/search-8fbf244ebcf71464.js @@ -0,0 +1,5 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias","generic",];const longItemTypes=["module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","primitive type","assoc type","constant","assoc const","union","foreign type","keyword","existential type","attribute macro","derive macro","trait alias",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_KEYWORD=itemTypes.indexOf("keyword");const TY_GENERIC=itemTypes.indexOf("generic");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let currentResults;let typeNameIdMap;const ALIASES=new Map();let typeNameIdOfArray;let typeNameIdOfSlice;let typeNameIdOfArrayOrSlice;function buildTypeMapIndex(name){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){return typeNameIdMap.get(name)}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,id);return id}}function isWhitespace(c){return" \t\n\r".indexOf(c)!==-1}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return",>-]".indexOf(c)!==-1}function isStopCharacter(c){return isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","}function isPathSeparator(c){return c===":"||isWhitespace(c)}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(!isWhitespace(c)){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}return{name:"never",id:null,fullPath:["never"],pathWithoutLast:[],pathLast:"never",generics:[],typeFilter:"primitive",}}if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(path.includes("::::")){throw["Unexpected ","::::"]}else if(path.includes(" ::")){throw["Unexpected "," ::"]}else if(path.includes(":: ")){throw["Unexpected ",":: "]}const pathSegments=path.split(/::|\s+/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast:pathSegments[pathSegments.length-1],generics:generics,typeFilter,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let start=parserState.pos;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",","," or ",endChar,...extra,", found ",c,]}throw["Expected ",",",...extra,", found ",c,]}const posBefore=parserState.pos;start=parserState.pos;getNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;parserState.typeFilter=oldTypeFilter}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;let start=parserState.pos;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}throw["Unexpected ",c]}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}else if(query.elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=query.elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;foundStopChar=true;continue}else if(isWhitespace(c)){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;start=parserState.pos;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}}userQuery=userQuery.trim();const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,searchWords,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}duplicates.add(obj.fullPath);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){if(results.size===0){return[]}const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=aaa.item.deprecated;b=bbb.item.deprecated;if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});let nameSplit=null;if(parsedQuery.elems.length===1){const hasPath=typeof parsedQuery.elems[0].path==="undefined";nameSplit=hasPath?null:parsedQuery.elems[0].path}for(const result of result_list){if(result.dontValidate){continue}const name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(!isType&&!validateResult(name,path,nameSplit,parent)){result.id=-1}}return transformResults(result_list)}function checkGenerics(fnType,queryElem,whereClause,mgensInout){return unifyFunctionTypes(fnType.generics,queryElem.generics,whereClause,mgensInout,mgens=>{if(mgensInout){for(const[fid,qid]of mgens.entries()){mgensInout.set(fid,qid)}}return true})}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb){let mgens=new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;let fl=fnTypesIn.length;let fnTypes=fnTypesIn.slice();const backtracking=[];let i=0;let j=0;const backtrack=()=>{while(backtracking.length!==0){const{fnTypesScratch,mgensScratch,queryElemsOffset,fnTypesOffset,unbox,}=backtracking.pop();mgens=new Map(mgensScratch);const fnType=fnTypesScratch[fnTypesOffset];const queryElem=queryElems[queryElemsOffset];if(unbox){if(fnType.id<0){if(mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}mgens.set(fnType.id,0)}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;fnTypes=fnTypesScratch.toSpliced(fnTypesOffset,1,...generics);fl=fnTypes.length;i=queryElemsOffset-1}else{if(fnType.id<0){if(mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}mgens.set(fnType.id,queryElem.id)}fnTypes=fnTypesScratch.slice();fl=fnTypes.length;const tmp=fnTypes[queryElemsOffset];fnTypes[queryElemsOffset]=fnTypes[fnTypesOffset];fnTypes[fnTypesOffset]=tmp;i=queryElemsOffset}return true}return false};for(i=0;i!==ql;++i){const queryElem=queryElems[i];const matchCandidates=[];let fnTypesScratch=null;let mgensScratch=null;for(j=i;j!==fl;++j){const fnType=fnTypes[j];if(unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens)){if(!fnTypesScratch){fnTypesScratch=fnTypes.slice()}unifyFunctionTypes(fnType.generics,queryElem.generics,whereClause,mgens,mgensScratch=>{matchCandidates.push({fnTypesScratch,mgensScratch,queryElemsOffset:i,fnTypesOffset:j,unbox:false,});return false})}if(unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens)){if(!fnTypesScratch){fnTypesScratch=fnTypes.slice()}if(!mgensScratch){mgensScratch=new Map(mgens)}backtracking.push({fnTypesScratch,mgensScratch,queryElemsOffset:i,fnTypesOffset:j,unbox:true,})}}if(matchCandidates.length===0){if(backtrack()){continue}else{return false}}const{fnTypesOffset:candidate,mgensScratch:mgensNew}=matchCandidates.pop();if(fnTypes[candidate].id<0&&queryElems[i].id<0){mgens.set(fnTypes[candidate].id,queryElems[i].id)}for(const[fid,qid]of mgensNew){mgens.set(fid,qid)}const tmp=fnTypes[candidate];fnTypes[candidate]=fnTypes[i];fnTypes[i]=tmp;for(const otherCandidate of matchCandidates){backtracking.push(otherCandidate)}while(i===(ql-1)&&solutionCb&&!solutionCb(mgens)){if(!backtrack()){return false}}}return true}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgens.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(fnType.id!==queryElem.id){return false}if(fnType.generics.length===0&&queryElem.generics.length!==0){return false}const queryElemPathLength=queryElem.pathWithoutLast.length;if(queryElemPathLength>0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i=0){if(!whereClause){return false}if(mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause)}else if(fnType.generics&&fnType.generics.length>0){return checkIfInList(fnType.generics,queryElem,whereClause)}return false}function checkIfInList(list,elem,whereClause){for(const entry of list){if(checkType(entry,elem,whereClause)){return true}}return false}function checkType(row,elem,whereClause){if(row.id===null){return row.generics.length>0?checkIfInList(row.generics,elem,whereClause):false}if(row.id<0&&elem.id>=0){const gid=(-row.id)-1;return checkIfInList(whereClause[gid],elem,whereClause)}if(row.id<0&&elem.id<0){return true}const matchesExact=row.id===elem.id;const matchesArrayOrSlice=elem.id===typeNameIdOfArrayOrSlice&&(row.id===typeNameIdOfSlice||row.id===typeNameIdOfArray);if((matchesExact||matchesArrayOrSlice)&&typePassesFilter(elem.typeFilter,row.ty)){if(elem.generics.length>0){return checkGenerics(row,elem,whereClause,new Map())}return true}return checkIfInList(row.generics,elem,whereClause)}function checkPath(contains,ty,maxEditDistance){if(contains.length===0){return 0}let ret_dist=maxEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;if(clength>length){return maxEditDistance+1}for(let i=0;ilength){break}let dist_total=0;let aborted=false;for(let x=0;xmaxEditDistance){aborted=true;break}dist_total+=dist}if(!aborted){ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}}return ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,deprecated:item.deprecated,implDisambiguator:item.implDisambiguator,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){const inBounds=dist<=maxEditDistance||index!==-1;if(dist===0||(!parsedQuery.literalSearch&&inBounds)){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let index=-1,path_dist=0;const fullId=row.id;const searchWord=searchWords[pos];const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause);if(in_args){addIntoResults(results_in_args,fullId,pos,-1,0,0,maxEditDistance)}const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause);if(returned){addIntoResults(results_returned,fullId,pos,-1,0,0,maxEditDistance)}if(!typePassesFilter(elem.typeFilter,row.ty)){return}const row_index=row.normalizedName.indexOf(elem.pathLast);const word_index=searchWord.indexOf(elem.pathLast);if(row_index===-1){index=word_index}else if(word_index===-1){index=row_index}else if(word_index1){path_dist=checkPath(elem.pathWithoutLast,row,maxEditDistance);if(path_dist>maxEditDistance){return}}if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(searchWord,elem.pathLast,maxEditDistance);if(index===-1&&dist+path_dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens)})){return}addIntoResults(results,row.id,pos,0,0,0,Number.MAX_VALUE)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;let queryLen=0;for(const elem of parsedQuery.elems){queryLen+=elem.name.length}for(const elem of parsedQuery.returned){queryLen+=elem.name.length}const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem){if(typeNameIdMap.has(elem.pathLast)){elem.id=typeNameIdMap.get(elem.pathLast)}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,id]of typeNameIdMap){const dist=editDistance(name,elem.pathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}}for(const elem of parsedQuery.elems){convertNameToId(elem)}for(const elem of parsedQuery.returned){convertNameToId(elem)}if(parsedQuery.foundElems===1){if(parsedQuery.elems.length===1){elem=parsedQuery.elems[0];for(i=0,nSearchWords=searchWords.length;i0){for(i=0,nSearchWords=searchWords.length;i-1||path.indexOf(key)>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(key)>-1)||editDistance(name,key,maxEditDistance)<=maxEditDistance)){return false}}return true}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor=type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html#"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){let extraClass="";if(display===true){extraClass=" active"}const output=document.createElement("div");let length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";length+=1;const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";const crates_list=Object.keys(rawSearchIndex);if(crates_list.length>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}function search(e,forced){if(e){e.preventDefault()}const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));showResults(execQuery(query,searchWords,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.map(type=>buildItemSearchType(type,lowercasePaths))}function buildItemSearchType(type,lowercasePaths){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;let pathIndex,generics;if(typeof type==="number"){pathIndex=type;generics=[]}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths)}if(pathIndex<0){return{id:pathIndex,ty:TY_GENERIC,path:null,generics,}}if(pathIndex===0){return{id:null,ty:null,path:null,generics,}}const item=lowercasePaths[pathIndex-1];return{id:buildTypeMapIndex(item.name),ty:item.ty,path:item.path,generics,}}function buildFunctionSearchType(functionSearchType,lowercasePaths){const INPUTS_DATA=0;const OUTPUT_DATA=1;if(functionSearchType===0){return null}let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}lowercasePaths.push({ty:ty,name:name.toLowerCase(),path:path});paths[i]={ty:ty,name:name,path:path}}lastPath="";len=itemTypes.length;for(let i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:buildFunctionSearchType(itemFunctionSearchTypes[i],lowercasePaths),id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),deprecated:deprecatedItems.has(i),implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=crateSize}return searchWords}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(undefined,true)}const searchWords=buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}return searchWords}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch({})}})() \ No newline at end of file diff --git a/static.files/settings-74424d7eec62a23e.js b/static.files/settings-74424d7eec62a23e.js new file mode 100644 index 000000000..3014f75c5 --- /dev/null +++ b/static.files/settings-74424d7eec62a23e.js @@ -0,0 +1,17 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ +
+
${setting_name}
+
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ + `});output+=`\ +
+
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ +
\ + \ +
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display=""}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(elemIsInParent(event.target,settingsMenu)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/static.files/src-script-3280b574d94e47b4.js b/static.files/src-script-3280b574d94e47b4.js new file mode 100644 index 000000000..9ea88921e --- /dev/null +++ b/static.files/src-script-3280b574d94e47b4.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth"){addClass(document.documentElement,"src-sidebar-expanded");child.innerText="<";updateLocalStorage("source-sidebar-show","true")}else{removeClass(document.documentElement,"src-sidebar-expanded");child.innerText=">";updateLocalStorage("source-sidebar-show","false")}}function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="src-sidebar-toggle";const inner=document.createElement("button");if(getCurrentValue("source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}inner.onclick=toggleSidebar;sidebarToggle.appendChild(inner);return sidebarToggle}function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(srcIndex).forEach(key=>{srcIndex[key][NAME_OFFSET]=key;hasFoundFile=createDirEntry(srcIndex[key],sidebar,"",hasFoundFile)});container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}const lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSrcLines(match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",()=>{const match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSrcLines(match)}});onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/static.files/storage-fec3eaa3851e447d.js b/static.files/storage-fec3eaa3851e447d.js new file mode 100644 index 000000000..a687118f3 --- /dev/null +++ b/static.files/storage-fec3eaa3851e447d.js @@ -0,0 +1 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func,reversed){if(arr&&arr.length>0){if(reversed){for(let i=arr.length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(const elem of arr){if(func(elem)){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+newThemeName+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0)}}) \ No newline at end of file diff --git a/static.files/wheel-7b819b6101059cd0.svg b/static.files/wheel-7b819b6101059cd0.svg new file mode 100644 index 000000000..83c07f63d --- /dev/null +++ b/static.files/wheel-7b819b6101059cd0.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/trait.impl/bitflags/traits/trait.Flags.js b/trait.impl/bitflags/traits/trait.Flags.js new file mode 100644 index 000000000..290674ebe --- /dev/null +++ b/trait.impl/bitflags/traits/trait.Flags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl Flags for OFlags"],["impl Flags for RiFlags"],["impl Flags for WASIRights"],["impl Flags for Lookupflags"],["impl Flags for FdFlags"],["impl Flags for RoFlags"],["impl Flags for SiFlags"],["impl Flags for SdFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/bitflags/traits/trait.PublicFlags.js b/trait.impl/bitflags/traits/trait.PublicFlags.js new file mode 100644 index 000000000..620ea9bac --- /dev/null +++ b/trait.impl/bitflags/traits/trait.PublicFlags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl PublicFlags for SdFlags"],["impl PublicFlags for OFlags"],["impl PublicFlags for SiFlags"],["impl PublicFlags for RoFlags"],["impl PublicFlags for FdFlags"],["impl PublicFlags for RiFlags"],["impl PublicFlags for WASIRights"],["impl PublicFlags for Lookupflags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/clone/trait.Clone.js b/trait.impl/core/clone/trait.Clone.js new file mode 100644 index 000000000..a6edd8149 --- /dev/null +++ b/trait.impl/core/clone/trait.Clone.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl Clone for __wasi_filestat_t"],["impl Clone for SerialPreOpen"],["impl<T: Clone> Clone for ObjectPool<T>"],["impl Clone for FdStat"],["impl Clone for __wasi_addrinfo_t"],["impl Clone for __wasi_prestat_dir_t"],["impl Clone for __wasi_address_t"],["impl Clone for SubscriptionClock"],["impl Clone for SerialWasiDir"],["impl Clone for SubscriptionFd"],["impl Clone for SerialTcpServer"],["impl Clone for SerialUdpSocket"],["impl Clone for WasiCtx"],["impl Clone for __wasi_event_t"],["impl Clone for __wasi_subscription_fd_readwrite_t"],["impl Clone for WasiSocketState"],["impl Clone for __wasi_ciovec_t"],["impl Clone for SocketType"],["impl Clone for WASIRights"],["impl Clone for SerialVFD"],["impl Clone for SerialConnectState"],["impl Clone for WasiSockaddr"],["impl Clone for SerialStdout"],["impl<T: Clone + Sized> Clone for WasmPtr<T>"],["impl Clone for IoState"],["impl<T: Clone> Clone for ObjectNode<T>"],["impl Clone for SerialSocketType"],["impl Clone for Subscription"],["impl Clone for __wasi_subscription_clock_t"],["impl Clone for __wasi_dirent_t"],["impl Clone for __wasi_sockaddr_t"],["impl Clone for ConnectState"],["impl Clone for FileType"],["impl Clone for __wasi_fdstat_t"],["impl Clone for __wasi_iovec_t"],["impl Clone for __wasi_prestat_u_t"],["impl Clone for Filestat"],["impl Clone for WasiAddrinfo"],["impl Clone for SerialWasiCtx"],["impl Clone for Errno"],["impl Clone for SerialWasiFile"],["impl Clone for PollFdState"],["impl Clone for SubscriptionFdType"],["impl Clone for __wasi_sockaddr_in_t"],["impl Clone for SerialWasiSocketState"],["impl Clone for __wasi_event_fd_readwrite_t"],["impl Clone for SerialStdin"],["impl Clone for __wasi_prestat_t"],["impl Clone for __wasi_subscription_t"],["impl Clone for AddressFamily"],["impl Clone for AddressFamily"],["impl<T: Clone> Clone for SerialObjectPool<T>"],["impl Clone for SerialStderr"],["impl Clone for __wasi_subscription_u_u_t"],["impl Clone for FdFlags"],["impl Clone for Advice"],["impl Clone for __wasi_subscription_u_t"],["impl Clone for __wasi_timeval"]], +"wasmedge_sdk":[["impl Clone for CommonConfigOptions"],["impl Clone for WasiInstance"],["impl Clone for RuntimeConfigOptions"],["impl Clone for Store"],["impl Clone for PluginModule"],["impl Clone for Module"],["impl Clone for Func"],["impl Clone for GraphEncoding"],["impl Clone for Instance"],["impl Clone for CompilerConfigOptions"],["impl Clone for Table"],["impl<T: Clone + ?Sized + Send + Sync + Clone> Clone for ImportObject<T>"],["impl Clone for Config"],["impl Clone for ExternRef"],["impl Clone for StatisticsConfigOptions"],["impl Clone for Global"],["impl Clone for Vm"],["impl Clone for ExecutionTarget"],["impl Clone for HostRegistrationConfigOptions"],["impl Clone for Memory"],["impl Clone for Val"],["impl Clone for FuncRef"],["impl Clone for Executor"],["impl Clone for Statistics"]], +"wasmedge_sys":[["impl Clone for WasmEdge_ImportTypeContext"],["impl Clone for Store"],["impl Clone for WasmEdge_TableTypeContext"],["impl Clone for Global"],["impl Clone for Statistics"],["impl Clone for WasmEdge_ModuleInstanceContext"],["impl Clone for WasmEdge_PluginDescriptor"],["impl Clone for WasmEdge_StatisticsContext"],["impl Clone for WasmEdge_GlobalInstanceContext"],["impl Clone for WasmEdge_PluginVersionData"],["impl Clone for WasmEdge_ValidatorContext"],["impl Clone for WasmEdge_ProgramOption"],["impl Clone for WasmEdge_FunctionTypeContext"],["impl Clone for WasmValue"],["impl Clone for Instance"],["impl Clone for WasmEdge_Async"],["impl Clone for FuncRef"],["impl<T: Clone + ?Sized + Send + Sync + Clone> Clone for ImportModule<T>"],["impl Clone for Module"],["impl Clone for Table"],["impl Clone for WasmEdge_TableInstanceContext"],["impl Clone for Function"],["impl Clone for WasmEdge_CallingFrameContext"],["impl Clone for WasmEdge_ExecutorContext"],["impl Clone for WasiInstance"],["impl Clone for WasmEdge_MemoryTypeContext"],["impl Clone for WasmEdge_GlobalTypeContext"],["impl Clone for WasmEdge_Limit"],["impl Clone for WasmEdge_MemoryInstanceContext"],["impl Clone for WasmEdge_FunctionInstanceContext"],["impl Clone for WasmEdge_Value"],["impl Clone for ProgramOptionType"],["impl Clone for WasmEdge_ConfigureContext"],["impl Clone for Memory"],["impl Clone for PluginModule"],["impl Clone for __fsid_t"],["impl Clone for WasmEdge_ModuleDescriptor"],["impl Clone for WasmEdge_ExportTypeContext"],["impl Clone for WasmEdge_Result"],["impl Clone for Executor"],["impl Clone for WasmEdge_CompilerContext"],["impl Clone for WasmEdge_VMContext"],["impl Clone for WasmEdge_String"],["impl Clone for WasmEdge_StoreContext"],["impl Clone for WasmEdge_ASTModuleContext"],["impl Clone for Config"],["impl Clone for WasmEdge_PluginContext"],["impl Clone for WasmEdge_LoaderContext"],["impl Clone for WasiModule"]], +"wasmedge_types":[["impl Clone for ExportError"],["impl Clone for ExternalInstanceType"],["impl Clone for TableType"],["impl Clone for GlobalType"],["impl Clone for InstanceError"],["impl Clone for FuncType"],["impl Clone for PluginError"],["impl Clone for ImportError"],["impl Clone for NeverType"],["impl Clone for WasmEdgeError"],["impl Clone for CoreError"],["impl Clone for GlobalError"],["impl Clone for HostRegistration"],["impl Clone for Mutability"],["impl Clone for TableError"],["impl Clone for CompilerOptimizationLevel"],["impl Clone for ValType"],["impl Clone for CoreValidationError"],["impl Clone for CoreInstantiationError"],["impl Clone for FuncError"],["impl Clone for CoreExecutionError"],["impl Clone for HostFuncError"],["impl Clone for CompilerOutputFormat"],["impl Clone for RefType"],["impl Clone for MemoryType"],["impl Clone for CoreLoadError"],["impl Clone for VmError"],["impl Clone for StoreError"],["impl Clone for MemError"],["impl Clone for CoreCommonError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Eq.js b/trait.impl/core/cmp/trait.Eq.js new file mode 100644 index 000000000..5c8794b90 --- /dev/null +++ b/trait.impl/core/cmp/trait.Eq.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl Eq for FileType"],["impl Eq for ConnectState"],["impl Eq for Filestat"],["impl Eq for Errno"]], +"wasmedge_sdk":[["impl Eq for GraphEncoding"],["impl Eq for ExecutionTarget"]], +"wasmedge_sys":[["impl Eq for ProgramOptionType"]], +"wasmedge_types":[["impl Eq for ImportError"],["impl Eq for CoreExecutionError"],["impl Eq for RefType"],["impl Eq for CoreInstantiationError"],["impl Eq for FuncType"],["impl Eq for ExportError"],["impl Eq for CoreCommonError"],["impl Eq for PluginError"],["impl Eq for CompilerOutputFormat"],["impl Eq for HostFuncError"],["impl Eq for VmError"],["impl Eq for TableError"],["impl Eq for MemoryType"],["impl Eq for CoreValidationError"],["impl Eq for MemError"],["impl Eq for TableType"],["impl Eq for CoreError"],["impl Eq for GlobalType"],["impl Eq for InstanceError"],["impl Eq for WasmEdgeError"],["impl Eq for ExternalInstanceType"],["impl Eq for Mutability"],["impl Eq for GlobalError"],["impl Eq for HostRegistration"],["impl Eq for CoreLoadError"],["impl Eq for StoreError"],["impl Eq for FuncError"],["impl Eq for ValType"],["impl Eq for CompilerOptimizationLevel"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Ord.js b/trait.impl/core/cmp/trait.Ord.js new file mode 100644 index 000000000..5e44a20d2 --- /dev/null +++ b/trait.impl/core/cmp/trait.Ord.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sdk":[["impl Ord for GraphEncoding"],["impl Ord for ExecutionTarget"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialEq.js b/trait.impl/core/cmp/trait.PartialEq.js new file mode 100644 index 000000000..f1461493c --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialEq.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl PartialEq for ConnectState"],["impl PartialEq for Errno"],["impl PartialEq for FileType"],["impl PartialEq for Filestat"],["impl PartialEq for SdFlags"]], +"wasmedge_sdk":[["impl PartialEq for ExecutionTarget"],["impl PartialEq for GraphEncoding"]], +"wasmedge_sys":[["impl PartialEq for ProgramOptionType"]], +"wasmedge_types":[["impl PartialEq for MemoryType"],["impl PartialEq for CoreCommonError"],["impl PartialEq for RefType"],["impl PartialEq for CoreValidationError"],["impl PartialEq for GlobalType"],["impl PartialEq for CoreError"],["impl PartialEq for ImportError"],["impl PartialEq for ExportError"],["impl PartialEq for HostFuncError"],["impl PartialEq for MemError"],["impl PartialEq for ExternalInstanceType"],["impl PartialEq for StoreError"],["impl PartialEq for Mutability"],["impl PartialEq for CompilerOutputFormat"],["impl PartialEq for WasmEdgeError"],["impl PartialEq for InstanceError"],["impl PartialEq for FuncType"],["impl PartialEq for ValType"],["impl PartialEq for HostRegistration"],["impl PartialEq for GlobalError"],["impl PartialEq for CoreInstantiationError"],["impl PartialEq for PluginError"],["impl PartialEq for TableError"],["impl PartialEq for FuncError"],["impl PartialEq for CoreExecutionError"],["impl PartialEq for CoreLoadError"],["impl PartialEq for VmError"],["impl PartialEq for TableType"],["impl PartialEq for CompilerOptimizationLevel"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialOrd.js b/trait.impl/core/cmp/trait.PartialOrd.js new file mode 100644 index 000000000..4bec93eff --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialOrd.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sdk":[["impl PartialOrd for ExecutionTarget"],["impl PartialOrd for GraphEncoding"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js new file mode 100644 index 000000000..358e60d45 --- /dev/null +++ b/trait.impl/core/convert/trait.From.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl From<&FdStat> for __wasi_fdstat_t"],["impl From<Error> for Errno"],["impl From<SerialWasiFile> for VFD"],["impl From<SerialStdout> for VFD"],["impl From<ConnectState> for SerialConnectState"],["impl From<u16> for Errno"],["impl From<SerialWasiSocketState> for WasiSocketState"],["impl From<Filestat> for __wasi_filestat_t"],["impl From<SerialStderr> for VFD"],["impl<T: Sized> From<WasmPtr<T>> for usize"],["impl<T: Sized> From<usize> for WasmPtr<T>"],["impl From<&ReaddirEntity> for __wasi_dirent_t"],["impl From<&SerialWasiSocketState> for WasiSocketState"],["impl From<&WasiSocketState> for SerialWasiSocketState"],["impl From<SerialSocketType> for (AddressFamily, SocketType)"],["impl From<FdStat> for __wasi_fdstat_t"],["impl From<&VFD> for SerialVFD"],["impl From<ErrorKind> for Errno"],["impl From<SerialWasiDir> for VFD"],["impl From<SerialConnectState> for ConnectState"],["impl From<SdFlags> for Shutdown"],["impl From<&WasiCtx> for SerialWasiCtx"],["impl From<&Error> for Errno"],["impl From<SerialStdin> for VFD"],["impl From<(AddressFamily, SocketType)> for SerialSocketType"]], +"wasmedge_sdk":[["impl From<CallingFrame> for Caller"],["impl From<Val> for WasmValue"],["impl From<WasmValue> for Val"]], +"wasmedge_sys":[["impl From<GlobalType> for GlobalType"],["impl From<FuncType> for FuncType"],["impl From<WasmEdge_Value> for WasmValue"],["impl From<MemoryType> for MemType"],["impl From<PluginVersion> for WasmEdge_PluginVersionData"],["impl From<GlobalType> for GlobalType"],["impl From<FuncType> for FuncType"],["impl From<ProgramOptionType> for WasmEdge_ProgramOptionType"],["impl From<MemType> for MemoryType"],["impl From<TableType> for TableType"],["impl From<WasmEdge_String> for String"],["impl From<u32> for ProgramOptionType"],["impl From<TableType> for TableType"]], +"wasmedge_types":[["impl From<u32> for ValType"],["impl From<i32> for Mutability"],["impl From<ValType> for u32"],["impl From<i32> for ValType"],["impl From<RefType> for u32"],["impl From<CompilerOptimizationLevel> for u32"],["impl From<i32> for CompilerOutputFormat"],["impl From<FromUtf8Error> for WasmEdgeError"],["impl From<Mutability> for u32"],["impl From<CompilerOutputFormat> for u32"],["impl From<u32> for ExternalInstanceType"],["impl From<u32> for Mutability"],["impl From<HostRegistration> for u32"],["impl From<CompilerOutputFormat> for i32"],["impl From<Utf8Error> for WasmEdgeError"],["impl From<u32> for HostRegistration"],["impl From<CompilerOptimizationLevel> for i32"],["impl From<ValType> for i32"],["impl From<u32> for CompilerOutputFormat"],["impl From<i32> for ExternalInstanceType"],["impl From<i32> for CompilerOptimizationLevel"],["impl From<FromBytesWithNulError> for WasmEdgeError"],["impl From<NulError> for WasmEdgeError"],["impl From<Mutability> for i32"],["impl From<RefType> for i32"],["impl From<u32> for RefType"],["impl From<u32> for CompilerOptimizationLevel"],["impl From<i32> for RefType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/default/trait.Default.js b/trait.impl/core/default/trait.Default.js new file mode 100644 index 000000000..b4ac85651 --- /dev/null +++ b/trait.impl/core/default/trait.Default.js @@ -0,0 +1,5 @@ +(function() {var implementors = { +"async_wasi":[["impl<T> Default for ObjectNode<T>"],["impl Default for WasiSocketState"],["impl Default for AddressFamily"],["impl Default for WASIRights"],["impl Default for SocketType"],["impl Default for ConnectState"],["impl Default for WasiCtx"],["impl<T> Default for ObjectPool<T>"],["impl Default for Errno"]], +"wasmedge_sdk":[["impl<T: Default + ?Sized + Send + Sync + Clone> Default for PluginModuleBuilder<T>"],["impl Default for ImportObjectBuilder"],["impl Default for RuntimeConfigOptions"],["impl Default for ConfigBuilder"],["impl Default for CompilerConfigOptions"],["impl Default for HostRegistrationConfigOptions"],["impl Default for FuncTypeBuilder"],["impl Default for VmBuilder"],["impl Default for StatisticsConfigOptions"],["impl Default for CommonConfigOptions"]], +"wasmedge_types":[["impl Default for TableType"],["impl Default for GlobalType"],["impl Default for FuncType"],["impl Default for MemoryType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/error/trait.Error.js b/trait.impl/core/error/trait.Error.js new file mode 100644 index 000000000..41a9fdd53 --- /dev/null +++ b/trait.impl/core/error/trait.Error.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_types":[["impl Error for CoreInstantiationError"],["impl Error for FuncError"],["impl Error for StoreError"],["impl Error for ExportError"],["impl Error for HostFuncError"],["impl Error for CoreLoadError"],["impl Error for MemError"],["impl Error for CoreExecutionError"],["impl Error for PluginError"],["impl Error for CoreValidationError"],["impl Error for GlobalError"],["impl Error for InstanceError"],["impl Error for CoreCommonError"],["impl Error for VmError"],["impl Error for WasmEdgeError"],["impl Error for TableError"],["impl Error for CoreError"],["impl Error for ImportError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Binary.js b/trait.impl/core/fmt/trait.Binary.js new file mode 100644 index 000000000..0f7edd1c0 --- /dev/null +++ b/trait.impl/core/fmt/trait.Binary.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl Binary for RoFlags"],["impl Binary for OFlags"],["impl Binary for WASIRights"],["impl Binary for Lookupflags"],["impl Binary for FdFlags"],["impl Binary for SiFlags"],["impl Binary for RiFlags"],["impl Binary for SdFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Debug.js b/trait.impl/core/fmt/trait.Debug.js new file mode 100644 index 000000000..f871d7d28 --- /dev/null +++ b/trait.impl/core/fmt/trait.Debug.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl Debug for AsyncWasiSocket"],["impl Debug for __wasi_address_t"],["impl Debug for WasiDir"],["impl<T: Debug> Debug for ObjectNode<T>"],["impl Debug for __wasi_prestat_t"],["impl Debug for __wasi_fdstat_t"],["impl Debug for FdStat"],["impl Debug for WasiSockaddr"],["impl Debug for FileType"],["impl Debug for IoState"],["impl Debug for WasiAddrinfo"],["impl Debug for WasiStdout"],["impl Debug for Advice"],["impl Debug for SubscriptionFd"],["impl Debug for SerialUdpSocket"],["impl Debug for SerialStderr"],["impl Debug for __wasi_prestat_u_t"],["impl Debug for SerialWasiCtx"],["impl Debug for SubscriptionClock"],["impl Debug for SerialPreOpen"],["impl Debug for WasiStderr"],["impl Debug for __wasi_ciovec_t"],["impl Debug for WasiSocketState"],["impl Debug for AddressFamily"],["impl Debug for WASIRights"],["impl Debug for SerialSocketType"],["impl Debug for FdFlags"],["impl Debug for SerialConnectState"],["impl Debug for SerialWasiFile"],["impl Debug for SerialVFD"],["impl Debug for __wasi_subscription_clock_t"],["impl Debug for VFD"],["impl Debug for __wasi_subscription_t"],["impl Debug for INode"],["impl Debug for SerialWasiDir"],["impl<T: Debug + Sized> Debug for WasmPtr<T>"],["impl Debug for SerialWasiSocketState"],["impl Debug for Errno"],["impl Debug for WasiCtx"],["impl Debug for __wasi_iovec_t"],["impl<T: Debug> Debug for ObjectPool<T>"],["impl Debug for __wasi_prestat_dir_t"],["impl Debug for Subscription"],["impl Debug for __wasi_sockaddr_in_t"],["impl Debug for __wasi_event_t"],["impl Debug for PollFdState"],["impl Debug for __wasi_event_fd_readwrite_t"],["impl<T: Debug> Debug for SerialObjectPool<T>"],["impl Debug for __wasi_sockaddr_t"],["impl Debug for WasiPreOpenDir"],["impl Debug for __wasi_addrinfo_t"],["impl Debug for SubscriptionFdType"],["impl Debug for SerialStdout"],["impl Debug for Filestat"],["impl Debug for __wasi_subscription_u_u_t"],["impl Debug for __wasi_subscription_fd_readwrite_t"],["impl Debug for SerialTcpServer"],["impl Debug for __wasi_subscription_u_t"],["impl Debug for SocketType"],["impl Debug for WasiStdin"],["impl Debug for ConnectState"],["impl Debug for AddressFamily"],["impl Debug for WasiFile"],["impl Debug for __wasi_filestat_t"],["impl Debug for __wasi_dirent_t"],["impl Debug for SerialStdin"]], +"wasmedge_sdk":[["impl Debug for FuncRef"],["impl Debug for Global"],["impl Debug for PluginVersion"],["impl Debug for ExecutionTarget"],["impl Debug for Module"],["impl Debug for Plugin"],["impl<'module> Debug for ImportType<'module>"],["impl<'module> Debug for ExportType<'module>"],["impl Debug for Executor"],["impl Debug for Store"],["impl Debug for ExternRef"],["impl Debug for NNPreload"],["impl Debug for PluginDescriptor"],["impl Debug for LogManager"],["impl Debug for VmBuilder"],["impl Debug for CommonConfigOptions"],["impl Debug for GraphEncoding"],["impl Debug for Vm"],["impl Debug for Table"],["impl<T: Debug + ?Sized + Send + Sync + Clone> Debug for PluginModuleBuilder<T>"],["impl Debug for WasiInstance"],["impl Debug for Instance"],["impl<T: Debug + ?Sized + Send + Sync + Clone> Debug for ImportObject<T>"],["impl Debug for Func"],["impl Debug for StatisticsConfigOptions"],["impl<'a> Debug for Param<'a>"],["impl Debug for Config"],["impl Debug for Compiler"],["impl Debug for ConfigBuilder"],["impl Debug for PluginManager"],["impl Debug for VmDock"],["impl Debug for Statistics"],["impl Debug for CompilerConfigOptions"],["impl Debug for Caller"],["impl Debug for RuntimeConfigOptions"],["impl Debug for PluginModule"],["impl Debug for Memory"],["impl Debug for HostRegistrationConfigOptions"],["impl Debug for Driver"],["impl Debug for ImportObjectBuilder"],["impl Debug for FuncTypeBuilder"],["impl Debug for Val"]], +"wasmedge_sys":[["impl Debug for WasmEdge_ImportTypeContext"],["impl Debug for __fsid_t"],["impl Debug for WasmEdge_Limit"],["impl Debug for WasmEdge_CallingFrameContext"],["impl Debug for WasiInstance"],["impl Debug for WasmEdge_StatisticsContext"],["impl Debug for Plugin"],["impl<T: Debug + ?Sized + Send + Sync + Clone> Debug for ImportModule<T>"],["impl Debug for ProgramOptionType"],["impl Debug for Table"],["impl Debug for WasmEdge_Result"],["impl Debug for Function"],["impl Debug for WasmEdge_TableTypeContext"],["impl Debug for WasmEdge_PluginDescriptor"],["impl Debug for WasmEdge_Async"],["impl Debug for WasmEdge_TableInstanceContext"],["impl Debug for CallingFrame"],["impl Debug for WasmEdge_ExecutorContext"],["impl Debug for WasmEdge_Value"],["impl Debug for Executor"],["impl Debug for Loader"],["impl Debug for WasmEdge_String"],["impl Debug for FuncRef"],["impl Debug for TableType"],["impl Debug for MemType"],["impl<'module> Debug for ImportType<'module>"],["impl Debug for WasmEdge_MemoryInstanceContext"],["impl Debug for Compiler"],["impl Debug for Memory"],["impl Debug for Instance"],["impl Debug for WasmEdge_VMContext"],["impl Debug for WasmEdge_ModuleDescriptor"],["impl Debug for GlobalType"],["impl Debug for WasmEdge_FunctionInstanceContext"],["impl Debug for Config"],["impl Debug for PluginVersion"],["impl Debug for WasmValue"],["impl Debug for PluginManager"],["impl Debug for WasmEdge_ValidatorContext"],["impl Debug for WasmEdge_ConfigureContext"],["impl Debug for PluginDescriptor"],["impl Debug for WasmEdge_PluginContext"],["impl Debug for WasmEdge_FunctionTypeContext"],["impl Debug for FuncType"],["impl Debug for WasmEdge_ProgramOption"],["impl Debug for WasmEdge_CompilerContext"],["impl Debug for Store"],["impl Debug for WasmEdge_LoaderContext"],["impl Debug for Validator"],["impl Debug for Statistics"],["impl Debug for WasmEdge_ASTModuleContext"],["impl Debug for WasmEdge_GlobalInstanceContext"],["impl Debug for ProgramOption"],["impl Debug for WasmEdge_PluginVersionData"],["impl Debug for WasiModule"],["impl Debug for Global"],["impl Debug for WasmEdge_ModuleInstanceContext"],["impl Debug for WasmEdge_GlobalTypeContext"],["impl<'module> Debug for ExportType<'module>"],["impl Debug for WasmEdge_ExportTypeContext"],["impl Debug for PluginModule"],["impl Debug for WasmEdge_StoreContext"],["impl Debug for WasmEdge_MemoryTypeContext"],["impl Debug for Module"],["impl Debug for ModuleDescriptor"]], +"wasmedge_types":[["impl Debug for HostFuncError"],["impl Debug for FuncError"],["impl Debug for Mutability"],["impl Debug for PluginError"],["impl Debug for MemError"],["impl Debug for CoreExecutionError"],["impl Debug for CoreLoadError"],["impl Debug for ValType"],["impl Debug for ExportError"],["impl Debug for InstanceError"],["impl Debug for TableError"],["impl Debug for CoreInstantiationError"],["impl Debug for GlobalError"],["impl Debug for RefType"],["impl Debug for CompilerOptimizationLevel"],["impl Debug for FuncType"],["impl Debug for GlobalType"],["impl Debug for CompilerOutputFormat"],["impl Debug for VmError"],["impl Debug for ImportError"],["impl Debug for StoreError"],["impl Debug for TableType"],["impl Debug for CoreCommonError"],["impl Debug for CoreValidationError"],["impl Debug for HostRegistration"],["impl Debug for CoreError"],["impl Debug for WasmEdgeError"],["impl Debug for NeverType"],["impl Debug for MemoryType"],["impl Debug for ExternalInstanceType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Display.js b/trait.impl/core/fmt/trait.Display.js new file mode 100644 index 000000000..e39489bfe --- /dev/null +++ b/trait.impl/core/fmt/trait.Display.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"wasmedge_sdk":[["impl Display for NNPreload"],["impl Display for GraphEncoding"],["impl Display for ExecutionTarget"]], +"wasmedge_types":[["impl Display for StoreError"],["impl Display for HostFuncError"],["impl Display for ImportError"],["impl Display for CoreValidationError"],["impl Display for TableError"],["impl Display for CoreInstantiationError"],["impl Display for ExternalInstanceType"],["impl Display for PluginError"],["impl Display for ExportError"],["impl Display for CoreExecutionError"],["impl Display for FuncError"],["impl Display for GlobalError"],["impl Display for InstanceError"],["impl Display for WasmEdgeError"],["impl Display for CoreError"],["impl Display for CoreLoadError"],["impl Display for MemError"],["impl Display for VmError"],["impl Display for CoreCommonError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.LowerHex.js b/trait.impl/core/fmt/trait.LowerHex.js new file mode 100644 index 000000000..bf981494b --- /dev/null +++ b/trait.impl/core/fmt/trait.LowerHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl LowerHex for FdFlags"],["impl LowerHex for Lookupflags"],["impl LowerHex for WASIRights"],["impl LowerHex for RiFlags"],["impl LowerHex for SiFlags"],["impl LowerHex for RoFlags"],["impl LowerHex for OFlags"],["impl LowerHex for SdFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Octal.js b/trait.impl/core/fmt/trait.Octal.js new file mode 100644 index 000000000..840272332 --- /dev/null +++ b/trait.impl/core/fmt/trait.Octal.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl Octal for SiFlags"],["impl Octal for WASIRights"],["impl Octal for FdFlags"],["impl Octal for RoFlags"],["impl Octal for Lookupflags"],["impl Octal for SdFlags"],["impl Octal for RiFlags"],["impl Octal for OFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.UpperHex.js b/trait.impl/core/fmt/trait.UpperHex.js new file mode 100644 index 000000000..fbddd6f27 --- /dev/null +++ b/trait.impl/core/fmt/trait.UpperHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl UpperHex for RoFlags"],["impl UpperHex for FdFlags"],["impl UpperHex for Lookupflags"],["impl UpperHex for OFlags"],["impl UpperHex for WASIRights"],["impl UpperHex for RiFlags"],["impl UpperHex for SdFlags"],["impl UpperHex for SiFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/hash/trait.Hash.js b/trait.impl/core/hash/trait.Hash.js new file mode 100644 index 000000000..5a7295dd9 --- /dev/null +++ b/trait.impl/core/hash/trait.Hash.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_types":[["impl Hash for HostRegistration"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.Extend.js b/trait.impl/core/iter/traits/collect/trait.Extend.js new file mode 100644 index 000000000..c6631c269 --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.Extend.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl Extend<RoFlags> for RoFlags"],["impl Extend<SdFlags> for SdFlags"],["impl Extend<RiFlags> for RiFlags"],["impl Extend<OFlags> for OFlags"],["impl Extend<WASIRights> for WASIRights"],["impl Extend<SiFlags> for SiFlags"],["impl Extend<Lookupflags> for Lookupflags"],["impl Extend<FdFlags> for FdFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/trait.impl/core/iter/traits/collect/trait.FromIterator.js new file mode 100644 index 000000000..0a8e106bd --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.FromIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl FromIterator<FdFlags> for FdFlags"],["impl FromIterator<WASIRights> for WASIRights"],["impl FromIterator<Lookupflags> for Lookupflags"],["impl FromIterator<RoFlags> for RoFlags"],["impl FromIterator<RiFlags> for RiFlags"],["impl FromIterator<SdFlags> for SdFlags"],["impl FromIterator<SiFlags> for SiFlags"],["impl FromIterator<OFlags> for OFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.IntoIterator.js b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js new file mode 100644 index 000000000..548d772d9 --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl IntoIterator for FdFlags"],["impl IntoIterator for RoFlags"],["impl IntoIterator for SiFlags"],["impl IntoIterator for WASIRights"],["impl IntoIterator for Lookupflags"],["impl IntoIterator for SdFlags"],["impl IntoIterator for RiFlags"],["impl IntoIterator for OFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Copy.js b/trait.impl/core/marker/trait.Copy.js new file mode 100644 index 000000000..79e0219b6 --- /dev/null +++ b/trait.impl/core/marker/trait.Copy.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl Copy for ConnectState"],["impl Copy for FileType"],["impl Copy for SubscriptionClock"],["impl Copy for __wasi_prestat_dir_t"],["impl Copy for __wasi_filestat_t"],["impl Copy for __wasi_prestat_u_t"],["impl Copy for Errno"],["impl Copy for __wasi_sockaddr_in_t"],["impl Copy for SocketType"],["impl Copy for __wasi_event_fd_readwrite_t"],["impl Copy for SubscriptionFdType"],["impl Copy for SerialConnectState"],["impl Copy for __wasi_iovec_t"],["impl Copy for __wasi_prestat_t"],["impl Copy for Subscription"],["impl Copy for __wasi_subscription_t"],["impl Copy for SerialSocketType"],["impl Copy for __wasi_subscription_u_u_t"],["impl Copy for __wasi_fdstat_t"],["impl Copy for __wasi_addrinfo_t"],["impl<T: Copy + Sized> Copy for WasmPtr<T>"],["impl Copy for __wasi_ciovec_t"],["impl Copy for AddressFamily"],["impl Copy for __wasi_subscription_clock_t"],["impl Copy for __wasi_subscription_fd_readwrite_t"],["impl Copy for __wasi_address_t"],["impl Copy for AddressFamily"],["impl Copy for SubscriptionFd"],["impl Copy for __wasi_sockaddr_t"],["impl Copy for __wasi_event_t"],["impl Copy for __wasi_subscription_u_t"],["impl Copy for __wasi_timeval"],["impl Copy for __wasi_dirent_t"]], +"wasmedge_sdk":[["impl Copy for CommonConfigOptions"],["impl Copy for ExternRef"],["impl Copy for RuntimeConfigOptions"],["impl Copy for CompilerConfigOptions"],["impl Copy for HostRegistrationConfigOptions"],["impl Copy for StatisticsConfigOptions"]], +"wasmedge_sys":[["impl Copy for WasmEdge_ProgramOption"],["impl Copy for WasmEdge_ModuleDescriptor"],["impl Copy for WasmEdge_LoaderContext"],["impl Copy for ProgramOptionType"],["impl Copy for WasmEdge_TableTypeContext"],["impl Copy for WasmEdge_ExportTypeContext"],["impl Copy for WasmEdge_MemoryInstanceContext"],["impl Copy for WasmEdge_ExecutorContext"],["impl Copy for WasmEdge_ImportTypeContext"],["impl Copy for WasmEdge_GlobalInstanceContext"],["impl Copy for WasmEdge_ValidatorContext"],["impl Copy for WasmEdge_TableInstanceContext"],["impl Copy for WasmEdge_ModuleInstanceContext"],["impl Copy for WasmEdge_Async"],["impl Copy for WasmEdge_CallingFrameContext"],["impl Copy for WasmEdge_FunctionTypeContext"],["impl Copy for WasmEdge_ConfigureContext"],["impl Copy for __fsid_t"],["impl Copy for WasmEdge_VMContext"],["impl Copy for WasmEdge_PluginDescriptor"],["impl Copy for WasmEdge_FunctionInstanceContext"],["impl Copy for WasmEdge_Value"],["impl Copy for WasmEdge_CompilerContext"],["impl Copy for WasmEdge_ASTModuleContext"],["impl Copy for WasmEdge_StatisticsContext"],["impl Copy for WasmEdge_MemoryTypeContext"],["impl Copy for WasmEdge_String"],["impl Copy for WasmValue"],["impl Copy for WasmEdge_PluginContext"],["impl Copy for WasmEdge_Result"],["impl Copy for WasmEdge_GlobalTypeContext"],["impl Copy for WasmEdge_PluginVersionData"],["impl Copy for WasmEdge_StoreContext"],["impl Copy for WasmEdge_Limit"]], +"wasmedge_types":[["impl Copy for ValType"],["impl Copy for RefType"],["impl Copy for CompilerOutputFormat"],["impl Copy for Mutability"],["impl Copy for HostRegistration"],["impl Copy for CompilerOptimizationLevel"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Freeze.js b/trait.impl/core/marker/trait.Freeze.js new file mode 100644 index 000000000..f9dc0530b --- /dev/null +++ b/trait.impl/core/marker/trait.Freeze.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl<T> Freeze for ObjectPool<T>",1,["async_wasi::object_pool::ObjectPool"]],["impl<T> Freeze for SerialObjectPool<T>",1,["async_wasi::object_pool::SerialObjectPool"]],["impl<T> Freeze for ObjectNode<T>where\n T: Freeze,",1,["async_wasi::object_pool::ObjectNode"]],["impl Freeze for __wasi_iovec_t",1,["async_wasi::snapshots::common::types::__wasi_iovec_t"]],["impl Freeze for __wasi_ciovec_t",1,["async_wasi::snapshots::common::types::__wasi_ciovec_t"]],["impl Freeze for __wasi_dirent_t",1,["async_wasi::snapshots::common::types::__wasi_dirent_t"]],["impl Freeze for __wasi_fdstat_t",1,["async_wasi::snapshots::common::types::__wasi_fdstat_t"]],["impl Freeze for __wasi_filestat_t",1,["async_wasi::snapshots::common::types::__wasi_filestat_t"]],["impl Freeze for __wasi_event_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_event_fd_readwrite_t"]],["impl Freeze for __wasi_event_t",1,["async_wasi::snapshots::common::types::__wasi_event_t"]],["impl Freeze for __wasi_subscription_clock_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_clock_t"]],["impl Freeze for __wasi_subscription_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_fd_readwrite_t"]],["impl Freeze for __wasi_subscription_u_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_u_t"]],["impl Freeze for __wasi_subscription_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_t"]],["impl Freeze for __wasi_subscription_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_t"]],["impl Freeze for __wasi_address_t",1,["async_wasi::snapshots::common::types::__wasi_address_t"]],["impl Freeze for __wasi_sockaddr_in_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_in_t"]],["impl Freeze for __wasi_sockaddr_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_t"]],["impl Freeze for __wasi_addrinfo_t",1,["async_wasi::snapshots::common::types::__wasi_addrinfo_t"]],["impl Freeze for __wasi_prestat_dir_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_dir_t"]],["impl Freeze for __wasi_prestat_u_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_u_t"]],["impl Freeze for __wasi_prestat_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_t"]],["impl Freeze for __wasi_timeval",1,["async_wasi::snapshots::common::types::__wasi_timeval"]],["impl Freeze for Errno",1,["async_wasi::snapshots::common::error::Errno"]],["impl<T> Freeze for WasmPtr<T>",1,["async_wasi::snapshots::common::memory::WasmPtr"]],["impl Freeze for AsyncWasiSocket",1,["async_wasi::snapshots::common::net::async_tokio::AsyncWasiSocket"]],["impl Freeze for AddressFamily",1,["async_wasi::snapshots::common::net::AddressFamily"]],["impl Freeze for SocketType",1,["async_wasi::snapshots::common::net::SocketType"]],["impl Freeze for ConnectState",1,["async_wasi::snapshots::common::net::ConnectState"]],["impl Freeze for WasiSocketState",1,["async_wasi::snapshots::common::net::WasiSocketState"]],["impl Freeze for SubscriptionFdType",1,["async_wasi::snapshots::common::net::SubscriptionFdType"]],["impl Freeze for SubscriptionFd",1,["async_wasi::snapshots::common::net::SubscriptionFd"]],["impl Freeze for SubscriptionClock",1,["async_wasi::snapshots::common::net::SubscriptionClock"]],["impl Freeze for Subscription",1,["async_wasi::snapshots::common::net::Subscription"]],["impl Freeze for PrePoll",1,["async_wasi::snapshots::common::net::PrePoll"]],["impl Freeze for WasiStdin",1,["async_wasi::snapshots::common::vfs::sync::WasiStdin"]],["impl Freeze for WasiStdout",1,["async_wasi::snapshots::common::vfs::sync::WasiStdout"]],["impl Freeze for WasiStderr",1,["async_wasi::snapshots::common::vfs::sync::WasiStderr"]],["impl Freeze for WasiFile",1,["async_wasi::snapshots::common::vfs::sync::WasiFile"]],["impl Freeze for WasiPreOpenDir",1,["async_wasi::snapshots::common::vfs::sync::WasiPreOpenDir"]],["impl Freeze for WasiDir",1,["async_wasi::snapshots::common::vfs::sync::WasiDir"]],["impl Freeze for INode",1,["async_wasi::snapshots::common::vfs::sync::INode"]],["impl Freeze for SystemTimeSpec",1,["async_wasi::snapshots::common::vfs::SystemTimeSpec"]],["impl Freeze for ReaddirEntity",1,["async_wasi::snapshots::common::vfs::ReaddirEntity"]],["impl Freeze for FdStat",1,["async_wasi::snapshots::common::vfs::FdStat"]],["impl Freeze for Filestat",1,["async_wasi::snapshots::common::vfs::Filestat"]],["impl Freeze for FileType",1,["async_wasi::snapshots::common::vfs::FileType"]],["impl Freeze for FdFlags",1,["async_wasi::snapshots::common::vfs::FdFlags"]],["impl Freeze for SdFlags",1,["async_wasi::snapshots::common::vfs::SdFlags"]],["impl Freeze for SiFlags",1,["async_wasi::snapshots::common::vfs::SiFlags"]],["impl Freeze for RiFlags",1,["async_wasi::snapshots::common::vfs::RiFlags"]],["impl Freeze for RoFlags",1,["async_wasi::snapshots::common::vfs::RoFlags"]],["impl Freeze for OFlags",1,["async_wasi::snapshots::common::vfs::OFlags"]],["impl Freeze for WASIRights",1,["async_wasi::snapshots::common::vfs::WASIRights"]],["impl Freeze for Lookupflags",1,["async_wasi::snapshots::common::vfs::Lookupflags"]],["impl Freeze for Advice",1,["async_wasi::snapshots::common::vfs::Advice"]],["impl Freeze for VFD",1,["async_wasi::snapshots::env::VFD"]],["impl Freeze for AddressFamily",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::AddressFamily"]],["impl Freeze for WasiSockaddr",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiSockaddr"]],["impl Freeze for WasiAddrinfo",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiAddrinfo"]],["impl Freeze for PollFdState",1,["async_wasi::snapshots::serialize::PollFdState"]],["impl Freeze for IoState",1,["async_wasi::snapshots::serialize::IoState"]],["impl Freeze for SerialWasiCtx",1,["async_wasi::snapshots::serialize::SerialWasiCtx"]],["impl Freeze for SerialSocketType",1,["async_wasi::snapshots::serialize::SerialSocketType"]],["impl Freeze for SerialConnectState",1,["async_wasi::snapshots::serialize::SerialConnectState"]],["impl Freeze for SerialWasiSocketState",1,["async_wasi::snapshots::serialize::SerialWasiSocketState"]],["impl Freeze for SerialStdin",1,["async_wasi::snapshots::serialize::SerialStdin"]],["impl Freeze for SerialStdout",1,["async_wasi::snapshots::serialize::SerialStdout"]],["impl Freeze for SerialStderr",1,["async_wasi::snapshots::serialize::SerialStderr"]],["impl Freeze for SerialWasiDir",1,["async_wasi::snapshots::serialize::SerialWasiDir"]],["impl Freeze for SerialWasiFile",1,["async_wasi::snapshots::serialize::SerialWasiFile"]],["impl Freeze for SerialTcpServer",1,["async_wasi::snapshots::serialize::SerialTcpServer"]],["impl Freeze for SerialUdpSocket",1,["async_wasi::snapshots::serialize::SerialUdpSocket"]],["impl Freeze for SerialPreOpen",1,["async_wasi::snapshots::serialize::SerialPreOpen"]],["impl Freeze for SerialVFD",1,["async_wasi::snapshots::serialize::SerialVFD"]],["impl Freeze for WasiCtx",1,["async_wasi::snapshots::WasiCtx"]]], +"wasmedge_sdk":[["impl Freeze for Caller",1,["wasmedge_sdk::caller::Caller"]],["impl Freeze for Compiler",1,["wasmedge_sdk::compiler::Compiler"]],["impl Freeze for ConfigBuilder",1,["wasmedge_sdk::config::ConfigBuilder"]],["impl Freeze for Config",1,["wasmedge_sdk::config::Config"]],["impl Freeze for CommonConfigOptions",1,["wasmedge_sdk::config::CommonConfigOptions"]],["impl Freeze for CompilerConfigOptions",1,["wasmedge_sdk::config::CompilerConfigOptions"]],["impl Freeze for RuntimeConfigOptions",1,["wasmedge_sdk::config::RuntimeConfigOptions"]],["impl Freeze for StatisticsConfigOptions",1,["wasmedge_sdk::config::StatisticsConfigOptions"]],["impl Freeze for HostRegistrationConfigOptions",1,["wasmedge_sdk::config::HostRegistrationConfigOptions"]],["impl Freeze for VmDock",1,["wasmedge_sdk::dock::VmDock"]],["impl<'a> Freeze for Param<'a>",1,["wasmedge_sdk::dock::Param"]],["impl Freeze for Executor",1,["wasmedge_sdk::executor::Executor"]],["impl Freeze for Func",1,["wasmedge_sdk::externals::function::Func"]],["impl Freeze for FuncTypeBuilder",1,["wasmedge_sdk::externals::function::FuncTypeBuilder"]],["impl Freeze for FuncRef",1,["wasmedge_sdk::externals::function::FuncRef"]],["impl Freeze for Global",1,["wasmedge_sdk::externals::global::Global"]],["impl Freeze for Memory",1,["wasmedge_sdk::externals::memory::Memory"]],["impl Freeze for Table",1,["wasmedge_sdk::externals::table::Table"]],["impl Freeze for ImportObjectBuilder",1,["wasmedge_sdk::import::ImportObjectBuilder"]],["impl<T> Freeze for ImportObject<T>",1,["wasmedge_sdk::import::ImportObject"]],["impl Freeze for Instance",1,["wasmedge_sdk::instance::Instance"]],["impl Freeze for LogManager",1,["wasmedge_sdk::log::LogManager"]],["impl Freeze for Module",1,["wasmedge_sdk::module::Module"]],["impl<'module> Freeze for ImportType<'module>",1,["wasmedge_sdk::module::ImportType"]],["impl<'module> Freeze for ExportType<'module>",1,["wasmedge_sdk::module::ExportType"]],["impl Freeze for NNPreload",1,["wasmedge_sdk::plugin::NNPreload"]],["impl Freeze for GraphEncoding",1,["wasmedge_sdk::plugin::GraphEncoding"]],["impl Freeze for ExecutionTarget",1,["wasmedge_sdk::plugin::ExecutionTarget"]],["impl Freeze for PluginManager",1,["wasmedge_sdk::plugin::PluginManager"]],["impl Freeze for Plugin",1,["wasmedge_sdk::plugin::Plugin"]],["impl Freeze for PluginDescriptor",1,["wasmedge_sdk::plugin::PluginDescriptor"]],["impl Freeze for PluginVersion",1,["wasmedge_sdk::plugin::PluginVersion"]],["impl<T> Freeze for PluginModuleBuilder<T>",1,["wasmedge_sdk::plugin::PluginModuleBuilder"]],["impl Freeze for PluginModule",1,["wasmedge_sdk::plugin::PluginModule"]],["impl Freeze for Statistics",1,["wasmedge_sdk::statistics::Statistics"]],["impl Freeze for Store",1,["wasmedge_sdk::store::Store"]],["impl Freeze for Val",1,["wasmedge_sdk::types::Val"]],["impl Freeze for ExternRef",1,["wasmedge_sdk::types::ExternRef"]],["impl Freeze for Driver",1,["wasmedge_sdk::utils::Driver"]],["impl Freeze for CoreVersion",1,["wasmedge_sdk::utils::CoreVersion"]],["impl Freeze for VmBuilder",1,["wasmedge_sdk::vm::VmBuilder"]],["impl Freeze for Vm",1,["wasmedge_sdk::vm::Vm"]],["impl Freeze for WasiInstance",1,["wasmedge_sdk::wasi::WasiInstance"]]], +"wasmedge_sys":[["impl Freeze for __fsid_t",1,["wasmedge_sys::ffi::__fsid_t"]],["impl Freeze for WasmEdge_Value",1,["wasmedge_sys::ffi::WasmEdge_Value"]],["impl Freeze for WasmEdge_String",1,["wasmedge_sys::ffi::WasmEdge_String"]],["impl Freeze for WasmEdge_Result",1,["wasmedge_sys::ffi::WasmEdge_Result"]],["impl Freeze for WasmEdge_Limit",1,["wasmedge_sys::ffi::WasmEdge_Limit"]],["impl Freeze for WasmEdge_ConfigureContext",1,["wasmedge_sys::ffi::WasmEdge_ConfigureContext"]],["impl Freeze for WasmEdge_StatisticsContext",1,["wasmedge_sys::ffi::WasmEdge_StatisticsContext"]],["impl Freeze for WasmEdge_ASTModuleContext",1,["wasmedge_sys::ffi::WasmEdge_ASTModuleContext"]],["impl Freeze for WasmEdge_FunctionTypeContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionTypeContext"]],["impl Freeze for WasmEdge_MemoryTypeContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryTypeContext"]],["impl Freeze for WasmEdge_TableTypeContext",1,["wasmedge_sys::ffi::WasmEdge_TableTypeContext"]],["impl Freeze for WasmEdge_GlobalTypeContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalTypeContext"]],["impl Freeze for WasmEdge_ImportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ImportTypeContext"]],["impl Freeze for WasmEdge_ExportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ExportTypeContext"]],["impl Freeze for WasmEdge_CompilerContext",1,["wasmedge_sys::ffi::WasmEdge_CompilerContext"]],["impl Freeze for WasmEdge_LoaderContext",1,["wasmedge_sys::ffi::WasmEdge_LoaderContext"]],["impl Freeze for WasmEdge_ValidatorContext",1,["wasmedge_sys::ffi::WasmEdge_ValidatorContext"]],["impl Freeze for WasmEdge_ExecutorContext",1,["wasmedge_sys::ffi::WasmEdge_ExecutorContext"]],["impl Freeze for WasmEdge_StoreContext",1,["wasmedge_sys::ffi::WasmEdge_StoreContext"]],["impl Freeze for WasmEdge_ModuleInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_ModuleInstanceContext"]],["impl Freeze for WasmEdge_FunctionInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionInstanceContext"]],["impl Freeze for WasmEdge_TableInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_TableInstanceContext"]],["impl Freeze for WasmEdge_MemoryInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryInstanceContext"]],["impl Freeze for WasmEdge_GlobalInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalInstanceContext"]],["impl Freeze for WasmEdge_CallingFrameContext",1,["wasmedge_sys::ffi::WasmEdge_CallingFrameContext"]],["impl Freeze for WasmEdge_Async",1,["wasmedge_sys::ffi::WasmEdge_Async"]],["impl Freeze for WasmEdge_VMContext",1,["wasmedge_sys::ffi::WasmEdge_VMContext"]],["impl Freeze for WasmEdge_PluginContext",1,["wasmedge_sys::ffi::WasmEdge_PluginContext"]],["impl Freeze for WasmEdge_ProgramOption",1,["wasmedge_sys::ffi::WasmEdge_ProgramOption"]],["impl Freeze for WasmEdge_ModuleDescriptor",1,["wasmedge_sys::ffi::WasmEdge_ModuleDescriptor"]],["impl Freeze for WasmEdge_PluginVersionData",1,["wasmedge_sys::ffi::WasmEdge_PluginVersionData"]],["impl Freeze for WasmEdge_PluginDescriptor",1,["wasmedge_sys::ffi::WasmEdge_PluginDescriptor"]],["impl Freeze for Module",1,["wasmedge_sys::ast_module::Module"]],["impl<'module> Freeze for ImportType<'module>",1,["wasmedge_sys::ast_module::ImportType"]],["impl<'module> Freeze for ExportType<'module>",1,["wasmedge_sys::ast_module::ExportType"]],["impl Freeze for Compiler",1,["wasmedge_sys::compiler::Compiler"]],["impl Freeze for Config",1,["wasmedge_sys::config::Config"]],["impl Freeze for Executor",1,["wasmedge_sys::executor::Executor"]],["impl Freeze for CallingFrame",1,["wasmedge_sys::frame::CallingFrame"]],["impl Freeze for Function",1,["wasmedge_sys::instance::function::Function"]],["impl Freeze for FuncType",1,["wasmedge_sys::instance::function::FuncType"]],["impl Freeze for FuncRef",1,["wasmedge_sys::instance::function::FuncRef"]],["impl Freeze for Global",1,["wasmedge_sys::instance::global::Global"]],["impl Freeze for GlobalType",1,["wasmedge_sys::instance::global::GlobalType"]],["impl Freeze for Memory",1,["wasmedge_sys::instance::memory::Memory"]],["impl Freeze for MemType",1,["wasmedge_sys::instance::memory::MemType"]],["impl Freeze for Instance",1,["wasmedge_sys::instance::module::Instance"]],["impl<T> Freeze for ImportModule<T>",1,["wasmedge_sys::instance::module::ImportModule"]],["impl Freeze for WasiModule",1,["wasmedge_sys::instance::module::WasiModule"]],["impl Freeze for WasiInstance",1,["wasmedge_sys::instance::module::WasiInstance"]],["impl Freeze for Table",1,["wasmedge_sys::instance::table::Table"]],["impl Freeze for TableType",1,["wasmedge_sys::instance::table::TableType"]],["impl Freeze for Loader",1,["wasmedge_sys::loader::Loader"]],["impl Freeze for PluginManager",1,["wasmedge_sys::plugin::PluginManager"]],["impl Freeze for Plugin",1,["wasmedge_sys::plugin::Plugin"]],["impl Freeze for ProgramOptionType",1,["wasmedge_sys::plugin::ProgramOptionType"]],["impl Freeze for ProgramOption",1,["wasmedge_sys::plugin::ProgramOption"]],["impl Freeze for ModuleDescriptor",1,["wasmedge_sys::plugin::ModuleDescriptor"]],["impl Freeze for PluginVersion",1,["wasmedge_sys::plugin::PluginVersion"]],["impl Freeze for PluginDescriptor",1,["wasmedge_sys::plugin::PluginDescriptor"]],["impl Freeze for PluginModule",1,["wasmedge_sys::plugin::PluginModule"]],["impl Freeze for Statistics",1,["wasmedge_sys::statistics::Statistics"]],["impl Freeze for Store",1,["wasmedge_sys::store::Store"]],["impl Freeze for WasmValue",1,["wasmedge_sys::types::WasmValue"]],["impl Freeze for Validator",1,["wasmedge_sys::validator::Validator"]]], +"wasmedge_types":[["impl Freeze for WasmEdgeError",1,["wasmedge_types::error::WasmEdgeError"]],["impl Freeze for FuncError",1,["wasmedge_types::error::FuncError"]],["impl Freeze for MemError",1,["wasmedge_types::error::MemError"]],["impl Freeze for GlobalError",1,["wasmedge_types::error::GlobalError"]],["impl Freeze for TableError",1,["wasmedge_types::error::TableError"]],["impl Freeze for ImportError",1,["wasmedge_types::error::ImportError"]],["impl Freeze for ExportError",1,["wasmedge_types::error::ExportError"]],["impl Freeze for InstanceError",1,["wasmedge_types::error::InstanceError"]],["impl Freeze for PluginError",1,["wasmedge_types::error::PluginError"]],["impl Freeze for StoreError",1,["wasmedge_types::error::StoreError"]],["impl Freeze for VmError",1,["wasmedge_types::error::VmError"]],["impl Freeze for CoreError",1,["wasmedge_types::error::CoreError"]],["impl Freeze for CoreCommonError",1,["wasmedge_types::error::CoreCommonError"]],["impl Freeze for CoreLoadError",1,["wasmedge_types::error::CoreLoadError"]],["impl Freeze for CoreValidationError",1,["wasmedge_types::error::CoreValidationError"]],["impl Freeze for CoreInstantiationError",1,["wasmedge_types::error::CoreInstantiationError"]],["impl Freeze for CoreExecutionError",1,["wasmedge_types::error::CoreExecutionError"]],["impl Freeze for HostFuncError",1,["wasmedge_types::error::HostFuncError"]],["impl Freeze for RefType",1,["wasmedge_types::RefType"]],["impl Freeze for ValType",1,["wasmedge_types::ValType"]],["impl Freeze for Mutability",1,["wasmedge_types::Mutability"]],["impl Freeze for CompilerOptimizationLevel",1,["wasmedge_types::CompilerOptimizationLevel"]],["impl Freeze for CompilerOutputFormat",1,["wasmedge_types::CompilerOutputFormat"]],["impl Freeze for HostRegistration",1,["wasmedge_types::HostRegistration"]],["impl Freeze for ExternalInstanceType",1,["wasmedge_types::ExternalInstanceType"]],["impl Freeze for FuncType",1,["wasmedge_types::FuncType"]],["impl Freeze for TableType",1,["wasmedge_types::TableType"]],["impl Freeze for MemoryType",1,["wasmedge_types::MemoryType"]],["impl Freeze for GlobalType",1,["wasmedge_types::GlobalType"]],["impl Freeze for NeverType",1,["wasmedge_types::NeverType"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Send.js b/trait.impl/core/marker/trait.Send.js new file mode 100644 index 000000000..f404200a1 --- /dev/null +++ b/trait.impl/core/marker/trait.Send.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl<T> Send for ObjectPool<T>where\n T: Send,",1,["async_wasi::object_pool::ObjectPool"]],["impl<T> Send for SerialObjectPool<T>where\n T: Send,",1,["async_wasi::object_pool::SerialObjectPool"]],["impl<T> Send for ObjectNode<T>where\n T: Send,",1,["async_wasi::object_pool::ObjectNode"]],["impl Send for __wasi_iovec_t",1,["async_wasi::snapshots::common::types::__wasi_iovec_t"]],["impl Send for __wasi_ciovec_t",1,["async_wasi::snapshots::common::types::__wasi_ciovec_t"]],["impl Send for __wasi_dirent_t",1,["async_wasi::snapshots::common::types::__wasi_dirent_t"]],["impl Send for __wasi_fdstat_t",1,["async_wasi::snapshots::common::types::__wasi_fdstat_t"]],["impl Send for __wasi_filestat_t",1,["async_wasi::snapshots::common::types::__wasi_filestat_t"]],["impl Send for __wasi_event_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_event_fd_readwrite_t"]],["impl Send for __wasi_event_t",1,["async_wasi::snapshots::common::types::__wasi_event_t"]],["impl Send for __wasi_subscription_clock_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_clock_t"]],["impl Send for __wasi_subscription_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_fd_readwrite_t"]],["impl Send for __wasi_subscription_u_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_u_t"]],["impl Send for __wasi_subscription_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_t"]],["impl Send for __wasi_subscription_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_t"]],["impl Send for __wasi_address_t",1,["async_wasi::snapshots::common::types::__wasi_address_t"]],["impl Send for __wasi_sockaddr_in_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_in_t"]],["impl Send for __wasi_sockaddr_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_t"]],["impl Send for __wasi_addrinfo_t",1,["async_wasi::snapshots::common::types::__wasi_addrinfo_t"]],["impl Send for __wasi_prestat_dir_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_dir_t"]],["impl Send for __wasi_prestat_u_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_u_t"]],["impl Send for __wasi_prestat_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_t"]],["impl Send for __wasi_timeval",1,["async_wasi::snapshots::common::types::__wasi_timeval"]],["impl Send for Errno",1,["async_wasi::snapshots::common::error::Errno"]],["impl<T> Send for WasmPtr<T>where\n T: Send,",1,["async_wasi::snapshots::common::memory::WasmPtr"]],["impl Send for AsyncWasiSocket",1,["async_wasi::snapshots::common::net::async_tokio::AsyncWasiSocket"]],["impl Send for AddressFamily",1,["async_wasi::snapshots::common::net::AddressFamily"]],["impl Send for SocketType",1,["async_wasi::snapshots::common::net::SocketType"]],["impl Send for ConnectState",1,["async_wasi::snapshots::common::net::ConnectState"]],["impl Send for WasiSocketState",1,["async_wasi::snapshots::common::net::WasiSocketState"]],["impl Send for SubscriptionFdType",1,["async_wasi::snapshots::common::net::SubscriptionFdType"]],["impl Send for SubscriptionFd",1,["async_wasi::snapshots::common::net::SubscriptionFd"]],["impl Send for SubscriptionClock",1,["async_wasi::snapshots::common::net::SubscriptionClock"]],["impl Send for Subscription",1,["async_wasi::snapshots::common::net::Subscription"]],["impl Send for PrePoll",1,["async_wasi::snapshots::common::net::PrePoll"]],["impl Send for WasiStdin",1,["async_wasi::snapshots::common::vfs::sync::WasiStdin"]],["impl Send for WasiStdout",1,["async_wasi::snapshots::common::vfs::sync::WasiStdout"]],["impl Send for WasiStderr",1,["async_wasi::snapshots::common::vfs::sync::WasiStderr"]],["impl Send for WasiFile",1,["async_wasi::snapshots::common::vfs::sync::WasiFile"]],["impl Send for WasiPreOpenDir",1,["async_wasi::snapshots::common::vfs::sync::WasiPreOpenDir"]],["impl Send for WasiDir",1,["async_wasi::snapshots::common::vfs::sync::WasiDir"]],["impl Send for INode",1,["async_wasi::snapshots::common::vfs::sync::INode"]],["impl Send for SystemTimeSpec",1,["async_wasi::snapshots::common::vfs::SystemTimeSpec"]],["impl Send for ReaddirEntity",1,["async_wasi::snapshots::common::vfs::ReaddirEntity"]],["impl Send for FdStat",1,["async_wasi::snapshots::common::vfs::FdStat"]],["impl Send for Filestat",1,["async_wasi::snapshots::common::vfs::Filestat"]],["impl Send for FileType",1,["async_wasi::snapshots::common::vfs::FileType"]],["impl Send for FdFlags",1,["async_wasi::snapshots::common::vfs::FdFlags"]],["impl Send for SdFlags",1,["async_wasi::snapshots::common::vfs::SdFlags"]],["impl Send for SiFlags",1,["async_wasi::snapshots::common::vfs::SiFlags"]],["impl Send for RiFlags",1,["async_wasi::snapshots::common::vfs::RiFlags"]],["impl Send for RoFlags",1,["async_wasi::snapshots::common::vfs::RoFlags"]],["impl Send for OFlags",1,["async_wasi::snapshots::common::vfs::OFlags"]],["impl Send for WASIRights",1,["async_wasi::snapshots::common::vfs::WASIRights"]],["impl Send for Lookupflags",1,["async_wasi::snapshots::common::vfs::Lookupflags"]],["impl Send for Advice",1,["async_wasi::snapshots::common::vfs::Advice"]],["impl Send for VFD",1,["async_wasi::snapshots::env::VFD"]],["impl Send for AddressFamily",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::AddressFamily"]],["impl Send for WasiSockaddr",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiSockaddr"]],["impl Send for WasiAddrinfo",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiAddrinfo"]],["impl Send for PollFdState",1,["async_wasi::snapshots::serialize::PollFdState"]],["impl Send for IoState",1,["async_wasi::snapshots::serialize::IoState"]],["impl Send for SerialWasiCtx",1,["async_wasi::snapshots::serialize::SerialWasiCtx"]],["impl Send for SerialSocketType",1,["async_wasi::snapshots::serialize::SerialSocketType"]],["impl Send for SerialConnectState",1,["async_wasi::snapshots::serialize::SerialConnectState"]],["impl Send for SerialWasiSocketState",1,["async_wasi::snapshots::serialize::SerialWasiSocketState"]],["impl Send for SerialStdin",1,["async_wasi::snapshots::serialize::SerialStdin"]],["impl Send for SerialStdout",1,["async_wasi::snapshots::serialize::SerialStdout"]],["impl Send for SerialStderr",1,["async_wasi::snapshots::serialize::SerialStderr"]],["impl Send for SerialWasiDir",1,["async_wasi::snapshots::serialize::SerialWasiDir"]],["impl Send for SerialWasiFile",1,["async_wasi::snapshots::serialize::SerialWasiFile"]],["impl Send for SerialTcpServer",1,["async_wasi::snapshots::serialize::SerialTcpServer"]],["impl Send for SerialUdpSocket",1,["async_wasi::snapshots::serialize::SerialUdpSocket"]],["impl Send for SerialPreOpen",1,["async_wasi::snapshots::serialize::SerialPreOpen"]],["impl Send for SerialVFD",1,["async_wasi::snapshots::serialize::SerialVFD"]],["impl Send for WasiCtx"]], +"wasmedge_sdk":[["impl Send for Caller",1,["wasmedge_sdk::caller::Caller"]],["impl Send for Compiler",1,["wasmedge_sdk::compiler::Compiler"]],["impl Send for ConfigBuilder",1,["wasmedge_sdk::config::ConfigBuilder"]],["impl Send for Config",1,["wasmedge_sdk::config::Config"]],["impl Send for CommonConfigOptions",1,["wasmedge_sdk::config::CommonConfigOptions"]],["impl Send for CompilerConfigOptions",1,["wasmedge_sdk::config::CompilerConfigOptions"]],["impl Send for RuntimeConfigOptions",1,["wasmedge_sdk::config::RuntimeConfigOptions"]],["impl Send for StatisticsConfigOptions",1,["wasmedge_sdk::config::StatisticsConfigOptions"]],["impl Send for HostRegistrationConfigOptions",1,["wasmedge_sdk::config::HostRegistrationConfigOptions"]],["impl<'a> Send for Param<'a>",1,["wasmedge_sdk::dock::Param"]],["impl Send for Executor",1,["wasmedge_sdk::executor::Executor"]],["impl Send for Func",1,["wasmedge_sdk::externals::function::Func"]],["impl Send for FuncTypeBuilder",1,["wasmedge_sdk::externals::function::FuncTypeBuilder"]],["impl Send for FuncRef",1,["wasmedge_sdk::externals::function::FuncRef"]],["impl Send for Global",1,["wasmedge_sdk::externals::global::Global"]],["impl Send for Memory",1,["wasmedge_sdk::externals::memory::Memory"]],["impl Send for Table",1,["wasmedge_sdk::externals::table::Table"]],["impl Send for ImportObjectBuilder",1,["wasmedge_sdk::import::ImportObjectBuilder"]],["impl<T> Send for ImportObject<T>",1,["wasmedge_sdk::import::ImportObject"]],["impl Send for Instance",1,["wasmedge_sdk::instance::Instance"]],["impl Send for LogManager",1,["wasmedge_sdk::log::LogManager"]],["impl Send for Module",1,["wasmedge_sdk::module::Module"]],["impl<'module> Send for ImportType<'module>",1,["wasmedge_sdk::module::ImportType"]],["impl<'module> Send for ExportType<'module>",1,["wasmedge_sdk::module::ExportType"]],["impl Send for NNPreload",1,["wasmedge_sdk::plugin::NNPreload"]],["impl Send for GraphEncoding",1,["wasmedge_sdk::plugin::GraphEncoding"]],["impl Send for ExecutionTarget",1,["wasmedge_sdk::plugin::ExecutionTarget"]],["impl Send for PluginManager",1,["wasmedge_sdk::plugin::PluginManager"]],["impl Send for Plugin",1,["wasmedge_sdk::plugin::Plugin"]],["impl !Send for PluginDescriptor",1,["wasmedge_sdk::plugin::PluginDescriptor"]],["impl Send for PluginVersion",1,["wasmedge_sdk::plugin::PluginVersion"]],["impl<T> Send for PluginModuleBuilder<T>",1,["wasmedge_sdk::plugin::PluginModuleBuilder"]],["impl Send for PluginModule",1,["wasmedge_sdk::plugin::PluginModule"]],["impl Send for Statistics",1,["wasmedge_sdk::statistics::Statistics"]],["impl Send for Store",1,["wasmedge_sdk::store::Store"]],["impl Send for Val",1,["wasmedge_sdk::types::Val"]],["impl Send for ExternRef",1,["wasmedge_sdk::types::ExternRef"]],["impl Send for Driver",1,["wasmedge_sdk::utils::Driver"]],["impl Send for CoreVersion",1,["wasmedge_sdk::utils::CoreVersion"]],["impl Send for VmBuilder",1,["wasmedge_sdk::vm::VmBuilder"]],["impl Send for Vm",1,["wasmedge_sdk::vm::Vm"]],["impl Send for WasiInstance",1,["wasmedge_sdk::wasi::WasiInstance"]],["impl Send for VmDock"]], +"wasmedge_sys":[["impl Send for __fsid_t",1,["wasmedge_sys::ffi::__fsid_t"]],["impl Send for WasmEdge_Value",1,["wasmedge_sys::ffi::WasmEdge_Value"]],["impl !Send for WasmEdge_String",1,["wasmedge_sys::ffi::WasmEdge_String"]],["impl Send for WasmEdge_Result",1,["wasmedge_sys::ffi::WasmEdge_Result"]],["impl Send for WasmEdge_Limit",1,["wasmedge_sys::ffi::WasmEdge_Limit"]],["impl Send for WasmEdge_ConfigureContext",1,["wasmedge_sys::ffi::WasmEdge_ConfigureContext"]],["impl Send for WasmEdge_StatisticsContext",1,["wasmedge_sys::ffi::WasmEdge_StatisticsContext"]],["impl Send for WasmEdge_ASTModuleContext",1,["wasmedge_sys::ffi::WasmEdge_ASTModuleContext"]],["impl Send for WasmEdge_FunctionTypeContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionTypeContext"]],["impl Send for WasmEdge_MemoryTypeContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryTypeContext"]],["impl Send for WasmEdge_TableTypeContext",1,["wasmedge_sys::ffi::WasmEdge_TableTypeContext"]],["impl Send for WasmEdge_GlobalTypeContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalTypeContext"]],["impl Send for WasmEdge_ImportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ImportTypeContext"]],["impl Send for WasmEdge_ExportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ExportTypeContext"]],["impl Send for WasmEdge_CompilerContext",1,["wasmedge_sys::ffi::WasmEdge_CompilerContext"]],["impl Send for WasmEdge_LoaderContext",1,["wasmedge_sys::ffi::WasmEdge_LoaderContext"]],["impl Send for WasmEdge_ValidatorContext",1,["wasmedge_sys::ffi::WasmEdge_ValidatorContext"]],["impl Send for WasmEdge_ExecutorContext",1,["wasmedge_sys::ffi::WasmEdge_ExecutorContext"]],["impl Send for WasmEdge_StoreContext",1,["wasmedge_sys::ffi::WasmEdge_StoreContext"]],["impl Send for WasmEdge_ModuleInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_ModuleInstanceContext"]],["impl Send for WasmEdge_FunctionInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionInstanceContext"]],["impl Send for WasmEdge_TableInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_TableInstanceContext"]],["impl Send for WasmEdge_MemoryInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryInstanceContext"]],["impl Send for WasmEdge_GlobalInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalInstanceContext"]],["impl Send for WasmEdge_CallingFrameContext",1,["wasmedge_sys::ffi::WasmEdge_CallingFrameContext"]],["impl Send for WasmEdge_Async",1,["wasmedge_sys::ffi::WasmEdge_Async"]],["impl Send for WasmEdge_VMContext",1,["wasmedge_sys::ffi::WasmEdge_VMContext"]],["impl Send for WasmEdge_PluginContext",1,["wasmedge_sys::ffi::WasmEdge_PluginContext"]],["impl !Send for WasmEdge_ProgramOption",1,["wasmedge_sys::ffi::WasmEdge_ProgramOption"]],["impl !Send for WasmEdge_ModuleDescriptor",1,["wasmedge_sys::ffi::WasmEdge_ModuleDescriptor"]],["impl Send for WasmEdge_PluginVersionData",1,["wasmedge_sys::ffi::WasmEdge_PluginVersionData"]],["impl !Send for WasmEdge_PluginDescriptor",1,["wasmedge_sys::ffi::WasmEdge_PluginDescriptor"]],["impl Send for Module",1,["wasmedge_sys::ast_module::Module"]],["impl<'module> Send for ImportType<'module>",1,["wasmedge_sys::ast_module::ImportType"]],["impl<'module> Send for ExportType<'module>",1,["wasmedge_sys::ast_module::ExportType"]],["impl Send for Compiler",1,["wasmedge_sys::compiler::Compiler"]],["impl Send for Config",1,["wasmedge_sys::config::Config"]],["impl Send for Executor",1,["wasmedge_sys::executor::Executor"]],["impl Send for CallingFrame",1,["wasmedge_sys::frame::CallingFrame"]],["impl Send for Function",1,["wasmedge_sys::instance::function::Function"]],["impl Send for FuncType",1,["wasmedge_sys::instance::function::FuncType"]],["impl Send for FuncRef",1,["wasmedge_sys::instance::function::FuncRef"]],["impl Send for Global",1,["wasmedge_sys::instance::global::Global"]],["impl Send for GlobalType",1,["wasmedge_sys::instance::global::GlobalType"]],["impl Send for Memory",1,["wasmedge_sys::instance::memory::Memory"]],["impl Send for MemType",1,["wasmedge_sys::instance::memory::MemType"]],["impl Send for Instance",1,["wasmedge_sys::instance::module::Instance"]],["impl<T> Send for ImportModule<T>",1,["wasmedge_sys::instance::module::ImportModule"]],["impl Send for WasiModule",1,["wasmedge_sys::instance::module::WasiModule"]],["impl Send for WasiInstance",1,["wasmedge_sys::instance::module::WasiInstance"]],["impl Send for Table",1,["wasmedge_sys::instance::table::Table"]],["impl Send for TableType",1,["wasmedge_sys::instance::table::TableType"]],["impl Send for Loader",1,["wasmedge_sys::loader::Loader"]],["impl Send for PluginManager",1,["wasmedge_sys::plugin::PluginManager"]],["impl Send for Plugin",1,["wasmedge_sys::plugin::Plugin"]],["impl Send for ProgramOptionType",1,["wasmedge_sys::plugin::ProgramOptionType"]],["impl !Send for ModuleDescriptor",1,["wasmedge_sys::plugin::ModuleDescriptor"]],["impl Send for PluginVersion",1,["wasmedge_sys::plugin::PluginVersion"]],["impl !Send for PluginDescriptor",1,["wasmedge_sys::plugin::PluginDescriptor"]],["impl Send for PluginModule",1,["wasmedge_sys::plugin::PluginModule"]],["impl Send for Statistics",1,["wasmedge_sys::statistics::Statistics"]],["impl Send for Store",1,["wasmedge_sys::store::Store"]],["impl Send for WasmValue",1,["wasmedge_sys::types::WasmValue"]],["impl Send for Validator",1,["wasmedge_sys::validator::Validator"]],["impl Send for ProgramOption"]], +"wasmedge_types":[["impl Send for WasmEdgeError",1,["wasmedge_types::error::WasmEdgeError"]],["impl Send for FuncError",1,["wasmedge_types::error::FuncError"]],["impl Send for MemError",1,["wasmedge_types::error::MemError"]],["impl Send for GlobalError",1,["wasmedge_types::error::GlobalError"]],["impl Send for TableError",1,["wasmedge_types::error::TableError"]],["impl Send for ImportError",1,["wasmedge_types::error::ImportError"]],["impl Send for ExportError",1,["wasmedge_types::error::ExportError"]],["impl Send for InstanceError",1,["wasmedge_types::error::InstanceError"]],["impl Send for PluginError",1,["wasmedge_types::error::PluginError"]],["impl Send for StoreError",1,["wasmedge_types::error::StoreError"]],["impl Send for VmError",1,["wasmedge_types::error::VmError"]],["impl Send for CoreError",1,["wasmedge_types::error::CoreError"]],["impl Send for CoreCommonError",1,["wasmedge_types::error::CoreCommonError"]],["impl Send for CoreLoadError",1,["wasmedge_types::error::CoreLoadError"]],["impl Send for CoreValidationError",1,["wasmedge_types::error::CoreValidationError"]],["impl Send for CoreInstantiationError",1,["wasmedge_types::error::CoreInstantiationError"]],["impl Send for CoreExecutionError",1,["wasmedge_types::error::CoreExecutionError"]],["impl Send for HostFuncError",1,["wasmedge_types::error::HostFuncError"]],["impl Send for RefType",1,["wasmedge_types::RefType"]],["impl Send for ValType",1,["wasmedge_types::ValType"]],["impl Send for Mutability",1,["wasmedge_types::Mutability"]],["impl Send for CompilerOptimizationLevel",1,["wasmedge_types::CompilerOptimizationLevel"]],["impl Send for CompilerOutputFormat",1,["wasmedge_types::CompilerOutputFormat"]],["impl Send for HostRegistration",1,["wasmedge_types::HostRegistration"]],["impl Send for ExternalInstanceType",1,["wasmedge_types::ExternalInstanceType"]],["impl Send for FuncType",1,["wasmedge_types::FuncType"]],["impl Send for TableType",1,["wasmedge_types::TableType"]],["impl Send for MemoryType",1,["wasmedge_types::MemoryType"]],["impl Send for GlobalType",1,["wasmedge_types::GlobalType"]],["impl Send for NeverType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralEq.js b/trait.impl/core/marker/trait.StructuralEq.js new file mode 100644 index 000000000..8d6f9b2fd --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralEq.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl StructuralEq for Filestat"],["impl StructuralEq for ConnectState"],["impl StructuralEq for FileType"],["impl StructuralEq for Errno"]], +"wasmedge_sdk":[["impl StructuralEq for GraphEncoding"],["impl StructuralEq for ExecutionTarget"]], +"wasmedge_sys":[["impl StructuralEq for ProgramOptionType"]], +"wasmedge_types":[["impl StructuralEq for ImportError"],["impl StructuralEq for CoreInstantiationError"],["impl StructuralEq for FuncError"],["impl StructuralEq for PluginError"],["impl StructuralEq for HostFuncError"],["impl StructuralEq for TableError"],["impl StructuralEq for CoreValidationError"],["impl StructuralEq for CompilerOptimizationLevel"],["impl StructuralEq for CoreLoadError"],["impl StructuralEq for HostRegistration"],["impl StructuralEq for GlobalType"],["impl StructuralEq for MemError"],["impl StructuralEq for Mutability"],["impl StructuralEq for VmError"],["impl StructuralEq for MemoryType"],["impl StructuralEq for CoreExecutionError"],["impl StructuralEq for ValType"],["impl StructuralEq for ExportError"],["impl StructuralEq for WasmEdgeError"],["impl StructuralEq for CoreCommonError"],["impl StructuralEq for CoreError"],["impl StructuralEq for RefType"],["impl StructuralEq for GlobalError"],["impl StructuralEq for TableType"],["impl StructuralEq for FuncType"],["impl StructuralEq for CompilerOutputFormat"],["impl StructuralEq for ExternalInstanceType"],["impl StructuralEq for InstanceError"],["impl StructuralEq for StoreError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralPartialEq.js b/trait.impl/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 000000000..88e4d9bb0 --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl StructuralPartialEq for FileType"],["impl StructuralPartialEq for ConnectState"],["impl StructuralPartialEq for Filestat"],["impl StructuralPartialEq for Errno"],["impl StructuralPartialEq for SdFlags"]], +"wasmedge_sdk":[["impl StructuralPartialEq for ExecutionTarget"],["impl StructuralPartialEq for GraphEncoding"]], +"wasmedge_sys":[["impl StructuralPartialEq for ProgramOptionType"]], +"wasmedge_types":[["impl StructuralPartialEq for InstanceError"],["impl StructuralPartialEq for CoreCommonError"],["impl StructuralPartialEq for PluginError"],["impl StructuralPartialEq for CoreLoadError"],["impl StructuralPartialEq for MemoryType"],["impl StructuralPartialEq for ImportError"],["impl StructuralPartialEq for CoreInstantiationError"],["impl StructuralPartialEq for GlobalError"],["impl StructuralPartialEq for HostRegistration"],["impl StructuralPartialEq for VmError"],["impl StructuralPartialEq for WasmEdgeError"],["impl StructuralPartialEq for CoreError"],["impl StructuralPartialEq for MemError"],["impl StructuralPartialEq for RefType"],["impl StructuralPartialEq for ExportError"],["impl StructuralPartialEq for GlobalType"],["impl StructuralPartialEq for CompilerOutputFormat"],["impl StructuralPartialEq for FuncType"],["impl StructuralPartialEq for ValType"],["impl StructuralPartialEq for ExternalInstanceType"],["impl StructuralPartialEq for Mutability"],["impl StructuralPartialEq for FuncError"],["impl StructuralPartialEq for CoreValidationError"],["impl StructuralPartialEq for TableType"],["impl StructuralPartialEq for CompilerOptimizationLevel"],["impl StructuralPartialEq for HostFuncError"],["impl StructuralPartialEq for CoreExecutionError"],["impl StructuralPartialEq for TableError"],["impl StructuralPartialEq for StoreError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Sync.js b/trait.impl/core/marker/trait.Sync.js new file mode 100644 index 000000000..0e96b7cde --- /dev/null +++ b/trait.impl/core/marker/trait.Sync.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl<T> Sync for ObjectPool<T>where\n T: Sync,",1,["async_wasi::object_pool::ObjectPool"]],["impl<T> Sync for SerialObjectPool<T>where\n T: Sync,",1,["async_wasi::object_pool::SerialObjectPool"]],["impl<T> Sync for ObjectNode<T>where\n T: Sync,",1,["async_wasi::object_pool::ObjectNode"]],["impl Sync for __wasi_iovec_t",1,["async_wasi::snapshots::common::types::__wasi_iovec_t"]],["impl Sync for __wasi_ciovec_t",1,["async_wasi::snapshots::common::types::__wasi_ciovec_t"]],["impl Sync for __wasi_dirent_t",1,["async_wasi::snapshots::common::types::__wasi_dirent_t"]],["impl Sync for __wasi_fdstat_t",1,["async_wasi::snapshots::common::types::__wasi_fdstat_t"]],["impl Sync for __wasi_filestat_t",1,["async_wasi::snapshots::common::types::__wasi_filestat_t"]],["impl Sync for __wasi_event_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_event_fd_readwrite_t"]],["impl Sync for __wasi_event_t",1,["async_wasi::snapshots::common::types::__wasi_event_t"]],["impl Sync for __wasi_subscription_clock_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_clock_t"]],["impl Sync for __wasi_subscription_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_fd_readwrite_t"]],["impl Sync for __wasi_subscription_u_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_u_t"]],["impl Sync for __wasi_subscription_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_t"]],["impl Sync for __wasi_subscription_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_t"]],["impl Sync for __wasi_address_t",1,["async_wasi::snapshots::common::types::__wasi_address_t"]],["impl Sync for __wasi_sockaddr_in_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_in_t"]],["impl Sync for __wasi_sockaddr_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_t"]],["impl Sync for __wasi_addrinfo_t",1,["async_wasi::snapshots::common::types::__wasi_addrinfo_t"]],["impl Sync for __wasi_prestat_dir_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_dir_t"]],["impl Sync for __wasi_prestat_u_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_u_t"]],["impl Sync for __wasi_prestat_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_t"]],["impl Sync for __wasi_timeval",1,["async_wasi::snapshots::common::types::__wasi_timeval"]],["impl Sync for Errno",1,["async_wasi::snapshots::common::error::Errno"]],["impl<T> Sync for WasmPtr<T>where\n T: Sync,",1,["async_wasi::snapshots::common::memory::WasmPtr"]],["impl Sync for AsyncWasiSocket",1,["async_wasi::snapshots::common::net::async_tokio::AsyncWasiSocket"]],["impl Sync for AddressFamily",1,["async_wasi::snapshots::common::net::AddressFamily"]],["impl Sync for SocketType",1,["async_wasi::snapshots::common::net::SocketType"]],["impl Sync for ConnectState",1,["async_wasi::snapshots::common::net::ConnectState"]],["impl Sync for WasiSocketState",1,["async_wasi::snapshots::common::net::WasiSocketState"]],["impl Sync for SubscriptionFdType",1,["async_wasi::snapshots::common::net::SubscriptionFdType"]],["impl Sync for SubscriptionFd",1,["async_wasi::snapshots::common::net::SubscriptionFd"]],["impl Sync for SubscriptionClock",1,["async_wasi::snapshots::common::net::SubscriptionClock"]],["impl Sync for Subscription",1,["async_wasi::snapshots::common::net::Subscription"]],["impl Sync for PrePoll",1,["async_wasi::snapshots::common::net::PrePoll"]],["impl Sync for WasiStdin",1,["async_wasi::snapshots::common::vfs::sync::WasiStdin"]],["impl Sync for WasiStdout",1,["async_wasi::snapshots::common::vfs::sync::WasiStdout"]],["impl Sync for WasiStderr",1,["async_wasi::snapshots::common::vfs::sync::WasiStderr"]],["impl Sync for WasiFile",1,["async_wasi::snapshots::common::vfs::sync::WasiFile"]],["impl Sync for WasiPreOpenDir",1,["async_wasi::snapshots::common::vfs::sync::WasiPreOpenDir"]],["impl Sync for WasiDir",1,["async_wasi::snapshots::common::vfs::sync::WasiDir"]],["impl Sync for INode",1,["async_wasi::snapshots::common::vfs::sync::INode"]],["impl Sync for SystemTimeSpec",1,["async_wasi::snapshots::common::vfs::SystemTimeSpec"]],["impl Sync for ReaddirEntity",1,["async_wasi::snapshots::common::vfs::ReaddirEntity"]],["impl Sync for FdStat",1,["async_wasi::snapshots::common::vfs::FdStat"]],["impl Sync for Filestat",1,["async_wasi::snapshots::common::vfs::Filestat"]],["impl Sync for FileType",1,["async_wasi::snapshots::common::vfs::FileType"]],["impl Sync for FdFlags",1,["async_wasi::snapshots::common::vfs::FdFlags"]],["impl Sync for SdFlags",1,["async_wasi::snapshots::common::vfs::SdFlags"]],["impl Sync for SiFlags",1,["async_wasi::snapshots::common::vfs::SiFlags"]],["impl Sync for RiFlags",1,["async_wasi::snapshots::common::vfs::RiFlags"]],["impl Sync for RoFlags",1,["async_wasi::snapshots::common::vfs::RoFlags"]],["impl Sync for OFlags",1,["async_wasi::snapshots::common::vfs::OFlags"]],["impl Sync for WASIRights",1,["async_wasi::snapshots::common::vfs::WASIRights"]],["impl Sync for Lookupflags",1,["async_wasi::snapshots::common::vfs::Lookupflags"]],["impl Sync for Advice",1,["async_wasi::snapshots::common::vfs::Advice"]],["impl Sync for VFD",1,["async_wasi::snapshots::env::VFD"]],["impl Sync for AddressFamily",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::AddressFamily"]],["impl Sync for WasiSockaddr",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiSockaddr"]],["impl Sync for WasiAddrinfo",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiAddrinfo"]],["impl Sync for PollFdState",1,["async_wasi::snapshots::serialize::PollFdState"]],["impl Sync for IoState",1,["async_wasi::snapshots::serialize::IoState"]],["impl Sync for SerialWasiCtx",1,["async_wasi::snapshots::serialize::SerialWasiCtx"]],["impl Sync for SerialSocketType",1,["async_wasi::snapshots::serialize::SerialSocketType"]],["impl Sync for SerialConnectState",1,["async_wasi::snapshots::serialize::SerialConnectState"]],["impl Sync for SerialWasiSocketState",1,["async_wasi::snapshots::serialize::SerialWasiSocketState"]],["impl Sync for SerialStdin",1,["async_wasi::snapshots::serialize::SerialStdin"]],["impl Sync for SerialStdout",1,["async_wasi::snapshots::serialize::SerialStdout"]],["impl Sync for SerialStderr",1,["async_wasi::snapshots::serialize::SerialStderr"]],["impl Sync for SerialWasiDir",1,["async_wasi::snapshots::serialize::SerialWasiDir"]],["impl Sync for SerialWasiFile",1,["async_wasi::snapshots::serialize::SerialWasiFile"]],["impl Sync for SerialTcpServer",1,["async_wasi::snapshots::serialize::SerialTcpServer"]],["impl Sync for SerialUdpSocket",1,["async_wasi::snapshots::serialize::SerialUdpSocket"]],["impl Sync for SerialPreOpen",1,["async_wasi::snapshots::serialize::SerialPreOpen"]],["impl Sync for SerialVFD",1,["async_wasi::snapshots::serialize::SerialVFD"]],["impl Sync for WasiCtx"]], +"wasmedge_sdk":[["impl Sync for Caller",1,["wasmedge_sdk::caller::Caller"]],["impl Sync for Compiler",1,["wasmedge_sdk::compiler::Compiler"]],["impl Sync for ConfigBuilder",1,["wasmedge_sdk::config::ConfigBuilder"]],["impl Sync for Config",1,["wasmedge_sdk::config::Config"]],["impl Sync for CommonConfigOptions",1,["wasmedge_sdk::config::CommonConfigOptions"]],["impl Sync for CompilerConfigOptions",1,["wasmedge_sdk::config::CompilerConfigOptions"]],["impl Sync for RuntimeConfigOptions",1,["wasmedge_sdk::config::RuntimeConfigOptions"]],["impl Sync for StatisticsConfigOptions",1,["wasmedge_sdk::config::StatisticsConfigOptions"]],["impl Sync for HostRegistrationConfigOptions",1,["wasmedge_sdk::config::HostRegistrationConfigOptions"]],["impl<'a> Sync for Param<'a>",1,["wasmedge_sdk::dock::Param"]],["impl Sync for Executor",1,["wasmedge_sdk::executor::Executor"]],["impl Sync for Func",1,["wasmedge_sdk::externals::function::Func"]],["impl Sync for FuncTypeBuilder",1,["wasmedge_sdk::externals::function::FuncTypeBuilder"]],["impl Sync for FuncRef",1,["wasmedge_sdk::externals::function::FuncRef"]],["impl Sync for Global",1,["wasmedge_sdk::externals::global::Global"]],["impl Sync for Memory",1,["wasmedge_sdk::externals::memory::Memory"]],["impl Sync for Table",1,["wasmedge_sdk::externals::table::Table"]],["impl Sync for ImportObjectBuilder",1,["wasmedge_sdk::import::ImportObjectBuilder"]],["impl<T> Sync for ImportObject<T>",1,["wasmedge_sdk::import::ImportObject"]],["impl Sync for Instance",1,["wasmedge_sdk::instance::Instance"]],["impl Sync for LogManager",1,["wasmedge_sdk::log::LogManager"]],["impl Sync for Module",1,["wasmedge_sdk::module::Module"]],["impl<'module> Sync for ImportType<'module>",1,["wasmedge_sdk::module::ImportType"]],["impl<'module> Sync for ExportType<'module>",1,["wasmedge_sdk::module::ExportType"]],["impl Sync for NNPreload",1,["wasmedge_sdk::plugin::NNPreload"]],["impl Sync for GraphEncoding",1,["wasmedge_sdk::plugin::GraphEncoding"]],["impl Sync for ExecutionTarget",1,["wasmedge_sdk::plugin::ExecutionTarget"]],["impl Sync for PluginManager",1,["wasmedge_sdk::plugin::PluginManager"]],["impl Sync for Plugin",1,["wasmedge_sdk::plugin::Plugin"]],["impl !Sync for PluginDescriptor",1,["wasmedge_sdk::plugin::PluginDescriptor"]],["impl Sync for PluginVersion",1,["wasmedge_sdk::plugin::PluginVersion"]],["impl<T> Sync for PluginModuleBuilder<T>",1,["wasmedge_sdk::plugin::PluginModuleBuilder"]],["impl Sync for PluginModule",1,["wasmedge_sdk::plugin::PluginModule"]],["impl Sync for Statistics",1,["wasmedge_sdk::statistics::Statistics"]],["impl Sync for Store",1,["wasmedge_sdk::store::Store"]],["impl Sync for Val",1,["wasmedge_sdk::types::Val"]],["impl Sync for ExternRef",1,["wasmedge_sdk::types::ExternRef"]],["impl Sync for Driver",1,["wasmedge_sdk::utils::Driver"]],["impl Sync for CoreVersion",1,["wasmedge_sdk::utils::CoreVersion"]],["impl Sync for VmBuilder",1,["wasmedge_sdk::vm::VmBuilder"]],["impl Sync for Vm",1,["wasmedge_sdk::vm::Vm"]],["impl Sync for WasiInstance",1,["wasmedge_sdk::wasi::WasiInstance"]],["impl Sync for VmDock"]], +"wasmedge_sys":[["impl Sync for __fsid_t",1,["wasmedge_sys::ffi::__fsid_t"]],["impl Sync for WasmEdge_Value",1,["wasmedge_sys::ffi::WasmEdge_Value"]],["impl !Sync for WasmEdge_String",1,["wasmedge_sys::ffi::WasmEdge_String"]],["impl Sync for WasmEdge_Result",1,["wasmedge_sys::ffi::WasmEdge_Result"]],["impl Sync for WasmEdge_Limit",1,["wasmedge_sys::ffi::WasmEdge_Limit"]],["impl Sync for WasmEdge_ConfigureContext",1,["wasmedge_sys::ffi::WasmEdge_ConfigureContext"]],["impl Sync for WasmEdge_StatisticsContext",1,["wasmedge_sys::ffi::WasmEdge_StatisticsContext"]],["impl Sync for WasmEdge_ASTModuleContext",1,["wasmedge_sys::ffi::WasmEdge_ASTModuleContext"]],["impl Sync for WasmEdge_FunctionTypeContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionTypeContext"]],["impl Sync for WasmEdge_MemoryTypeContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryTypeContext"]],["impl Sync for WasmEdge_TableTypeContext",1,["wasmedge_sys::ffi::WasmEdge_TableTypeContext"]],["impl Sync for WasmEdge_GlobalTypeContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalTypeContext"]],["impl Sync for WasmEdge_ImportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ImportTypeContext"]],["impl Sync for WasmEdge_ExportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ExportTypeContext"]],["impl Sync for WasmEdge_CompilerContext",1,["wasmedge_sys::ffi::WasmEdge_CompilerContext"]],["impl Sync for WasmEdge_LoaderContext",1,["wasmedge_sys::ffi::WasmEdge_LoaderContext"]],["impl Sync for WasmEdge_ValidatorContext",1,["wasmedge_sys::ffi::WasmEdge_ValidatorContext"]],["impl Sync for WasmEdge_ExecutorContext",1,["wasmedge_sys::ffi::WasmEdge_ExecutorContext"]],["impl Sync for WasmEdge_StoreContext",1,["wasmedge_sys::ffi::WasmEdge_StoreContext"]],["impl Sync for WasmEdge_ModuleInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_ModuleInstanceContext"]],["impl Sync for WasmEdge_FunctionInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionInstanceContext"]],["impl Sync for WasmEdge_TableInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_TableInstanceContext"]],["impl Sync for WasmEdge_MemoryInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryInstanceContext"]],["impl Sync for WasmEdge_GlobalInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalInstanceContext"]],["impl Sync for WasmEdge_CallingFrameContext",1,["wasmedge_sys::ffi::WasmEdge_CallingFrameContext"]],["impl Sync for WasmEdge_Async",1,["wasmedge_sys::ffi::WasmEdge_Async"]],["impl Sync for WasmEdge_VMContext",1,["wasmedge_sys::ffi::WasmEdge_VMContext"]],["impl Sync for WasmEdge_PluginContext",1,["wasmedge_sys::ffi::WasmEdge_PluginContext"]],["impl !Sync for WasmEdge_ProgramOption",1,["wasmedge_sys::ffi::WasmEdge_ProgramOption"]],["impl !Sync for WasmEdge_ModuleDescriptor",1,["wasmedge_sys::ffi::WasmEdge_ModuleDescriptor"]],["impl Sync for WasmEdge_PluginVersionData",1,["wasmedge_sys::ffi::WasmEdge_PluginVersionData"]],["impl !Sync for WasmEdge_PluginDescriptor",1,["wasmedge_sys::ffi::WasmEdge_PluginDescriptor"]],["impl Sync for Module",1,["wasmedge_sys::ast_module::Module"]],["impl<'module> Sync for ImportType<'module>",1,["wasmedge_sys::ast_module::ImportType"]],["impl<'module> Sync for ExportType<'module>",1,["wasmedge_sys::ast_module::ExportType"]],["impl Sync for Compiler",1,["wasmedge_sys::compiler::Compiler"]],["impl Sync for Config",1,["wasmedge_sys::config::Config"]],["impl Sync for Executor",1,["wasmedge_sys::executor::Executor"]],["impl Sync for CallingFrame",1,["wasmedge_sys::frame::CallingFrame"]],["impl Sync for Function",1,["wasmedge_sys::instance::function::Function"]],["impl Sync for FuncType",1,["wasmedge_sys::instance::function::FuncType"]],["impl Sync for FuncRef",1,["wasmedge_sys::instance::function::FuncRef"]],["impl Sync for Global",1,["wasmedge_sys::instance::global::Global"]],["impl Sync for GlobalType",1,["wasmedge_sys::instance::global::GlobalType"]],["impl Sync for Memory",1,["wasmedge_sys::instance::memory::Memory"]],["impl Sync for MemType",1,["wasmedge_sys::instance::memory::MemType"]],["impl Sync for Instance",1,["wasmedge_sys::instance::module::Instance"]],["impl<T> Sync for ImportModule<T>",1,["wasmedge_sys::instance::module::ImportModule"]],["impl Sync for WasiModule",1,["wasmedge_sys::instance::module::WasiModule"]],["impl Sync for WasiInstance",1,["wasmedge_sys::instance::module::WasiInstance"]],["impl Sync for Table",1,["wasmedge_sys::instance::table::Table"]],["impl Sync for TableType",1,["wasmedge_sys::instance::table::TableType"]],["impl Sync for Loader",1,["wasmedge_sys::loader::Loader"]],["impl Sync for PluginManager",1,["wasmedge_sys::plugin::PluginManager"]],["impl Sync for Plugin",1,["wasmedge_sys::plugin::Plugin"]],["impl Sync for ProgramOptionType",1,["wasmedge_sys::plugin::ProgramOptionType"]],["impl !Sync for ModuleDescriptor",1,["wasmedge_sys::plugin::ModuleDescriptor"]],["impl Sync for PluginVersion",1,["wasmedge_sys::plugin::PluginVersion"]],["impl !Sync for PluginDescriptor",1,["wasmedge_sys::plugin::PluginDescriptor"]],["impl Sync for PluginModule",1,["wasmedge_sys::plugin::PluginModule"]],["impl Sync for Statistics",1,["wasmedge_sys::statistics::Statistics"]],["impl Sync for Store",1,["wasmedge_sys::store::Store"]],["impl Sync for WasmValue",1,["wasmedge_sys::types::WasmValue"]],["impl Sync for Validator",1,["wasmedge_sys::validator::Validator"]],["impl Sync for ProgramOption"]], +"wasmedge_types":[["impl Sync for WasmEdgeError",1,["wasmedge_types::error::WasmEdgeError"]],["impl Sync for FuncError",1,["wasmedge_types::error::FuncError"]],["impl Sync for MemError",1,["wasmedge_types::error::MemError"]],["impl Sync for GlobalError",1,["wasmedge_types::error::GlobalError"]],["impl Sync for TableError",1,["wasmedge_types::error::TableError"]],["impl Sync for ImportError",1,["wasmedge_types::error::ImportError"]],["impl Sync for ExportError",1,["wasmedge_types::error::ExportError"]],["impl Sync for InstanceError",1,["wasmedge_types::error::InstanceError"]],["impl Sync for PluginError",1,["wasmedge_types::error::PluginError"]],["impl Sync for StoreError",1,["wasmedge_types::error::StoreError"]],["impl Sync for VmError",1,["wasmedge_types::error::VmError"]],["impl Sync for CoreError",1,["wasmedge_types::error::CoreError"]],["impl Sync for CoreCommonError",1,["wasmedge_types::error::CoreCommonError"]],["impl Sync for CoreLoadError",1,["wasmedge_types::error::CoreLoadError"]],["impl Sync for CoreValidationError",1,["wasmedge_types::error::CoreValidationError"]],["impl Sync for CoreInstantiationError",1,["wasmedge_types::error::CoreInstantiationError"]],["impl Sync for CoreExecutionError",1,["wasmedge_types::error::CoreExecutionError"]],["impl Sync for HostFuncError",1,["wasmedge_types::error::HostFuncError"]],["impl Sync for RefType",1,["wasmedge_types::RefType"]],["impl Sync for ValType",1,["wasmedge_types::ValType"]],["impl Sync for Mutability",1,["wasmedge_types::Mutability"]],["impl Sync for CompilerOptimizationLevel",1,["wasmedge_types::CompilerOptimizationLevel"]],["impl Sync for CompilerOutputFormat",1,["wasmedge_types::CompilerOutputFormat"]],["impl Sync for HostRegistration",1,["wasmedge_types::HostRegistration"]],["impl Sync for ExternalInstanceType",1,["wasmedge_types::ExternalInstanceType"]],["impl Sync for FuncType",1,["wasmedge_types::FuncType"]],["impl Sync for TableType",1,["wasmedge_types::TableType"]],["impl Sync for MemoryType",1,["wasmedge_types::MemoryType"]],["impl Sync for GlobalType",1,["wasmedge_types::GlobalType"]],["impl Sync for NeverType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Unpin.js b/trait.impl/core/marker/trait.Unpin.js new file mode 100644 index 000000000..125d6bd68 --- /dev/null +++ b/trait.impl/core/marker/trait.Unpin.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl<T> Unpin for ObjectPool<T>where\n T: Unpin,",1,["async_wasi::object_pool::ObjectPool"]],["impl<T> Unpin for SerialObjectPool<T>where\n T: Unpin,",1,["async_wasi::object_pool::SerialObjectPool"]],["impl<T> Unpin for ObjectNode<T>where\n T: Unpin,",1,["async_wasi::object_pool::ObjectNode"]],["impl Unpin for __wasi_iovec_t",1,["async_wasi::snapshots::common::types::__wasi_iovec_t"]],["impl Unpin for __wasi_ciovec_t",1,["async_wasi::snapshots::common::types::__wasi_ciovec_t"]],["impl Unpin for __wasi_dirent_t",1,["async_wasi::snapshots::common::types::__wasi_dirent_t"]],["impl Unpin for __wasi_fdstat_t",1,["async_wasi::snapshots::common::types::__wasi_fdstat_t"]],["impl Unpin for __wasi_filestat_t",1,["async_wasi::snapshots::common::types::__wasi_filestat_t"]],["impl Unpin for __wasi_event_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_event_fd_readwrite_t"]],["impl Unpin for __wasi_event_t",1,["async_wasi::snapshots::common::types::__wasi_event_t"]],["impl Unpin for __wasi_subscription_clock_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_clock_t"]],["impl Unpin for __wasi_subscription_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_fd_readwrite_t"]],["impl Unpin for __wasi_subscription_u_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_u_t"]],["impl Unpin for __wasi_subscription_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_t"]],["impl Unpin for __wasi_subscription_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_t"]],["impl Unpin for __wasi_address_t",1,["async_wasi::snapshots::common::types::__wasi_address_t"]],["impl Unpin for __wasi_sockaddr_in_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_in_t"]],["impl Unpin for __wasi_sockaddr_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_t"]],["impl Unpin for __wasi_addrinfo_t",1,["async_wasi::snapshots::common::types::__wasi_addrinfo_t"]],["impl Unpin for __wasi_prestat_dir_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_dir_t"]],["impl Unpin for __wasi_prestat_u_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_u_t"]],["impl Unpin for __wasi_prestat_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_t"]],["impl Unpin for __wasi_timeval",1,["async_wasi::snapshots::common::types::__wasi_timeval"]],["impl Unpin for Errno",1,["async_wasi::snapshots::common::error::Errno"]],["impl<T> Unpin for WasmPtr<T>where\n T: Unpin,",1,["async_wasi::snapshots::common::memory::WasmPtr"]],["impl Unpin for AsyncWasiSocket",1,["async_wasi::snapshots::common::net::async_tokio::AsyncWasiSocket"]],["impl Unpin for AddressFamily",1,["async_wasi::snapshots::common::net::AddressFamily"]],["impl Unpin for SocketType",1,["async_wasi::snapshots::common::net::SocketType"]],["impl Unpin for ConnectState",1,["async_wasi::snapshots::common::net::ConnectState"]],["impl Unpin for WasiSocketState",1,["async_wasi::snapshots::common::net::WasiSocketState"]],["impl Unpin for SubscriptionFdType",1,["async_wasi::snapshots::common::net::SubscriptionFdType"]],["impl Unpin for SubscriptionFd",1,["async_wasi::snapshots::common::net::SubscriptionFd"]],["impl Unpin for SubscriptionClock",1,["async_wasi::snapshots::common::net::SubscriptionClock"]],["impl Unpin for Subscription",1,["async_wasi::snapshots::common::net::Subscription"]],["impl Unpin for PrePoll",1,["async_wasi::snapshots::common::net::PrePoll"]],["impl Unpin for WasiStdin",1,["async_wasi::snapshots::common::vfs::sync::WasiStdin"]],["impl Unpin for WasiStdout",1,["async_wasi::snapshots::common::vfs::sync::WasiStdout"]],["impl Unpin for WasiStderr",1,["async_wasi::snapshots::common::vfs::sync::WasiStderr"]],["impl Unpin for WasiFile",1,["async_wasi::snapshots::common::vfs::sync::WasiFile"]],["impl Unpin for WasiPreOpenDir",1,["async_wasi::snapshots::common::vfs::sync::WasiPreOpenDir"]],["impl Unpin for WasiDir",1,["async_wasi::snapshots::common::vfs::sync::WasiDir"]],["impl Unpin for INode",1,["async_wasi::snapshots::common::vfs::sync::INode"]],["impl Unpin for SystemTimeSpec",1,["async_wasi::snapshots::common::vfs::SystemTimeSpec"]],["impl Unpin for ReaddirEntity",1,["async_wasi::snapshots::common::vfs::ReaddirEntity"]],["impl Unpin for FdStat",1,["async_wasi::snapshots::common::vfs::FdStat"]],["impl Unpin for Filestat",1,["async_wasi::snapshots::common::vfs::Filestat"]],["impl Unpin for FileType",1,["async_wasi::snapshots::common::vfs::FileType"]],["impl Unpin for FdFlags",1,["async_wasi::snapshots::common::vfs::FdFlags"]],["impl Unpin for SdFlags",1,["async_wasi::snapshots::common::vfs::SdFlags"]],["impl Unpin for SiFlags",1,["async_wasi::snapshots::common::vfs::SiFlags"]],["impl Unpin for RiFlags",1,["async_wasi::snapshots::common::vfs::RiFlags"]],["impl Unpin for RoFlags",1,["async_wasi::snapshots::common::vfs::RoFlags"]],["impl Unpin for OFlags",1,["async_wasi::snapshots::common::vfs::OFlags"]],["impl Unpin for WASIRights",1,["async_wasi::snapshots::common::vfs::WASIRights"]],["impl Unpin for Lookupflags",1,["async_wasi::snapshots::common::vfs::Lookupflags"]],["impl Unpin for Advice",1,["async_wasi::snapshots::common::vfs::Advice"]],["impl Unpin for VFD",1,["async_wasi::snapshots::env::VFD"]],["impl Unpin for AddressFamily",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::AddressFamily"]],["impl Unpin for WasiSockaddr",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiSockaddr"]],["impl Unpin for WasiAddrinfo",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiAddrinfo"]],["impl Unpin for PollFdState",1,["async_wasi::snapshots::serialize::PollFdState"]],["impl Unpin for IoState",1,["async_wasi::snapshots::serialize::IoState"]],["impl Unpin for SerialWasiCtx",1,["async_wasi::snapshots::serialize::SerialWasiCtx"]],["impl Unpin for SerialSocketType",1,["async_wasi::snapshots::serialize::SerialSocketType"]],["impl Unpin for SerialConnectState",1,["async_wasi::snapshots::serialize::SerialConnectState"]],["impl Unpin for SerialWasiSocketState",1,["async_wasi::snapshots::serialize::SerialWasiSocketState"]],["impl Unpin for SerialStdin",1,["async_wasi::snapshots::serialize::SerialStdin"]],["impl Unpin for SerialStdout",1,["async_wasi::snapshots::serialize::SerialStdout"]],["impl Unpin for SerialStderr",1,["async_wasi::snapshots::serialize::SerialStderr"]],["impl Unpin for SerialWasiDir",1,["async_wasi::snapshots::serialize::SerialWasiDir"]],["impl Unpin for SerialWasiFile",1,["async_wasi::snapshots::serialize::SerialWasiFile"]],["impl Unpin for SerialTcpServer",1,["async_wasi::snapshots::serialize::SerialTcpServer"]],["impl Unpin for SerialUdpSocket",1,["async_wasi::snapshots::serialize::SerialUdpSocket"]],["impl Unpin for SerialPreOpen",1,["async_wasi::snapshots::serialize::SerialPreOpen"]],["impl Unpin for SerialVFD",1,["async_wasi::snapshots::serialize::SerialVFD"]],["impl Unpin for WasiCtx",1,["async_wasi::snapshots::WasiCtx"]]], +"wasmedge_sdk":[["impl Unpin for Caller",1,["wasmedge_sdk::caller::Caller"]],["impl Unpin for Compiler",1,["wasmedge_sdk::compiler::Compiler"]],["impl Unpin for ConfigBuilder",1,["wasmedge_sdk::config::ConfigBuilder"]],["impl Unpin for Config",1,["wasmedge_sdk::config::Config"]],["impl Unpin for CommonConfigOptions",1,["wasmedge_sdk::config::CommonConfigOptions"]],["impl Unpin for CompilerConfigOptions",1,["wasmedge_sdk::config::CompilerConfigOptions"]],["impl Unpin for RuntimeConfigOptions",1,["wasmedge_sdk::config::RuntimeConfigOptions"]],["impl Unpin for StatisticsConfigOptions",1,["wasmedge_sdk::config::StatisticsConfigOptions"]],["impl Unpin for HostRegistrationConfigOptions",1,["wasmedge_sdk::config::HostRegistrationConfigOptions"]],["impl Unpin for VmDock",1,["wasmedge_sdk::dock::VmDock"]],["impl<'a> Unpin for Param<'a>",1,["wasmedge_sdk::dock::Param"]],["impl Unpin for Executor",1,["wasmedge_sdk::executor::Executor"]],["impl Unpin for Func",1,["wasmedge_sdk::externals::function::Func"]],["impl Unpin for FuncTypeBuilder",1,["wasmedge_sdk::externals::function::FuncTypeBuilder"]],["impl Unpin for FuncRef",1,["wasmedge_sdk::externals::function::FuncRef"]],["impl Unpin for Global",1,["wasmedge_sdk::externals::global::Global"]],["impl Unpin for Memory",1,["wasmedge_sdk::externals::memory::Memory"]],["impl Unpin for Table",1,["wasmedge_sdk::externals::table::Table"]],["impl Unpin for ImportObjectBuilder",1,["wasmedge_sdk::import::ImportObjectBuilder"]],["impl<T> Unpin for ImportObject<T>",1,["wasmedge_sdk::import::ImportObject"]],["impl Unpin for Instance",1,["wasmedge_sdk::instance::Instance"]],["impl Unpin for LogManager",1,["wasmedge_sdk::log::LogManager"]],["impl Unpin for Module",1,["wasmedge_sdk::module::Module"]],["impl<'module> Unpin for ImportType<'module>",1,["wasmedge_sdk::module::ImportType"]],["impl<'module> Unpin for ExportType<'module>",1,["wasmedge_sdk::module::ExportType"]],["impl Unpin for NNPreload",1,["wasmedge_sdk::plugin::NNPreload"]],["impl Unpin for GraphEncoding",1,["wasmedge_sdk::plugin::GraphEncoding"]],["impl Unpin for ExecutionTarget",1,["wasmedge_sdk::plugin::ExecutionTarget"]],["impl Unpin for PluginManager",1,["wasmedge_sdk::plugin::PluginManager"]],["impl Unpin for Plugin",1,["wasmedge_sdk::plugin::Plugin"]],["impl Unpin for PluginDescriptor",1,["wasmedge_sdk::plugin::PluginDescriptor"]],["impl Unpin for PluginVersion",1,["wasmedge_sdk::plugin::PluginVersion"]],["impl<T> Unpin for PluginModuleBuilder<T>",1,["wasmedge_sdk::plugin::PluginModuleBuilder"]],["impl Unpin for PluginModule",1,["wasmedge_sdk::plugin::PluginModule"]],["impl Unpin for Statistics",1,["wasmedge_sdk::statistics::Statistics"]],["impl Unpin for Store",1,["wasmedge_sdk::store::Store"]],["impl Unpin for Val",1,["wasmedge_sdk::types::Val"]],["impl Unpin for ExternRef",1,["wasmedge_sdk::types::ExternRef"]],["impl Unpin for Driver",1,["wasmedge_sdk::utils::Driver"]],["impl Unpin for CoreVersion",1,["wasmedge_sdk::utils::CoreVersion"]],["impl Unpin for VmBuilder",1,["wasmedge_sdk::vm::VmBuilder"]],["impl Unpin for Vm",1,["wasmedge_sdk::vm::Vm"]],["impl Unpin for WasiInstance",1,["wasmedge_sdk::wasi::WasiInstance"]]], +"wasmedge_sys":[["impl Unpin for __fsid_t",1,["wasmedge_sys::ffi::__fsid_t"]],["impl Unpin for WasmEdge_Value",1,["wasmedge_sys::ffi::WasmEdge_Value"]],["impl Unpin for WasmEdge_String",1,["wasmedge_sys::ffi::WasmEdge_String"]],["impl Unpin for WasmEdge_Result",1,["wasmedge_sys::ffi::WasmEdge_Result"]],["impl Unpin for WasmEdge_Limit",1,["wasmedge_sys::ffi::WasmEdge_Limit"]],["impl Unpin for WasmEdge_ConfigureContext",1,["wasmedge_sys::ffi::WasmEdge_ConfigureContext"]],["impl Unpin for WasmEdge_StatisticsContext",1,["wasmedge_sys::ffi::WasmEdge_StatisticsContext"]],["impl Unpin for WasmEdge_ASTModuleContext",1,["wasmedge_sys::ffi::WasmEdge_ASTModuleContext"]],["impl Unpin for WasmEdge_FunctionTypeContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionTypeContext"]],["impl Unpin for WasmEdge_MemoryTypeContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryTypeContext"]],["impl Unpin for WasmEdge_TableTypeContext",1,["wasmedge_sys::ffi::WasmEdge_TableTypeContext"]],["impl Unpin for WasmEdge_GlobalTypeContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalTypeContext"]],["impl Unpin for WasmEdge_ImportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ImportTypeContext"]],["impl Unpin for WasmEdge_ExportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ExportTypeContext"]],["impl Unpin for WasmEdge_CompilerContext",1,["wasmedge_sys::ffi::WasmEdge_CompilerContext"]],["impl Unpin for WasmEdge_LoaderContext",1,["wasmedge_sys::ffi::WasmEdge_LoaderContext"]],["impl Unpin for WasmEdge_ValidatorContext",1,["wasmedge_sys::ffi::WasmEdge_ValidatorContext"]],["impl Unpin for WasmEdge_ExecutorContext",1,["wasmedge_sys::ffi::WasmEdge_ExecutorContext"]],["impl Unpin for WasmEdge_StoreContext",1,["wasmedge_sys::ffi::WasmEdge_StoreContext"]],["impl Unpin for WasmEdge_ModuleInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_ModuleInstanceContext"]],["impl Unpin for WasmEdge_FunctionInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionInstanceContext"]],["impl Unpin for WasmEdge_TableInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_TableInstanceContext"]],["impl Unpin for WasmEdge_MemoryInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryInstanceContext"]],["impl Unpin for WasmEdge_GlobalInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalInstanceContext"]],["impl Unpin for WasmEdge_CallingFrameContext",1,["wasmedge_sys::ffi::WasmEdge_CallingFrameContext"]],["impl Unpin for WasmEdge_Async",1,["wasmedge_sys::ffi::WasmEdge_Async"]],["impl Unpin for WasmEdge_VMContext",1,["wasmedge_sys::ffi::WasmEdge_VMContext"]],["impl Unpin for WasmEdge_PluginContext",1,["wasmedge_sys::ffi::WasmEdge_PluginContext"]],["impl Unpin for WasmEdge_ProgramOption",1,["wasmedge_sys::ffi::WasmEdge_ProgramOption"]],["impl Unpin for WasmEdge_ModuleDescriptor",1,["wasmedge_sys::ffi::WasmEdge_ModuleDescriptor"]],["impl Unpin for WasmEdge_PluginVersionData",1,["wasmedge_sys::ffi::WasmEdge_PluginVersionData"]],["impl Unpin for WasmEdge_PluginDescriptor",1,["wasmedge_sys::ffi::WasmEdge_PluginDescriptor"]],["impl Unpin for Module",1,["wasmedge_sys::ast_module::Module"]],["impl<'module> Unpin for ImportType<'module>",1,["wasmedge_sys::ast_module::ImportType"]],["impl<'module> Unpin for ExportType<'module>",1,["wasmedge_sys::ast_module::ExportType"]],["impl Unpin for Compiler",1,["wasmedge_sys::compiler::Compiler"]],["impl Unpin for Config",1,["wasmedge_sys::config::Config"]],["impl Unpin for Executor",1,["wasmedge_sys::executor::Executor"]],["impl Unpin for CallingFrame",1,["wasmedge_sys::frame::CallingFrame"]],["impl Unpin for Function",1,["wasmedge_sys::instance::function::Function"]],["impl Unpin for FuncType",1,["wasmedge_sys::instance::function::FuncType"]],["impl Unpin for FuncRef",1,["wasmedge_sys::instance::function::FuncRef"]],["impl Unpin for Global",1,["wasmedge_sys::instance::global::Global"]],["impl Unpin for GlobalType",1,["wasmedge_sys::instance::global::GlobalType"]],["impl Unpin for Memory",1,["wasmedge_sys::instance::memory::Memory"]],["impl Unpin for MemType",1,["wasmedge_sys::instance::memory::MemType"]],["impl Unpin for Instance",1,["wasmedge_sys::instance::module::Instance"]],["impl<T> Unpin for ImportModule<T>",1,["wasmedge_sys::instance::module::ImportModule"]],["impl Unpin for WasiModule",1,["wasmedge_sys::instance::module::WasiModule"]],["impl Unpin for WasiInstance",1,["wasmedge_sys::instance::module::WasiInstance"]],["impl Unpin for Table",1,["wasmedge_sys::instance::table::Table"]],["impl Unpin for TableType",1,["wasmedge_sys::instance::table::TableType"]],["impl Unpin for Loader",1,["wasmedge_sys::loader::Loader"]],["impl Unpin for PluginManager",1,["wasmedge_sys::plugin::PluginManager"]],["impl Unpin for Plugin",1,["wasmedge_sys::plugin::Plugin"]],["impl Unpin for ProgramOptionType",1,["wasmedge_sys::plugin::ProgramOptionType"]],["impl Unpin for ProgramOption",1,["wasmedge_sys::plugin::ProgramOption"]],["impl Unpin for ModuleDescriptor",1,["wasmedge_sys::plugin::ModuleDescriptor"]],["impl Unpin for PluginVersion",1,["wasmedge_sys::plugin::PluginVersion"]],["impl Unpin for PluginDescriptor",1,["wasmedge_sys::plugin::PluginDescriptor"]],["impl Unpin for PluginModule",1,["wasmedge_sys::plugin::PluginModule"]],["impl Unpin for Statistics",1,["wasmedge_sys::statistics::Statistics"]],["impl Unpin for Store",1,["wasmedge_sys::store::Store"]],["impl Unpin for WasmValue",1,["wasmedge_sys::types::WasmValue"]],["impl Unpin for Validator",1,["wasmedge_sys::validator::Validator"]]], +"wasmedge_types":[["impl Unpin for WasmEdgeError",1,["wasmedge_types::error::WasmEdgeError"]],["impl Unpin for FuncError",1,["wasmedge_types::error::FuncError"]],["impl Unpin for MemError",1,["wasmedge_types::error::MemError"]],["impl Unpin for GlobalError",1,["wasmedge_types::error::GlobalError"]],["impl Unpin for TableError",1,["wasmedge_types::error::TableError"]],["impl Unpin for ImportError",1,["wasmedge_types::error::ImportError"]],["impl Unpin for ExportError",1,["wasmedge_types::error::ExportError"]],["impl Unpin for InstanceError",1,["wasmedge_types::error::InstanceError"]],["impl Unpin for PluginError",1,["wasmedge_types::error::PluginError"]],["impl Unpin for StoreError",1,["wasmedge_types::error::StoreError"]],["impl Unpin for VmError",1,["wasmedge_types::error::VmError"]],["impl Unpin for CoreError",1,["wasmedge_types::error::CoreError"]],["impl Unpin for CoreCommonError",1,["wasmedge_types::error::CoreCommonError"]],["impl Unpin for CoreLoadError",1,["wasmedge_types::error::CoreLoadError"]],["impl Unpin for CoreValidationError",1,["wasmedge_types::error::CoreValidationError"]],["impl Unpin for CoreInstantiationError",1,["wasmedge_types::error::CoreInstantiationError"]],["impl Unpin for CoreExecutionError",1,["wasmedge_types::error::CoreExecutionError"]],["impl Unpin for HostFuncError",1,["wasmedge_types::error::HostFuncError"]],["impl Unpin for RefType",1,["wasmedge_types::RefType"]],["impl Unpin for ValType",1,["wasmedge_types::ValType"]],["impl Unpin for Mutability",1,["wasmedge_types::Mutability"]],["impl Unpin for CompilerOptimizationLevel",1,["wasmedge_types::CompilerOptimizationLevel"]],["impl Unpin for CompilerOutputFormat",1,["wasmedge_types::CompilerOutputFormat"]],["impl Unpin for HostRegistration",1,["wasmedge_types::HostRegistration"]],["impl Unpin for ExternalInstanceType",1,["wasmedge_types::ExternalInstanceType"]],["impl Unpin for FuncType",1,["wasmedge_types::FuncType"]],["impl Unpin for TableType",1,["wasmedge_types::TableType"]],["impl Unpin for MemoryType",1,["wasmedge_types::MemoryType"]],["impl Unpin for GlobalType",1,["wasmedge_types::GlobalType"]],["impl Unpin for NeverType",1,["wasmedge_types::NeverType"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/arith/trait.Add.js b/trait.impl/core/ops/arith/trait.Add.js new file mode 100644 index 000000000..bffbb62e7 --- /dev/null +++ b/trait.impl/core/ops/arith/trait.Add.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl<T: Sized> Add<usize> for WasmPtr<T>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/arith/trait.Sub.js b/trait.impl/core/ops/arith/trait.Sub.js new file mode 100644 index 000000000..0280e0b48 --- /dev/null +++ b/trait.impl/core/ops/arith/trait.Sub.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl Sub for RoFlags"],["impl Sub for FdFlags"],["impl Sub for OFlags"],["impl Sub for SiFlags"],["impl Sub for Lookupflags"],["impl Sub for RiFlags"],["impl<T: Sized> Sub<usize> for WasmPtr<T>"],["impl Sub for WASIRights"],["impl Sub for SdFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/arith/trait.SubAssign.js b/trait.impl/core/ops/arith/trait.SubAssign.js new file mode 100644 index 000000000..f27a53bb3 --- /dev/null +++ b/trait.impl/core/ops/arith/trait.SubAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl SubAssign for FdFlags"],["impl SubAssign for Lookupflags"],["impl SubAssign for RoFlags"],["impl SubAssign for OFlags"],["impl SubAssign for WASIRights"],["impl SubAssign for SdFlags"],["impl SubAssign for SiFlags"],["impl SubAssign for RiFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitAnd.js b/trait.impl/core/ops/bit/trait.BitAnd.js new file mode 100644 index 000000000..9a6b46534 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitAnd.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl BitAnd for OFlags"],["impl BitAnd for RiFlags"],["impl BitAnd for SdFlags"],["impl BitAnd for WASIRights"],["impl BitAnd for RoFlags"],["impl BitAnd for Lookupflags"],["impl BitAnd for SiFlags"],["impl BitAnd for FdFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitAndAssign.js b/trait.impl/core/ops/bit/trait.BitAndAssign.js new file mode 100644 index 000000000..f814b5965 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitAndAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl BitAndAssign for SdFlags"],["impl BitAndAssign for RiFlags"],["impl BitAndAssign for RoFlags"],["impl BitAndAssign for WASIRights"],["impl BitAndAssign for SiFlags"],["impl BitAndAssign for Lookupflags"],["impl BitAndAssign for FdFlags"],["impl BitAndAssign for OFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitOr.js b/trait.impl/core/ops/bit/trait.BitOr.js new file mode 100644 index 000000000..107974838 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitOr.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl BitOr for RoFlags"],["impl BitOr for SiFlags"],["impl BitOr for RiFlags"],["impl BitOr for OFlags"],["impl BitOr for FdFlags"],["impl BitOr for Lookupflags"],["impl BitOr for WASIRights"],["impl BitOr for SdFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitOrAssign.js b/trait.impl/core/ops/bit/trait.BitOrAssign.js new file mode 100644 index 000000000..83ce98d8e --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitOrAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl BitOrAssign for SdFlags"],["impl BitOrAssign for OFlags"],["impl BitOrAssign for Lookupflags"],["impl BitOrAssign for SiFlags"],["impl BitOrAssign for RiFlags"],["impl BitOrAssign for WASIRights"],["impl BitOrAssign for FdFlags"],["impl BitOrAssign for RoFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitXor.js b/trait.impl/core/ops/bit/trait.BitXor.js new file mode 100644 index 000000000..fd26915ef --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitXor.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl BitXor for SdFlags"],["impl BitXor for WASIRights"],["impl BitXor for FdFlags"],["impl BitXor for RoFlags"],["impl BitXor for Lookupflags"],["impl BitXor for SiFlags"],["impl BitXor for OFlags"],["impl BitXor for RiFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitXorAssign.js b/trait.impl/core/ops/bit/trait.BitXorAssign.js new file mode 100644 index 000000000..79bd370e5 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitXorAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl BitXorAssign for RoFlags"],["impl BitXorAssign for SdFlags"],["impl BitXorAssign for Lookupflags"],["impl BitXorAssign for OFlags"],["impl BitXorAssign for FdFlags"],["impl BitXorAssign for SiFlags"],["impl BitXorAssign for WASIRights"],["impl BitXorAssign for RiFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.Not.js b/trait.impl/core/ops/bit/trait.Not.js new file mode 100644 index 000000000..9ad074da0 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.Not.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl Not for FdFlags"],["impl Not for OFlags"],["impl Not for SdFlags"],["impl Not for RiFlags"],["impl Not for Lookupflags"],["impl Not for SiFlags"],["impl Not for WASIRights"],["impl Not for RoFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/deref/trait.Deref.js b/trait.impl/core/ops/deref/trait.Deref.js new file mode 100644 index 000000000..f4082c106 --- /dev/null +++ b/trait.impl/core/ops/deref/trait.Deref.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl Deref for WasiPreOpenDir"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/deref/trait.DerefMut.js b/trait.impl/core/ops/deref/trait.DerefMut.js new file mode 100644 index 000000000..0e8e8d329 --- /dev/null +++ b/trait.impl/core/ops/deref/trait.DerefMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl DerefMut for WasiPreOpenDir"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/drop/trait.Drop.js b/trait.impl/core/ops/drop/trait.Drop.js new file mode 100644 index 000000000..ce21585ac --- /dev/null +++ b/trait.impl/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sys":[["impl Drop for Instance"],["impl Drop for GlobalType"],["impl Drop for TableType"],["impl Drop for Statistics"],["impl Drop for Table"],["impl<T: ?Sized + Send + Sync + Clone> Drop for ImportModule<T>"],["impl Drop for Compiler"],["impl Drop for WasiModule"],["impl Drop for Config"],["impl Drop for Function"],["impl<'module> Drop for ImportType<'module>"],["impl Drop for Executor"],["impl Drop for FuncRef"],["impl Drop for Store"],["impl Drop for Loader"],["impl Drop for Memory"],["impl Drop for PluginModule"],["impl Drop for Module"],["impl<'module> Drop for ExportType<'module>"],["impl Drop for Global"],["impl Drop for CallingFrame"],["impl Drop for Validator"],["impl Drop for FuncType"],["impl Drop for MemType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 000000000..d25b96b26 --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl<T> RefUnwindSafe for ObjectPool<T>where\n T: RefUnwindSafe,",1,["async_wasi::object_pool::ObjectPool"]],["impl<T> RefUnwindSafe for SerialObjectPool<T>where\n T: RefUnwindSafe,",1,["async_wasi::object_pool::SerialObjectPool"]],["impl<T> RefUnwindSafe for ObjectNode<T>where\n T: RefUnwindSafe,",1,["async_wasi::object_pool::ObjectNode"]],["impl RefUnwindSafe for __wasi_iovec_t",1,["async_wasi::snapshots::common::types::__wasi_iovec_t"]],["impl RefUnwindSafe for __wasi_ciovec_t",1,["async_wasi::snapshots::common::types::__wasi_ciovec_t"]],["impl RefUnwindSafe for __wasi_dirent_t",1,["async_wasi::snapshots::common::types::__wasi_dirent_t"]],["impl RefUnwindSafe for __wasi_fdstat_t",1,["async_wasi::snapshots::common::types::__wasi_fdstat_t"]],["impl RefUnwindSafe for __wasi_filestat_t",1,["async_wasi::snapshots::common::types::__wasi_filestat_t"]],["impl RefUnwindSafe for __wasi_event_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_event_fd_readwrite_t"]],["impl RefUnwindSafe for __wasi_event_t",1,["async_wasi::snapshots::common::types::__wasi_event_t"]],["impl RefUnwindSafe for __wasi_subscription_clock_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_clock_t"]],["impl RefUnwindSafe for __wasi_subscription_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_fd_readwrite_t"]],["impl RefUnwindSafe for __wasi_subscription_u_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_u_t"]],["impl RefUnwindSafe for __wasi_subscription_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_t"]],["impl RefUnwindSafe for __wasi_subscription_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_t"]],["impl RefUnwindSafe for __wasi_address_t",1,["async_wasi::snapshots::common::types::__wasi_address_t"]],["impl RefUnwindSafe for __wasi_sockaddr_in_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_in_t"]],["impl RefUnwindSafe for __wasi_sockaddr_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_t"]],["impl RefUnwindSafe for __wasi_addrinfo_t",1,["async_wasi::snapshots::common::types::__wasi_addrinfo_t"]],["impl RefUnwindSafe for __wasi_prestat_dir_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_dir_t"]],["impl RefUnwindSafe for __wasi_prestat_u_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_u_t"]],["impl RefUnwindSafe for __wasi_prestat_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_t"]],["impl RefUnwindSafe for __wasi_timeval",1,["async_wasi::snapshots::common::types::__wasi_timeval"]],["impl RefUnwindSafe for Errno",1,["async_wasi::snapshots::common::error::Errno"]],["impl<T> RefUnwindSafe for WasmPtr<T>where\n T: RefUnwindSafe,",1,["async_wasi::snapshots::common::memory::WasmPtr"]],["impl !RefUnwindSafe for AsyncWasiSocket",1,["async_wasi::snapshots::common::net::async_tokio::AsyncWasiSocket"]],["impl RefUnwindSafe for AddressFamily",1,["async_wasi::snapshots::common::net::AddressFamily"]],["impl RefUnwindSafe for SocketType",1,["async_wasi::snapshots::common::net::SocketType"]],["impl RefUnwindSafe for ConnectState",1,["async_wasi::snapshots::common::net::ConnectState"]],["impl RefUnwindSafe for WasiSocketState",1,["async_wasi::snapshots::common::net::WasiSocketState"]],["impl RefUnwindSafe for SubscriptionFdType",1,["async_wasi::snapshots::common::net::SubscriptionFdType"]],["impl RefUnwindSafe for SubscriptionFd",1,["async_wasi::snapshots::common::net::SubscriptionFd"]],["impl RefUnwindSafe for SubscriptionClock",1,["async_wasi::snapshots::common::net::SubscriptionClock"]],["impl RefUnwindSafe for Subscription",1,["async_wasi::snapshots::common::net::Subscription"]],["impl RefUnwindSafe for PrePoll",1,["async_wasi::snapshots::common::net::PrePoll"]],["impl RefUnwindSafe for WasiStdin",1,["async_wasi::snapshots::common::vfs::sync::WasiStdin"]],["impl RefUnwindSafe for WasiStdout",1,["async_wasi::snapshots::common::vfs::sync::WasiStdout"]],["impl RefUnwindSafe for WasiStderr",1,["async_wasi::snapshots::common::vfs::sync::WasiStderr"]],["impl RefUnwindSafe for WasiFile",1,["async_wasi::snapshots::common::vfs::sync::WasiFile"]],["impl RefUnwindSafe for WasiPreOpenDir",1,["async_wasi::snapshots::common::vfs::sync::WasiPreOpenDir"]],["impl RefUnwindSafe for WasiDir",1,["async_wasi::snapshots::common::vfs::sync::WasiDir"]],["impl RefUnwindSafe for INode",1,["async_wasi::snapshots::common::vfs::sync::INode"]],["impl RefUnwindSafe for SystemTimeSpec",1,["async_wasi::snapshots::common::vfs::SystemTimeSpec"]],["impl RefUnwindSafe for ReaddirEntity",1,["async_wasi::snapshots::common::vfs::ReaddirEntity"]],["impl RefUnwindSafe for FdStat",1,["async_wasi::snapshots::common::vfs::FdStat"]],["impl RefUnwindSafe for Filestat",1,["async_wasi::snapshots::common::vfs::Filestat"]],["impl RefUnwindSafe for FileType",1,["async_wasi::snapshots::common::vfs::FileType"]],["impl RefUnwindSafe for FdFlags",1,["async_wasi::snapshots::common::vfs::FdFlags"]],["impl RefUnwindSafe for SdFlags",1,["async_wasi::snapshots::common::vfs::SdFlags"]],["impl RefUnwindSafe for SiFlags",1,["async_wasi::snapshots::common::vfs::SiFlags"]],["impl RefUnwindSafe for RiFlags",1,["async_wasi::snapshots::common::vfs::RiFlags"]],["impl RefUnwindSafe for RoFlags",1,["async_wasi::snapshots::common::vfs::RoFlags"]],["impl RefUnwindSafe for OFlags",1,["async_wasi::snapshots::common::vfs::OFlags"]],["impl RefUnwindSafe for WASIRights",1,["async_wasi::snapshots::common::vfs::WASIRights"]],["impl RefUnwindSafe for Lookupflags",1,["async_wasi::snapshots::common::vfs::Lookupflags"]],["impl RefUnwindSafe for Advice",1,["async_wasi::snapshots::common::vfs::Advice"]],["impl !RefUnwindSafe for VFD",1,["async_wasi::snapshots::env::VFD"]],["impl RefUnwindSafe for AddressFamily",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::AddressFamily"]],["impl RefUnwindSafe for WasiSockaddr",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiSockaddr"]],["impl RefUnwindSafe for WasiAddrinfo",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiAddrinfo"]],["impl RefUnwindSafe for PollFdState",1,["async_wasi::snapshots::serialize::PollFdState"]],["impl RefUnwindSafe for IoState",1,["async_wasi::snapshots::serialize::IoState"]],["impl RefUnwindSafe for SerialWasiCtx",1,["async_wasi::snapshots::serialize::SerialWasiCtx"]],["impl RefUnwindSafe for SerialSocketType",1,["async_wasi::snapshots::serialize::SerialSocketType"]],["impl RefUnwindSafe for SerialConnectState",1,["async_wasi::snapshots::serialize::SerialConnectState"]],["impl RefUnwindSafe for SerialWasiSocketState",1,["async_wasi::snapshots::serialize::SerialWasiSocketState"]],["impl RefUnwindSafe for SerialStdin",1,["async_wasi::snapshots::serialize::SerialStdin"]],["impl RefUnwindSafe for SerialStdout",1,["async_wasi::snapshots::serialize::SerialStdout"]],["impl RefUnwindSafe for SerialStderr",1,["async_wasi::snapshots::serialize::SerialStderr"]],["impl RefUnwindSafe for SerialWasiDir",1,["async_wasi::snapshots::serialize::SerialWasiDir"]],["impl RefUnwindSafe for SerialWasiFile",1,["async_wasi::snapshots::serialize::SerialWasiFile"]],["impl RefUnwindSafe for SerialTcpServer",1,["async_wasi::snapshots::serialize::SerialTcpServer"]],["impl RefUnwindSafe for SerialUdpSocket",1,["async_wasi::snapshots::serialize::SerialUdpSocket"]],["impl RefUnwindSafe for SerialPreOpen",1,["async_wasi::snapshots::serialize::SerialPreOpen"]],["impl RefUnwindSafe for SerialVFD",1,["async_wasi::snapshots::serialize::SerialVFD"]],["impl !RefUnwindSafe for WasiCtx",1,["async_wasi::snapshots::WasiCtx"]]], +"wasmedge_sdk":[["impl !RefUnwindSafe for Caller",1,["wasmedge_sdk::caller::Caller"]],["impl RefUnwindSafe for Compiler",1,["wasmedge_sdk::compiler::Compiler"]],["impl RefUnwindSafe for ConfigBuilder",1,["wasmedge_sdk::config::ConfigBuilder"]],["impl RefUnwindSafe for Config",1,["wasmedge_sdk::config::Config"]],["impl RefUnwindSafe for CommonConfigOptions",1,["wasmedge_sdk::config::CommonConfigOptions"]],["impl RefUnwindSafe for CompilerConfigOptions",1,["wasmedge_sdk::config::CompilerConfigOptions"]],["impl RefUnwindSafe for RuntimeConfigOptions",1,["wasmedge_sdk::config::RuntimeConfigOptions"]],["impl RefUnwindSafe for StatisticsConfigOptions",1,["wasmedge_sdk::config::StatisticsConfigOptions"]],["impl RefUnwindSafe for HostRegistrationConfigOptions",1,["wasmedge_sdk::config::HostRegistrationConfigOptions"]],["impl !RefUnwindSafe for VmDock",1,["wasmedge_sdk::dock::VmDock"]],["impl<'a> RefUnwindSafe for Param<'a>",1,["wasmedge_sdk::dock::Param"]],["impl RefUnwindSafe for Executor",1,["wasmedge_sdk::executor::Executor"]],["impl !RefUnwindSafe for Func",1,["wasmedge_sdk::externals::function::Func"]],["impl RefUnwindSafe for FuncTypeBuilder",1,["wasmedge_sdk::externals::function::FuncTypeBuilder"]],["impl RefUnwindSafe for FuncRef",1,["wasmedge_sdk::externals::function::FuncRef"]],["impl !RefUnwindSafe for Global",1,["wasmedge_sdk::externals::global::Global"]],["impl !RefUnwindSafe for Memory",1,["wasmedge_sdk::externals::memory::Memory"]],["impl !RefUnwindSafe for Table",1,["wasmedge_sdk::externals::table::Table"]],["impl !RefUnwindSafe for ImportObjectBuilder",1,["wasmedge_sdk::import::ImportObjectBuilder"]],["impl<T> !RefUnwindSafe for ImportObject<T>",1,["wasmedge_sdk::import::ImportObject"]],["impl !RefUnwindSafe for Instance",1,["wasmedge_sdk::instance::Instance"]],["impl RefUnwindSafe for LogManager",1,["wasmedge_sdk::log::LogManager"]],["impl RefUnwindSafe for Module",1,["wasmedge_sdk::module::Module"]],["impl<'module> RefUnwindSafe for ImportType<'module>",1,["wasmedge_sdk::module::ImportType"]],["impl<'module> RefUnwindSafe for ExportType<'module>",1,["wasmedge_sdk::module::ExportType"]],["impl RefUnwindSafe for NNPreload",1,["wasmedge_sdk::plugin::NNPreload"]],["impl RefUnwindSafe for GraphEncoding",1,["wasmedge_sdk::plugin::GraphEncoding"]],["impl RefUnwindSafe for ExecutionTarget",1,["wasmedge_sdk::plugin::ExecutionTarget"]],["impl RefUnwindSafe for PluginManager",1,["wasmedge_sdk::plugin::PluginManager"]],["impl RefUnwindSafe for Plugin",1,["wasmedge_sdk::plugin::Plugin"]],["impl RefUnwindSafe for PluginDescriptor",1,["wasmedge_sdk::plugin::PluginDescriptor"]],["impl RefUnwindSafe for PluginVersion",1,["wasmedge_sdk::plugin::PluginVersion"]],["impl<T> !RefUnwindSafe for PluginModuleBuilder<T>",1,["wasmedge_sdk::plugin::PluginModuleBuilder"]],["impl !RefUnwindSafe for PluginModule",1,["wasmedge_sdk::plugin::PluginModule"]],["impl RefUnwindSafe for Statistics",1,["wasmedge_sdk::statistics::Statistics"]],["impl RefUnwindSafe for Store",1,["wasmedge_sdk::store::Store"]],["impl RefUnwindSafe for Val",1,["wasmedge_sdk::types::Val"]],["impl RefUnwindSafe for ExternRef",1,["wasmedge_sdk::types::ExternRef"]],["impl RefUnwindSafe for Driver",1,["wasmedge_sdk::utils::Driver"]],["impl RefUnwindSafe for CoreVersion",1,["wasmedge_sdk::utils::CoreVersion"]],["impl RefUnwindSafe for VmBuilder",1,["wasmedge_sdk::vm::VmBuilder"]],["impl !RefUnwindSafe for Vm",1,["wasmedge_sdk::vm::Vm"]],["impl !RefUnwindSafe for WasiInstance",1,["wasmedge_sdk::wasi::WasiInstance"]]], +"wasmedge_sys":[["impl RefUnwindSafe for __fsid_t",1,["wasmedge_sys::ffi::__fsid_t"]],["impl RefUnwindSafe for WasmEdge_Value",1,["wasmedge_sys::ffi::WasmEdge_Value"]],["impl RefUnwindSafe for WasmEdge_String",1,["wasmedge_sys::ffi::WasmEdge_String"]],["impl RefUnwindSafe for WasmEdge_Result",1,["wasmedge_sys::ffi::WasmEdge_Result"]],["impl RefUnwindSafe for WasmEdge_Limit",1,["wasmedge_sys::ffi::WasmEdge_Limit"]],["impl RefUnwindSafe for WasmEdge_ConfigureContext",1,["wasmedge_sys::ffi::WasmEdge_ConfigureContext"]],["impl RefUnwindSafe for WasmEdge_StatisticsContext",1,["wasmedge_sys::ffi::WasmEdge_StatisticsContext"]],["impl RefUnwindSafe for WasmEdge_ASTModuleContext",1,["wasmedge_sys::ffi::WasmEdge_ASTModuleContext"]],["impl RefUnwindSafe for WasmEdge_FunctionTypeContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionTypeContext"]],["impl RefUnwindSafe for WasmEdge_MemoryTypeContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryTypeContext"]],["impl RefUnwindSafe for WasmEdge_TableTypeContext",1,["wasmedge_sys::ffi::WasmEdge_TableTypeContext"]],["impl RefUnwindSafe for WasmEdge_GlobalTypeContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalTypeContext"]],["impl RefUnwindSafe for WasmEdge_ImportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ImportTypeContext"]],["impl RefUnwindSafe for WasmEdge_ExportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ExportTypeContext"]],["impl RefUnwindSafe for WasmEdge_CompilerContext",1,["wasmedge_sys::ffi::WasmEdge_CompilerContext"]],["impl RefUnwindSafe for WasmEdge_LoaderContext",1,["wasmedge_sys::ffi::WasmEdge_LoaderContext"]],["impl RefUnwindSafe for WasmEdge_ValidatorContext",1,["wasmedge_sys::ffi::WasmEdge_ValidatorContext"]],["impl RefUnwindSafe for WasmEdge_ExecutorContext",1,["wasmedge_sys::ffi::WasmEdge_ExecutorContext"]],["impl RefUnwindSafe for WasmEdge_StoreContext",1,["wasmedge_sys::ffi::WasmEdge_StoreContext"]],["impl RefUnwindSafe for WasmEdge_ModuleInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_ModuleInstanceContext"]],["impl RefUnwindSafe for WasmEdge_FunctionInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionInstanceContext"]],["impl RefUnwindSafe for WasmEdge_TableInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_TableInstanceContext"]],["impl RefUnwindSafe for WasmEdge_MemoryInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryInstanceContext"]],["impl RefUnwindSafe for WasmEdge_GlobalInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalInstanceContext"]],["impl RefUnwindSafe for WasmEdge_CallingFrameContext",1,["wasmedge_sys::ffi::WasmEdge_CallingFrameContext"]],["impl RefUnwindSafe for WasmEdge_Async",1,["wasmedge_sys::ffi::WasmEdge_Async"]],["impl RefUnwindSafe for WasmEdge_VMContext",1,["wasmedge_sys::ffi::WasmEdge_VMContext"]],["impl RefUnwindSafe for WasmEdge_PluginContext",1,["wasmedge_sys::ffi::WasmEdge_PluginContext"]],["impl RefUnwindSafe for WasmEdge_ProgramOption",1,["wasmedge_sys::ffi::WasmEdge_ProgramOption"]],["impl RefUnwindSafe for WasmEdge_ModuleDescriptor",1,["wasmedge_sys::ffi::WasmEdge_ModuleDescriptor"]],["impl RefUnwindSafe for WasmEdge_PluginVersionData",1,["wasmedge_sys::ffi::WasmEdge_PluginVersionData"]],["impl RefUnwindSafe for WasmEdge_PluginDescriptor",1,["wasmedge_sys::ffi::WasmEdge_PluginDescriptor"]],["impl RefUnwindSafe for Module",1,["wasmedge_sys::ast_module::Module"]],["impl<'module> RefUnwindSafe for ImportType<'module>",1,["wasmedge_sys::ast_module::ImportType"]],["impl<'module> RefUnwindSafe for ExportType<'module>",1,["wasmedge_sys::ast_module::ExportType"]],["impl RefUnwindSafe for Compiler",1,["wasmedge_sys::compiler::Compiler"]],["impl RefUnwindSafe for Config",1,["wasmedge_sys::config::Config"]],["impl RefUnwindSafe for Executor",1,["wasmedge_sys::executor::Executor"]],["impl RefUnwindSafe for CallingFrame",1,["wasmedge_sys::frame::CallingFrame"]],["impl !RefUnwindSafe for Function",1,["wasmedge_sys::instance::function::Function"]],["impl RefUnwindSafe for FuncType",1,["wasmedge_sys::instance::function::FuncType"]],["impl RefUnwindSafe for FuncRef",1,["wasmedge_sys::instance::function::FuncRef"]],["impl !RefUnwindSafe for Global",1,["wasmedge_sys::instance::global::Global"]],["impl RefUnwindSafe for GlobalType",1,["wasmedge_sys::instance::global::GlobalType"]],["impl !RefUnwindSafe for Memory",1,["wasmedge_sys::instance::memory::Memory"]],["impl RefUnwindSafe for MemType",1,["wasmedge_sys::instance::memory::MemType"]],["impl !RefUnwindSafe for Instance",1,["wasmedge_sys::instance::module::Instance"]],["impl<T> !RefUnwindSafe for ImportModule<T>",1,["wasmedge_sys::instance::module::ImportModule"]],["impl !RefUnwindSafe for WasiModule",1,["wasmedge_sys::instance::module::WasiModule"]],["impl !RefUnwindSafe for WasiInstance",1,["wasmedge_sys::instance::module::WasiInstance"]],["impl !RefUnwindSafe for Table",1,["wasmedge_sys::instance::table::Table"]],["impl RefUnwindSafe for TableType",1,["wasmedge_sys::instance::table::TableType"]],["impl RefUnwindSafe for Loader",1,["wasmedge_sys::loader::Loader"]],["impl RefUnwindSafe for PluginManager",1,["wasmedge_sys::plugin::PluginManager"]],["impl RefUnwindSafe for Plugin",1,["wasmedge_sys::plugin::Plugin"]],["impl RefUnwindSafe for ProgramOptionType",1,["wasmedge_sys::plugin::ProgramOptionType"]],["impl RefUnwindSafe for ProgramOption",1,["wasmedge_sys::plugin::ProgramOption"]],["impl RefUnwindSafe for ModuleDescriptor",1,["wasmedge_sys::plugin::ModuleDescriptor"]],["impl RefUnwindSafe for PluginVersion",1,["wasmedge_sys::plugin::PluginVersion"]],["impl RefUnwindSafe for PluginDescriptor",1,["wasmedge_sys::plugin::PluginDescriptor"]],["impl !RefUnwindSafe for PluginModule",1,["wasmedge_sys::plugin::PluginModule"]],["impl RefUnwindSafe for Statistics",1,["wasmedge_sys::statistics::Statistics"]],["impl RefUnwindSafe for Store",1,["wasmedge_sys::store::Store"]],["impl RefUnwindSafe for WasmValue",1,["wasmedge_sys::types::WasmValue"]],["impl RefUnwindSafe for Validator",1,["wasmedge_sys::validator::Validator"]]], +"wasmedge_types":[["impl RefUnwindSafe for WasmEdgeError",1,["wasmedge_types::error::WasmEdgeError"]],["impl RefUnwindSafe for FuncError",1,["wasmedge_types::error::FuncError"]],["impl RefUnwindSafe for MemError",1,["wasmedge_types::error::MemError"]],["impl RefUnwindSafe for GlobalError",1,["wasmedge_types::error::GlobalError"]],["impl RefUnwindSafe for TableError",1,["wasmedge_types::error::TableError"]],["impl RefUnwindSafe for ImportError",1,["wasmedge_types::error::ImportError"]],["impl RefUnwindSafe for ExportError",1,["wasmedge_types::error::ExportError"]],["impl RefUnwindSafe for InstanceError",1,["wasmedge_types::error::InstanceError"]],["impl RefUnwindSafe for PluginError",1,["wasmedge_types::error::PluginError"]],["impl RefUnwindSafe for StoreError",1,["wasmedge_types::error::StoreError"]],["impl RefUnwindSafe for VmError",1,["wasmedge_types::error::VmError"]],["impl RefUnwindSafe for CoreError",1,["wasmedge_types::error::CoreError"]],["impl RefUnwindSafe for CoreCommonError",1,["wasmedge_types::error::CoreCommonError"]],["impl RefUnwindSafe for CoreLoadError",1,["wasmedge_types::error::CoreLoadError"]],["impl RefUnwindSafe for CoreValidationError",1,["wasmedge_types::error::CoreValidationError"]],["impl RefUnwindSafe for CoreInstantiationError",1,["wasmedge_types::error::CoreInstantiationError"]],["impl RefUnwindSafe for CoreExecutionError",1,["wasmedge_types::error::CoreExecutionError"]],["impl RefUnwindSafe for HostFuncError",1,["wasmedge_types::error::HostFuncError"]],["impl RefUnwindSafe for RefType",1,["wasmedge_types::RefType"]],["impl RefUnwindSafe for ValType",1,["wasmedge_types::ValType"]],["impl RefUnwindSafe for Mutability",1,["wasmedge_types::Mutability"]],["impl RefUnwindSafe for CompilerOptimizationLevel",1,["wasmedge_types::CompilerOptimizationLevel"]],["impl RefUnwindSafe for CompilerOutputFormat",1,["wasmedge_types::CompilerOutputFormat"]],["impl RefUnwindSafe for HostRegistration",1,["wasmedge_types::HostRegistration"]],["impl RefUnwindSafe for ExternalInstanceType",1,["wasmedge_types::ExternalInstanceType"]],["impl RefUnwindSafe for FuncType",1,["wasmedge_types::FuncType"]],["impl RefUnwindSafe for TableType",1,["wasmedge_types::TableType"]],["impl RefUnwindSafe for MemoryType",1,["wasmedge_types::MemoryType"]],["impl RefUnwindSafe for GlobalType",1,["wasmedge_types::GlobalType"]],["impl RefUnwindSafe for NeverType",1,["wasmedge_types::NeverType"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 000000000..b0a638d01 --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"async_wasi":[["impl<T> UnwindSafe for ObjectPool<T>where\n T: UnwindSafe,",1,["async_wasi::object_pool::ObjectPool"]],["impl<T> UnwindSafe for SerialObjectPool<T>where\n T: UnwindSafe,",1,["async_wasi::object_pool::SerialObjectPool"]],["impl<T> UnwindSafe for ObjectNode<T>where\n T: UnwindSafe,",1,["async_wasi::object_pool::ObjectNode"]],["impl UnwindSafe for __wasi_iovec_t",1,["async_wasi::snapshots::common::types::__wasi_iovec_t"]],["impl UnwindSafe for __wasi_ciovec_t",1,["async_wasi::snapshots::common::types::__wasi_ciovec_t"]],["impl UnwindSafe for __wasi_dirent_t",1,["async_wasi::snapshots::common::types::__wasi_dirent_t"]],["impl UnwindSafe for __wasi_fdstat_t",1,["async_wasi::snapshots::common::types::__wasi_fdstat_t"]],["impl UnwindSafe for __wasi_filestat_t",1,["async_wasi::snapshots::common::types::__wasi_filestat_t"]],["impl UnwindSafe for __wasi_event_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_event_fd_readwrite_t"]],["impl UnwindSafe for __wasi_event_t",1,["async_wasi::snapshots::common::types::__wasi_event_t"]],["impl UnwindSafe for __wasi_subscription_clock_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_clock_t"]],["impl UnwindSafe for __wasi_subscription_fd_readwrite_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_fd_readwrite_t"]],["impl UnwindSafe for __wasi_subscription_u_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_u_t"]],["impl UnwindSafe for __wasi_subscription_u_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_u_t"]],["impl UnwindSafe for __wasi_subscription_t",1,["async_wasi::snapshots::common::types::__wasi_subscription_t"]],["impl UnwindSafe for __wasi_address_t",1,["async_wasi::snapshots::common::types::__wasi_address_t"]],["impl UnwindSafe for __wasi_sockaddr_in_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_in_t"]],["impl UnwindSafe for __wasi_sockaddr_t",1,["async_wasi::snapshots::common::types::__wasi_sockaddr_t"]],["impl UnwindSafe for __wasi_addrinfo_t",1,["async_wasi::snapshots::common::types::__wasi_addrinfo_t"]],["impl UnwindSafe for __wasi_prestat_dir_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_dir_t"]],["impl UnwindSafe for __wasi_prestat_u_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_u_t"]],["impl UnwindSafe for __wasi_prestat_t",1,["async_wasi::snapshots::common::types::__wasi_prestat_t"]],["impl UnwindSafe for __wasi_timeval",1,["async_wasi::snapshots::common::types::__wasi_timeval"]],["impl UnwindSafe for Errno",1,["async_wasi::snapshots::common::error::Errno"]],["impl<T> UnwindSafe for WasmPtr<T>where\n T: UnwindSafe,",1,["async_wasi::snapshots::common::memory::WasmPtr"]],["impl !UnwindSafe for AsyncWasiSocket",1,["async_wasi::snapshots::common::net::async_tokio::AsyncWasiSocket"]],["impl UnwindSafe for AddressFamily",1,["async_wasi::snapshots::common::net::AddressFamily"]],["impl UnwindSafe for SocketType",1,["async_wasi::snapshots::common::net::SocketType"]],["impl UnwindSafe for ConnectState",1,["async_wasi::snapshots::common::net::ConnectState"]],["impl UnwindSafe for WasiSocketState",1,["async_wasi::snapshots::common::net::WasiSocketState"]],["impl UnwindSafe for SubscriptionFdType",1,["async_wasi::snapshots::common::net::SubscriptionFdType"]],["impl UnwindSafe for SubscriptionFd",1,["async_wasi::snapshots::common::net::SubscriptionFd"]],["impl UnwindSafe for SubscriptionClock",1,["async_wasi::snapshots::common::net::SubscriptionClock"]],["impl UnwindSafe for Subscription",1,["async_wasi::snapshots::common::net::Subscription"]],["impl UnwindSafe for PrePoll",1,["async_wasi::snapshots::common::net::PrePoll"]],["impl UnwindSafe for WasiStdin",1,["async_wasi::snapshots::common::vfs::sync::WasiStdin"]],["impl UnwindSafe for WasiStdout",1,["async_wasi::snapshots::common::vfs::sync::WasiStdout"]],["impl UnwindSafe for WasiStderr",1,["async_wasi::snapshots::common::vfs::sync::WasiStderr"]],["impl UnwindSafe for WasiFile",1,["async_wasi::snapshots::common::vfs::sync::WasiFile"]],["impl UnwindSafe for WasiPreOpenDir",1,["async_wasi::snapshots::common::vfs::sync::WasiPreOpenDir"]],["impl UnwindSafe for WasiDir",1,["async_wasi::snapshots::common::vfs::sync::WasiDir"]],["impl UnwindSafe for INode",1,["async_wasi::snapshots::common::vfs::sync::INode"]],["impl UnwindSafe for SystemTimeSpec",1,["async_wasi::snapshots::common::vfs::SystemTimeSpec"]],["impl UnwindSafe for ReaddirEntity",1,["async_wasi::snapshots::common::vfs::ReaddirEntity"]],["impl UnwindSafe for FdStat",1,["async_wasi::snapshots::common::vfs::FdStat"]],["impl UnwindSafe for Filestat",1,["async_wasi::snapshots::common::vfs::Filestat"]],["impl UnwindSafe for FileType",1,["async_wasi::snapshots::common::vfs::FileType"]],["impl UnwindSafe for FdFlags",1,["async_wasi::snapshots::common::vfs::FdFlags"]],["impl UnwindSafe for SdFlags",1,["async_wasi::snapshots::common::vfs::SdFlags"]],["impl UnwindSafe for SiFlags",1,["async_wasi::snapshots::common::vfs::SiFlags"]],["impl UnwindSafe for RiFlags",1,["async_wasi::snapshots::common::vfs::RiFlags"]],["impl UnwindSafe for RoFlags",1,["async_wasi::snapshots::common::vfs::RoFlags"]],["impl UnwindSafe for OFlags",1,["async_wasi::snapshots::common::vfs::OFlags"]],["impl UnwindSafe for WASIRights",1,["async_wasi::snapshots::common::vfs::WASIRights"]],["impl UnwindSafe for Lookupflags",1,["async_wasi::snapshots::common::vfs::Lookupflags"]],["impl UnwindSafe for Advice",1,["async_wasi::snapshots::common::vfs::Advice"]],["impl !UnwindSafe for VFD",1,["async_wasi::snapshots::env::VFD"]],["impl UnwindSafe for AddressFamily",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::AddressFamily"]],["impl UnwindSafe for WasiSockaddr",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiSockaddr"]],["impl UnwindSafe for WasiAddrinfo",1,["async_wasi::snapshots::preview_1::async_socket::addrinfo::WasiAddrinfo"]],["impl UnwindSafe for PollFdState",1,["async_wasi::snapshots::serialize::PollFdState"]],["impl UnwindSafe for IoState",1,["async_wasi::snapshots::serialize::IoState"]],["impl UnwindSafe for SerialWasiCtx",1,["async_wasi::snapshots::serialize::SerialWasiCtx"]],["impl UnwindSafe for SerialSocketType",1,["async_wasi::snapshots::serialize::SerialSocketType"]],["impl UnwindSafe for SerialConnectState",1,["async_wasi::snapshots::serialize::SerialConnectState"]],["impl UnwindSafe for SerialWasiSocketState",1,["async_wasi::snapshots::serialize::SerialWasiSocketState"]],["impl UnwindSafe for SerialStdin",1,["async_wasi::snapshots::serialize::SerialStdin"]],["impl UnwindSafe for SerialStdout",1,["async_wasi::snapshots::serialize::SerialStdout"]],["impl UnwindSafe for SerialStderr",1,["async_wasi::snapshots::serialize::SerialStderr"]],["impl UnwindSafe for SerialWasiDir",1,["async_wasi::snapshots::serialize::SerialWasiDir"]],["impl UnwindSafe for SerialWasiFile",1,["async_wasi::snapshots::serialize::SerialWasiFile"]],["impl UnwindSafe for SerialTcpServer",1,["async_wasi::snapshots::serialize::SerialTcpServer"]],["impl UnwindSafe for SerialUdpSocket",1,["async_wasi::snapshots::serialize::SerialUdpSocket"]],["impl UnwindSafe for SerialPreOpen",1,["async_wasi::snapshots::serialize::SerialPreOpen"]],["impl UnwindSafe for SerialVFD",1,["async_wasi::snapshots::serialize::SerialVFD"]],["impl !UnwindSafe for WasiCtx",1,["async_wasi::snapshots::WasiCtx"]]], +"wasmedge_sdk":[["impl !UnwindSafe for Caller",1,["wasmedge_sdk::caller::Caller"]],["impl UnwindSafe for Compiler",1,["wasmedge_sdk::compiler::Compiler"]],["impl UnwindSafe for ConfigBuilder",1,["wasmedge_sdk::config::ConfigBuilder"]],["impl UnwindSafe for Config",1,["wasmedge_sdk::config::Config"]],["impl UnwindSafe for CommonConfigOptions",1,["wasmedge_sdk::config::CommonConfigOptions"]],["impl UnwindSafe for CompilerConfigOptions",1,["wasmedge_sdk::config::CompilerConfigOptions"]],["impl UnwindSafe for RuntimeConfigOptions",1,["wasmedge_sdk::config::RuntimeConfigOptions"]],["impl UnwindSafe for StatisticsConfigOptions",1,["wasmedge_sdk::config::StatisticsConfigOptions"]],["impl UnwindSafe for HostRegistrationConfigOptions",1,["wasmedge_sdk::config::HostRegistrationConfigOptions"]],["impl !UnwindSafe for VmDock",1,["wasmedge_sdk::dock::VmDock"]],["impl<'a> UnwindSafe for Param<'a>",1,["wasmedge_sdk::dock::Param"]],["impl UnwindSafe for Executor",1,["wasmedge_sdk::executor::Executor"]],["impl !UnwindSafe for Func",1,["wasmedge_sdk::externals::function::Func"]],["impl UnwindSafe for FuncTypeBuilder",1,["wasmedge_sdk::externals::function::FuncTypeBuilder"]],["impl UnwindSafe for FuncRef",1,["wasmedge_sdk::externals::function::FuncRef"]],["impl !UnwindSafe for Global",1,["wasmedge_sdk::externals::global::Global"]],["impl !UnwindSafe for Memory",1,["wasmedge_sdk::externals::memory::Memory"]],["impl !UnwindSafe for Table",1,["wasmedge_sdk::externals::table::Table"]],["impl !UnwindSafe for ImportObjectBuilder",1,["wasmedge_sdk::import::ImportObjectBuilder"]],["impl<T> !UnwindSafe for ImportObject<T>",1,["wasmedge_sdk::import::ImportObject"]],["impl !UnwindSafe for Instance",1,["wasmedge_sdk::instance::Instance"]],["impl UnwindSafe for LogManager",1,["wasmedge_sdk::log::LogManager"]],["impl UnwindSafe for Module",1,["wasmedge_sdk::module::Module"]],["impl<'module> UnwindSafe for ImportType<'module>",1,["wasmedge_sdk::module::ImportType"]],["impl<'module> UnwindSafe for ExportType<'module>",1,["wasmedge_sdk::module::ExportType"]],["impl UnwindSafe for NNPreload",1,["wasmedge_sdk::plugin::NNPreload"]],["impl UnwindSafe for GraphEncoding",1,["wasmedge_sdk::plugin::GraphEncoding"]],["impl UnwindSafe for ExecutionTarget",1,["wasmedge_sdk::plugin::ExecutionTarget"]],["impl UnwindSafe for PluginManager",1,["wasmedge_sdk::plugin::PluginManager"]],["impl UnwindSafe for Plugin",1,["wasmedge_sdk::plugin::Plugin"]],["impl UnwindSafe for PluginDescriptor",1,["wasmedge_sdk::plugin::PluginDescriptor"]],["impl UnwindSafe for PluginVersion",1,["wasmedge_sdk::plugin::PluginVersion"]],["impl<T> !UnwindSafe for PluginModuleBuilder<T>",1,["wasmedge_sdk::plugin::PluginModuleBuilder"]],["impl !UnwindSafe for PluginModule",1,["wasmedge_sdk::plugin::PluginModule"]],["impl UnwindSafe for Statistics",1,["wasmedge_sdk::statistics::Statistics"]],["impl UnwindSafe for Store",1,["wasmedge_sdk::store::Store"]],["impl UnwindSafe for Val",1,["wasmedge_sdk::types::Val"]],["impl UnwindSafe for ExternRef",1,["wasmedge_sdk::types::ExternRef"]],["impl UnwindSafe for Driver",1,["wasmedge_sdk::utils::Driver"]],["impl UnwindSafe for CoreVersion",1,["wasmedge_sdk::utils::CoreVersion"]],["impl UnwindSafe for VmBuilder",1,["wasmedge_sdk::vm::VmBuilder"]],["impl !UnwindSafe for Vm",1,["wasmedge_sdk::vm::Vm"]],["impl !UnwindSafe for WasiInstance",1,["wasmedge_sdk::wasi::WasiInstance"]]], +"wasmedge_sys":[["impl UnwindSafe for __fsid_t",1,["wasmedge_sys::ffi::__fsid_t"]],["impl UnwindSafe for WasmEdge_Value",1,["wasmedge_sys::ffi::WasmEdge_Value"]],["impl UnwindSafe for WasmEdge_String",1,["wasmedge_sys::ffi::WasmEdge_String"]],["impl UnwindSafe for WasmEdge_Result",1,["wasmedge_sys::ffi::WasmEdge_Result"]],["impl UnwindSafe for WasmEdge_Limit",1,["wasmedge_sys::ffi::WasmEdge_Limit"]],["impl UnwindSafe for WasmEdge_ConfigureContext",1,["wasmedge_sys::ffi::WasmEdge_ConfigureContext"]],["impl UnwindSafe for WasmEdge_StatisticsContext",1,["wasmedge_sys::ffi::WasmEdge_StatisticsContext"]],["impl UnwindSafe for WasmEdge_ASTModuleContext",1,["wasmedge_sys::ffi::WasmEdge_ASTModuleContext"]],["impl UnwindSafe for WasmEdge_FunctionTypeContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionTypeContext"]],["impl UnwindSafe for WasmEdge_MemoryTypeContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryTypeContext"]],["impl UnwindSafe for WasmEdge_TableTypeContext",1,["wasmedge_sys::ffi::WasmEdge_TableTypeContext"]],["impl UnwindSafe for WasmEdge_GlobalTypeContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalTypeContext"]],["impl UnwindSafe for WasmEdge_ImportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ImportTypeContext"]],["impl UnwindSafe for WasmEdge_ExportTypeContext",1,["wasmedge_sys::ffi::WasmEdge_ExportTypeContext"]],["impl UnwindSafe for WasmEdge_CompilerContext",1,["wasmedge_sys::ffi::WasmEdge_CompilerContext"]],["impl UnwindSafe for WasmEdge_LoaderContext",1,["wasmedge_sys::ffi::WasmEdge_LoaderContext"]],["impl UnwindSafe for WasmEdge_ValidatorContext",1,["wasmedge_sys::ffi::WasmEdge_ValidatorContext"]],["impl UnwindSafe for WasmEdge_ExecutorContext",1,["wasmedge_sys::ffi::WasmEdge_ExecutorContext"]],["impl UnwindSafe for WasmEdge_StoreContext",1,["wasmedge_sys::ffi::WasmEdge_StoreContext"]],["impl UnwindSafe for WasmEdge_ModuleInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_ModuleInstanceContext"]],["impl UnwindSafe for WasmEdge_FunctionInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_FunctionInstanceContext"]],["impl UnwindSafe for WasmEdge_TableInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_TableInstanceContext"]],["impl UnwindSafe for WasmEdge_MemoryInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_MemoryInstanceContext"]],["impl UnwindSafe for WasmEdge_GlobalInstanceContext",1,["wasmedge_sys::ffi::WasmEdge_GlobalInstanceContext"]],["impl UnwindSafe for WasmEdge_CallingFrameContext",1,["wasmedge_sys::ffi::WasmEdge_CallingFrameContext"]],["impl UnwindSafe for WasmEdge_Async",1,["wasmedge_sys::ffi::WasmEdge_Async"]],["impl UnwindSafe for WasmEdge_VMContext",1,["wasmedge_sys::ffi::WasmEdge_VMContext"]],["impl UnwindSafe for WasmEdge_PluginContext",1,["wasmedge_sys::ffi::WasmEdge_PluginContext"]],["impl UnwindSafe for WasmEdge_ProgramOption",1,["wasmedge_sys::ffi::WasmEdge_ProgramOption"]],["impl UnwindSafe for WasmEdge_ModuleDescriptor",1,["wasmedge_sys::ffi::WasmEdge_ModuleDescriptor"]],["impl UnwindSafe for WasmEdge_PluginVersionData",1,["wasmedge_sys::ffi::WasmEdge_PluginVersionData"]],["impl UnwindSafe for WasmEdge_PluginDescriptor",1,["wasmedge_sys::ffi::WasmEdge_PluginDescriptor"]],["impl UnwindSafe for Module",1,["wasmedge_sys::ast_module::Module"]],["impl<'module> UnwindSafe for ImportType<'module>",1,["wasmedge_sys::ast_module::ImportType"]],["impl<'module> UnwindSafe for ExportType<'module>",1,["wasmedge_sys::ast_module::ExportType"]],["impl UnwindSafe for Compiler",1,["wasmedge_sys::compiler::Compiler"]],["impl UnwindSafe for Config",1,["wasmedge_sys::config::Config"]],["impl UnwindSafe for Executor",1,["wasmedge_sys::executor::Executor"]],["impl UnwindSafe for CallingFrame",1,["wasmedge_sys::frame::CallingFrame"]],["impl !UnwindSafe for Function",1,["wasmedge_sys::instance::function::Function"]],["impl UnwindSafe for FuncType",1,["wasmedge_sys::instance::function::FuncType"]],["impl UnwindSafe for FuncRef",1,["wasmedge_sys::instance::function::FuncRef"]],["impl !UnwindSafe for Global",1,["wasmedge_sys::instance::global::Global"]],["impl UnwindSafe for GlobalType",1,["wasmedge_sys::instance::global::GlobalType"]],["impl !UnwindSafe for Memory",1,["wasmedge_sys::instance::memory::Memory"]],["impl UnwindSafe for MemType",1,["wasmedge_sys::instance::memory::MemType"]],["impl !UnwindSafe for Instance",1,["wasmedge_sys::instance::module::Instance"]],["impl<T> !UnwindSafe for ImportModule<T>",1,["wasmedge_sys::instance::module::ImportModule"]],["impl !UnwindSafe for WasiModule",1,["wasmedge_sys::instance::module::WasiModule"]],["impl !UnwindSafe for WasiInstance",1,["wasmedge_sys::instance::module::WasiInstance"]],["impl !UnwindSafe for Table",1,["wasmedge_sys::instance::table::Table"]],["impl UnwindSafe for TableType",1,["wasmedge_sys::instance::table::TableType"]],["impl UnwindSafe for Loader",1,["wasmedge_sys::loader::Loader"]],["impl UnwindSafe for PluginManager",1,["wasmedge_sys::plugin::PluginManager"]],["impl UnwindSafe for Plugin",1,["wasmedge_sys::plugin::Plugin"]],["impl UnwindSafe for ProgramOptionType",1,["wasmedge_sys::plugin::ProgramOptionType"]],["impl UnwindSafe for ProgramOption",1,["wasmedge_sys::plugin::ProgramOption"]],["impl UnwindSafe for ModuleDescriptor",1,["wasmedge_sys::plugin::ModuleDescriptor"]],["impl UnwindSafe for PluginVersion",1,["wasmedge_sys::plugin::PluginVersion"]],["impl UnwindSafe for PluginDescriptor",1,["wasmedge_sys::plugin::PluginDescriptor"]],["impl !UnwindSafe for PluginModule",1,["wasmedge_sys::plugin::PluginModule"]],["impl UnwindSafe for Statistics",1,["wasmedge_sys::statistics::Statistics"]],["impl UnwindSafe for Store",1,["wasmedge_sys::store::Store"]],["impl UnwindSafe for WasmValue",1,["wasmedge_sys::types::WasmValue"]],["impl UnwindSafe for Validator",1,["wasmedge_sys::validator::Validator"]]], +"wasmedge_types":[["impl UnwindSafe for WasmEdgeError",1,["wasmedge_types::error::WasmEdgeError"]],["impl UnwindSafe for FuncError",1,["wasmedge_types::error::FuncError"]],["impl UnwindSafe for MemError",1,["wasmedge_types::error::MemError"]],["impl UnwindSafe for GlobalError",1,["wasmedge_types::error::GlobalError"]],["impl UnwindSafe for TableError",1,["wasmedge_types::error::TableError"]],["impl UnwindSafe for ImportError",1,["wasmedge_types::error::ImportError"]],["impl UnwindSafe for ExportError",1,["wasmedge_types::error::ExportError"]],["impl UnwindSafe for InstanceError",1,["wasmedge_types::error::InstanceError"]],["impl UnwindSafe for PluginError",1,["wasmedge_types::error::PluginError"]],["impl UnwindSafe for StoreError",1,["wasmedge_types::error::StoreError"]],["impl UnwindSafe for VmError",1,["wasmedge_types::error::VmError"]],["impl UnwindSafe for CoreError",1,["wasmedge_types::error::CoreError"]],["impl UnwindSafe for CoreCommonError",1,["wasmedge_types::error::CoreCommonError"]],["impl UnwindSafe for CoreLoadError",1,["wasmedge_types::error::CoreLoadError"]],["impl UnwindSafe for CoreValidationError",1,["wasmedge_types::error::CoreValidationError"]],["impl UnwindSafe for CoreInstantiationError",1,["wasmedge_types::error::CoreInstantiationError"]],["impl UnwindSafe for CoreExecutionError",1,["wasmedge_types::error::CoreExecutionError"]],["impl UnwindSafe for HostFuncError",1,["wasmedge_types::error::HostFuncError"]],["impl UnwindSafe for RefType",1,["wasmedge_types::RefType"]],["impl UnwindSafe for ValType",1,["wasmedge_types::ValType"]],["impl UnwindSafe for Mutability",1,["wasmedge_types::Mutability"]],["impl UnwindSafe for CompilerOptimizationLevel",1,["wasmedge_types::CompilerOptimizationLevel"]],["impl UnwindSafe for CompilerOutputFormat",1,["wasmedge_types::CompilerOutputFormat"]],["impl UnwindSafe for HostRegistration",1,["wasmedge_types::HostRegistration"]],["impl UnwindSafe for ExternalInstanceType",1,["wasmedge_types::ExternalInstanceType"]],["impl UnwindSafe for FuncType",1,["wasmedge_types::FuncType"]],["impl UnwindSafe for TableType",1,["wasmedge_types::TableType"]],["impl UnwindSafe for MemoryType",1,["wasmedge_types::MemoryType"]],["impl UnwindSafe for GlobalType",1,["wasmedge_types::GlobalType"]],["impl UnwindSafe for NeverType",1,["wasmedge_types::NeverType"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/str/traits/trait.FromStr.js b/trait.impl/core/str/traits/trait.FromStr.js new file mode 100644 index 000000000..33c7deb72 --- /dev/null +++ b/trait.impl/core/str/traits/trait.FromStr.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sdk":[["impl FromStr for ExecutionTarget"],["impl FromStr for NNPreload"],["impl FromStr for GraphEncoding"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/serde/de/trait.Deserialize.js b/trait.impl/serde/de/trait.Deserialize.js new file mode 100644 index 000000000..b908dff27 --- /dev/null +++ b/trait.impl/serde/de/trait.Deserialize.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl<'de> Deserialize<'de> for IoState"],["impl<'de> Deserialize<'de> for SerialConnectState"],["impl<'de> Deserialize<'de> for SerialVFD"],["impl<'de> Deserialize<'de> for SerialPreOpen"],["impl<'de> Deserialize<'de> for SerialStdin"],["impl<'de> Deserialize<'de> for SerialStderr"],["impl<'de> Deserialize<'de> for SerialTcpServer"],["impl<'de> Deserialize<'de> for SerialWasiDir"],["impl<'de> Deserialize<'de> for SerialStdout"],["impl<'de> Deserialize<'de> for PollFdState"],["impl<'de> Deserialize<'de> for SerialWasiFile"],["impl<'de> Deserialize<'de> for SerialWasiCtx"],["impl<'de> Deserialize<'de> for SerialSocketType"],["impl<'de> Deserialize<'de> for SerialUdpSocket"],["impl<'de, T> Deserialize<'de> for SerialObjectPool<T>where\n T: Deserialize<'de>,"],["impl<'de> Deserialize<'de> for SerialWasiSocketState"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/serde/ser/trait.Serialize.js b/trait.impl/serde/ser/trait.Serialize.js new file mode 100644 index 000000000..3835b96f7 --- /dev/null +++ b/trait.impl/serde/ser/trait.Serialize.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"async_wasi":[["impl Serialize for SerialWasiSocketState"],["impl Serialize for SerialStdout"],["impl Serialize for SerialVFD"],["impl Serialize for SerialTcpServer"],["impl Serialize for SerialPreOpen"],["impl<T> Serialize for SerialObjectPool<T>where\n T: Serialize,"],["impl Serialize for PollFdState"],["impl Serialize for SerialSocketType"],["impl Serialize for SerialStderr"],["impl Serialize for SerialWasiDir"],["impl Serialize for SerialStdin"],["impl Serialize for IoState"],["impl Serialize for SerialWasiFile"],["impl Serialize for SerialConnectState"],["impl Serialize for SerialUdpSocket"],["impl Serialize for SerialWasiCtx"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/wasmedge_sdk/io/trait.WasmVal.js b/trait.impl/wasmedge_sdk/io/trait.WasmVal.js new file mode 100644 index 000000000..e9e26457d --- /dev/null +++ b/trait.impl/wasmedge_sdk/io/trait.WasmVal.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/wasmedge_sdk/io/trait.WasmValType.js b/trait.impl/wasmedge_sdk/io/trait.WasmValType.js new file mode 100644 index 000000000..e9e26457d --- /dev/null +++ b/trait.impl/wasmedge_sdk/io/trait.WasmValType.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/wasmedge_sdk/io/trait.WasmValTypeList.js b/trait.impl/wasmedge_sdk/io/trait.WasmValTypeList.js new file mode 100644 index 000000000..e9e26457d --- /dev/null +++ b/trait.impl/wasmedge_sdk/io/trait.WasmValTypeList.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/wasmedge_sys/instance/module/trait.AsImport.js b/trait.impl/wasmedge_sys/instance/module/trait.AsImport.js new file mode 100644 index 000000000..9581242ce --- /dev/null +++ b/trait.impl/wasmedge_sys/instance/module/trait.AsImport.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sys":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/wasmedge_sys/trait.Engine.js b/trait.impl/wasmedge_sys/trait.Engine.js new file mode 100644 index 000000000..9581242ce --- /dev/null +++ b/trait.impl/wasmedge_sys/trait.Engine.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"wasmedge_sys":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/type.impl/async_wasi/snapshots/common/types/type.__wasi_fd_t.js b/type.impl/async_wasi/snapshots/common/types/type.__wasi_fd_t.js new file mode 100644 index 000000000..6d83b286c --- /dev/null +++ b/type.impl/async_wasi/snapshots/common/types/type.__wasi_fd_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"async_wasi":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/core/option/enum.Option.js b/type.impl/core/option/enum.Option.js new file mode 100644 index 000000000..e247eaf2a --- /dev/null +++ b/type.impl/core/option/enum.Option.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[["
source§

impl<T> Option<T>

1.0.0 (const: 1.48.0) · source

pub const fn is_some(&self) -> bool

Returns true if the option is a Some value.

\n
Examples
\n
let x: Option<u32> = Some(2);\nassert_eq!(x.is_some(), true);\n\nlet x: Option<u32> = None;\nassert_eq!(x.is_some(), false);
\n
1.70.0 · source

pub fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the option is a Some and the value inside of it matches a predicate.

\n
Examples
\n
let x: Option<u32> = Some(2);\nassert_eq!(x.is_some_and(|x| x > 1), true);\n\nlet x: Option<u32> = Some(0);\nassert_eq!(x.is_some_and(|x| x > 1), false);\n\nlet x: Option<u32> = None;\nassert_eq!(x.is_some_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_none(&self) -> bool

Returns true if the option is a None value.

\n
Examples
\n
let x: Option<u32> = Some(2);\nassert_eq!(x.is_none(), false);\n\nlet x: Option<u32> = None;\nassert_eq!(x.is_none(), true);
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Option<&T>

Converts from &Option<T> to Option<&T>.

\n
Examples
\n

Calculates the length of an Option<String> as an Option<usize>\nwithout moving the String. The map method takes the self argument by value,\nconsuming the original, so this technique uses as_ref to first take an Option to a\nreference to the value inside the original.

\n\n
let text: Option<String> = Some("Hello, world!".to_string());\n// First, cast `Option<String>` to `Option<&String>` with `as_ref`,\n// then consume *that* with `map`, leaving `text` on the stack.\nlet text_length: Option<usize> = text.as_ref().map(|s| s.len());\nprintln!("still can print text: {text:?}");
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Option<&mut T>

Converts from &mut Option<T> to Option<&mut T>.

\n
Examples
\n
let mut x = Some(2);\nmatch x.as_mut() {\n    Some(v) => *v = 42,\n    None => {},\n}\nassert_eq!(x, Some(42));
\n
1.33.0 (const: unstable) · source

pub fn as_pin_ref(self: Pin<&Option<T>>) -> Option<Pin<&T>>

Converts from Pin<&Option<T>> to Option<Pin<&T>>.

\n
1.33.0 (const: unstable) · source

pub fn as_pin_mut(self: Pin<&mut Option<T>>) -> Option<Pin<&mut T>>

Converts from Pin<&mut Option<T>> to Option<Pin<&mut T>>.

\n
1.76.0 · source

pub fn as_slice(&self) -> &[T]

Returns a slice of the contained value, if any. If this is None, an\nempty slice is returned. This can be useful to have a single type of\niterator over an Option or slice.

\n

Note: Should you have an Option<&T> and wish to get a slice of T,\nyou can unpack it via opt.map_or(&[], std::slice::from_ref).

\n
Examples
\n
assert_eq!(\n    [Some(1234).as_slice(), None.as_slice()],\n    [&[1234][..], &[][..]],\n);
\n

The inverse of this function is (discounting\nborrowing) [_]::first:

\n\n
for i in [Some(1234_u16), None] {\n    assert_eq!(i.as_ref(), i.as_slice().first());\n}
\n
1.76.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Returns a mutable slice of the contained value, if any. If this is\nNone, an empty slice is returned. This can be useful to have a\nsingle type of iterator over an Option or slice.

\n

Note: Should you have an Option<&mut T> instead of a\n&mut Option<T>, which this method takes, you can obtain a mutable\nslice via opt.map_or(&mut [], std::slice::from_mut).

\n
Examples
\n
assert_eq!(\n    [Some(1234).as_mut_slice(), None.as_mut_slice()],\n    [&mut [1234][..], &mut [][..]],\n);
\n

The result is a mutable slice of zero or one items that points into\nour original Option:

\n\n
let mut x = Some(1234);\nx.as_mut_slice()[0] += 1;\nassert_eq!(x, Some(1235));
\n

The inverse of this method (discounting borrowing)\nis [_]::first_mut:

\n\n
assert_eq!(Some(123).as_mut_slice().first_mut(), Some(&mut 123))
\n
1.0.0 (const: unstable) · source

pub fn expect(self, msg: &str) -> T

Returns the contained Some value, consuming the self value.

\n
Panics
\n

Panics if the value is a None with a custom panic message provided by\nmsg.

\n
Examples
\n
let x = Some("value");\nassert_eq!(x.expect("fruits are healthy"), "value");
\n\n
let x: Option<&str> = None;\nx.expect("fruits are healthy"); // panics with `fruits are healthy`
\n
Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Option should be Some.

\n\n
let item = slice.get(0)\n    .expect("slice should not be empty");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our\nrecommendation please refer to the section on “Common Message\nStyles” in the std::error module docs.

\n
1.0.0 (const: unstable) · source

pub fn unwrap(self) -> T

Returns the contained Some value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the None\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
Panics
\n

Panics if the self value equals None.

\n
Examples
\n
let x = Some("air");\nassert_eq!(x.unwrap(), "air");
\n\n
let x: Option<&str> = None;\nassert_eq!(x.unwrap(), "air"); // fails
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Some value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
Examples
\n
assert_eq!(Some("car").unwrap_or("bike"), "car");\nassert_eq!(None.unwrap_or("bike"), "bike");
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, f: F) -> Twhere\n F: FnOnce() -> T,

Returns the contained Some value or computes it from a closure.

\n
Examples
\n
let k = 10;\nassert_eq!(Some(4).unwrap_or_else(|| 2 * k), 4);\nassert_eq!(None.unwrap_or_else(|| 2 * k), 20);
\n
1.0.0 · source

pub fn unwrap_or_default(self) -> Twhere\n T: Default,

Returns the contained Some value or a default.

\n

Consumes the self argument then, if Some, returns the contained\nvalue, otherwise if None, returns the default value for that\ntype.

\n
Examples
\n
let x: Option<u32> = None;\nlet y: Option<u32> = Some(12);\n\nassert_eq!(x.unwrap_or_default(), 0);\nassert_eq!(y.unwrap_or_default(), 12);
\n
1.58.0 (const: unstable) · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Some value, consuming the self value,\nwithout checking that the value is not None.

\n
Safety
\n

Calling this method on None is undefined behavior.

\n
Examples
\n
let x = Some("air");\nassert_eq!(unsafe { x.unwrap_unchecked() }, "air");
\n\n
let x: Option<&str> = None;\nassert_eq!(unsafe { x.unwrap_unchecked() }, "air"); // Undefined behavior!
\n
1.0.0 · source

pub fn map<U, F>(self, f: F) -> Option<U>where\n F: FnOnce(T) -> U,

Maps an Option<T> to Option<U> by applying a function to a contained value (if Some) or returns None (if None).

\n
Examples
\n

Calculates the length of an Option<String> as an\nOption<usize>, consuming the original:

\n\n
let maybe_some_string = Some(String::from("Hello, World!"));\n// `Option::map` takes self *by value*, consuming `maybe_some_string`\nlet maybe_some_len = maybe_some_string.map(|s| s.len());\nassert_eq!(maybe_some_len, Some(13));\n\nlet x: Option<&str> = None;\nassert_eq!(x.map(|s| s.len()), None);
\n
1.76.0 · source

pub fn inspect<F>(self, f: F) -> Option<T>where\n F: FnOnce(&T),

Calls the provided closure with a reference to the contained value (if Some).

\n
Examples
\n
let v = vec![1, 2, 3, 4, 5];\n\n// prints "got: 4"\nlet x: Option<&usize> = v.get(3).inspect(|x| println!("got: {x}"));\n\n// prints nothing\nlet x: Option<&usize> = v.get(5).inspect(|x| println!("got: {x}"));
\n
1.0.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> Uwhere\n F: FnOnce(T) -> U,

Returns the provided default result (if none),\nor applies a function to the contained value (if any).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
Examples
\n
let x = Some("foo");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Option<&str> = None;\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> Uwhere\n D: FnOnce() -> U,\n F: FnOnce(T) -> U,

Computes a default function result (if none), or\napplies a different function to the contained value (if any).

\n
Basic examples
\n
let k = 21;\n\nlet x = Some("foo");\nassert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 3);\n\nlet x: Option<&str> = None;\nassert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 42);
\n
Handling a Result-based fallback
\n

A somewhat common occurrence when dealing with optional values\nin combination with Result<T, E> is the case where one wants to invoke\na fallible fallback if the option is not present. This example\nparses a command line argument (if present), or the contents of a file to\nan integer. However, unlike accessing the command line argument, reading\nthe file is fallible, so it must be wrapped with Ok.

\n\n
let v: u64 = std::env::args()\n   .nth(1)\n   .map_or_else(|| std::fs::read_to_string("/etc/someconfig.conf"), Ok)?\n   .parse()?;
\n
1.0.0 · source

pub fn ok_or<E>(self, err: E) -> Result<T, E>

Transforms the Option<T> into a Result<T, E>, mapping Some(v) to\nOk(v) and None to Err(err).

\n

Arguments passed to ok_or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use ok_or_else, which is\nlazily evaluated.

\n
Examples
\n
let x = Some("foo");\nassert_eq!(x.ok_or(0), Ok("foo"));\n\nlet x: Option<&str> = None;\nassert_eq!(x.ok_or(0), Err(0));
\n
1.0.0 · source

pub fn ok_or_else<E, F>(self, err: F) -> Result<T, E>where\n F: FnOnce() -> E,

Transforms the Option<T> into a Result<T, E>, mapping Some(v) to\nOk(v) and None to Err(err()).

\n
Examples
\n
let x = Some("foo");\nassert_eq!(x.ok_or_else(|| 0), Ok("foo"));\n\nlet x: Option<&str> = None;\nassert_eq!(x.ok_or_else(|| 0), Err(0));
\n
1.40.0 · source

pub fn as_deref(&self) -> Option<&<T as Deref>::Target>where\n T: Deref,

Converts from Option<T> (or &Option<T>) to Option<&T::Target>.

\n

Leaves the original Option in-place, creating a new one with a reference\nto the original one, additionally coercing the contents via Deref.

\n
Examples
\n
let x: Option<String> = Some("hey".to_owned());\nassert_eq!(x.as_deref(), Some("hey"));\n\nlet x: Option<String> = None;\nassert_eq!(x.as_deref(), None);
\n
1.40.0 · source

pub fn as_deref_mut(&mut self) -> Option<&mut <T as Deref>::Target>where\n T: DerefMut,

Converts from Option<T> (or &mut Option<T>) to Option<&mut T::Target>.

\n

Leaves the original Option in-place, creating a new one containing a mutable reference to\nthe inner type’s Deref::Target type.

\n
Examples
\n
let mut x: Option<String> = Some("hey".to_owned());\nassert_eq!(x.as_deref_mut().map(|x| {\n    x.make_ascii_uppercase();\n    x\n}), Some("HEY".to_owned().as_mut_str()));
\n
1.0.0 (const: unstable) · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

\n
Examples
\n
let x = Some(4);\nassert_eq!(x.iter().next(), Some(&4));\n\nlet x: Option<u32> = None;\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the possibly contained value.

\n
Examples
\n
let mut x = Some(4);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 42,\n    None => {},\n}\nassert_eq!(x, Some(42));\n\nlet mut x: Option<u32> = None;\nassert_eq!(x.iter_mut().next(), None);
\n
1.0.0 · source

pub fn and<U>(self, optb: Option<U>) -> Option<U>

Returns None if the option is None, otherwise returns optb.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
Examples
\n
let x = Some(2);\nlet y: Option<&str> = None;\nassert_eq!(x.and(y), None);\n\nlet x: Option<u32> = None;\nlet y = Some("foo");\nassert_eq!(x.and(y), None);\n\nlet x = Some(2);\nlet y = Some("foo");\nassert_eq!(x.and(y), Some("foo"));\n\nlet x: Option<u32> = None;\nlet y: Option<&str> = None;\nassert_eq!(x.and(y), None);
\n
1.0.0 · source

pub fn and_then<U, F>(self, f: F) -> Option<U>where\n F: FnOnce(T) -> Option<U>,

Returns None if the option is None, otherwise calls f with the\nwrapped value and returns the result.

\n

Some languages call this operation flatmap.

\n
Examples
\n
fn sq_then_to_string(x: u32) -> Option<String> {\n    x.checked_mul(x).map(|sq| sq.to_string())\n}\n\nassert_eq!(Some(2).and_then(sq_then_to_string), Some(4.to_string()));\nassert_eq!(Some(1_000_000).and_then(sq_then_to_string), None); // overflowed!\nassert_eq!(None.and_then(sq_then_to_string), None);
\n

Often used to chain fallible operations that may return None.

\n\n
let arr_2d = [["A0", "A1"], ["B0", "B1"]];\n\nlet item_0_1 = arr_2d.get(0).and_then(|row| row.get(1));\nassert_eq!(item_0_1, Some(&"A1"));\n\nlet item_2_0 = arr_2d.get(2).and_then(|row| row.get(0));\nassert_eq!(item_2_0, None);
\n
1.27.0 · source

pub fn filter<P>(self, predicate: P) -> Option<T>where\n P: FnOnce(&T) -> bool,

Returns None if the option is None, otherwise calls predicate\nwith the wrapped value and returns:

\n
    \n
  • Some(t) if predicate returns true (where t is the wrapped\nvalue), and
  • \n
  • None if predicate returns false.
  • \n
\n

This function works similar to Iterator::filter(). You can imagine\nthe Option<T> being an iterator over one or zero elements. filter()\nlets you decide which elements to keep.

\n
Examples
\n
fn is_even(n: &i32) -> bool {\n    n % 2 == 0\n}\n\nassert_eq!(None.filter(is_even), None);\nassert_eq!(Some(3).filter(is_even), None);\nassert_eq!(Some(4).filter(is_even), Some(4));
\n
1.0.0 · source

pub fn or(self, optb: Option<T>) -> Option<T>

Returns the option if it contains a value, otherwise returns optb.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
Examples
\n
let x = Some(2);\nlet y = None;\nassert_eq!(x.or(y), Some(2));\n\nlet x = None;\nlet y = Some(100);\nassert_eq!(x.or(y), Some(100));\n\nlet x = Some(2);\nlet y = Some(100);\nassert_eq!(x.or(y), Some(2));\n\nlet x: Option<u32> = None;\nlet y = None;\nassert_eq!(x.or(y), None);
\n
1.0.0 · source

pub fn or_else<F>(self, f: F) -> Option<T>where\n F: FnOnce() -> Option<T>,

Returns the option if it contains a value, otherwise calls f and\nreturns the result.

\n
Examples
\n
fn nobody() -> Option<&'static str> { None }\nfn vikings() -> Option<&'static str> { Some("vikings") }\n\nassert_eq!(Some("barbarians").or_else(vikings), Some("barbarians"));\nassert_eq!(None.or_else(vikings), Some("vikings"));\nassert_eq!(None.or_else(nobody), None);
\n
1.37.0 · source

pub fn xor(self, optb: Option<T>) -> Option<T>

Returns Some if exactly one of self, optb is Some, otherwise returns None.

\n
Examples
\n
let x = Some(2);\nlet y: Option<u32> = None;\nassert_eq!(x.xor(y), Some(2));\n\nlet x: Option<u32> = None;\nlet y = Some(2);\nassert_eq!(x.xor(y), Some(2));\n\nlet x = Some(2);\nlet y = Some(2);\nassert_eq!(x.xor(y), None);\n\nlet x: Option<u32> = None;\nlet y: Option<u32> = None;\nassert_eq!(x.xor(y), None);
\n
1.53.0 · source

pub fn insert(&mut self, value: T) -> &mut T

Inserts value into the option, then returns a mutable reference to it.

\n

If the option already contains a value, the old value is dropped.

\n

See also Option::get_or_insert, which doesn’t update the value if\nthe option already contains Some.

\n
Example
\n
let mut opt = None;\nlet val = opt.insert(1);\nassert_eq!(*val, 1);\nassert_eq!(opt.unwrap(), 1);\nlet val = opt.insert(2);\nassert_eq!(*val, 2);\n*val = 3;\nassert_eq!(opt.unwrap(), 3);
\n
1.20.0 · source

pub fn get_or_insert(&mut self, value: T) -> &mut T

Inserts value into the option if it is None, then\nreturns a mutable reference to the contained value.

\n

See also Option::insert, which updates the value even if\nthe option already contains Some.

\n
Examples
\n
let mut x = None;\n\n{\n    let y: &mut u32 = x.get_or_insert(5);\n    assert_eq!(y, &5);\n\n    *y = 7;\n}\n\nassert_eq!(x, Some(7));
\n
source

pub fn get_or_insert_default(&mut self) -> &mut Twhere\n T: Default,

🔬This is a nightly-only experimental API. (option_get_or_insert_default)

Inserts the default value into the option if it is None, then\nreturns a mutable reference to the contained value.

\n
Examples
\n
#![feature(option_get_or_insert_default)]\n\nlet mut x = None;\n\n{\n    let y: &mut u32 = x.get_or_insert_default();\n    assert_eq!(y, &0);\n\n    *y = 7;\n}\n\nassert_eq!(x, Some(7));
\n
1.20.0 · source

pub fn get_or_insert_with<F>(&mut self, f: F) -> &mut Twhere\n F: FnOnce() -> T,

Inserts a value computed from f into the option if it is None,\nthen returns a mutable reference to the contained value.

\n
Examples
\n
let mut x = None;\n\n{\n    let y: &mut u32 = x.get_or_insert_with(|| 5);\n    assert_eq!(y, &5);\n\n    *y = 7;\n}\n\nassert_eq!(x, Some(7));
\n
1.0.0 (const: unstable) · source

pub fn take(&mut self) -> Option<T>

Takes the value out of the option, leaving a None in its place.

\n
Examples
\n
let mut x = Some(2);\nlet y = x.take();\nassert_eq!(x, None);\nassert_eq!(y, Some(2));\n\nlet mut x: Option<u32> = None;\nlet y = x.take();\nassert_eq!(x, None);\nassert_eq!(y, None);
\n
source

pub fn take_if<P>(&mut self, predicate: P) -> Option<T>where\n P: FnOnce(&mut T) -> bool,

🔬This is a nightly-only experimental API. (option_take_if)

Takes the value out of the option, but only if the predicate evaluates to\ntrue on a mutable reference to the value.

\n

In other words, replaces self with None if the predicate returns true.\nThis method operates similar to Option::take but conditional.

\n
Examples
\n
#![feature(option_take_if)]\n\nlet mut x = Some(42);\n\nlet prev = x.take_if(|v| if *v == 42 {\n    *v += 1;\n    false\n} else {\n    false\n});\nassert_eq!(x, Some(43));\nassert_eq!(prev, None);\n\nlet prev = x.take_if(|v| *v == 43);\nassert_eq!(x, None);\nassert_eq!(prev, Some(43));
\n
1.31.0 (const: unstable) · source

pub fn replace(&mut self, value: T) -> Option<T>

Replaces the actual value in the option by the value given in parameter,\nreturning the old value if present,\nleaving a Some in its place without deinitializing either one.

\n
Examples
\n
let mut x = Some(2);\nlet old = x.replace(5);\nassert_eq!(x, Some(5));\nassert_eq!(old, Some(2));\n\nlet mut x = None;\nlet old = x.replace(3);\nassert_eq!(x, Some(3));\nassert_eq!(old, None);
\n
1.46.0 · source

pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)>

Zips self with another Option.

\n

If self is Some(s) and other is Some(o), this method returns Some((s, o)).\nOtherwise, None is returned.

\n
Examples
\n
let x = Some(1);\nlet y = Some("hi");\nlet z = None::<u8>;\n\nassert_eq!(x.zip(y), Some((1, "hi")));\nassert_eq!(x.zip(z), None);
\n
source

pub fn zip_with<U, F, R>(self, other: Option<U>, f: F) -> Option<R>where\n F: FnOnce(T, U) -> R,

🔬This is a nightly-only experimental API. (option_zip)

Zips self and another Option with function f.

\n

If self is Some(s) and other is Some(o), this method returns Some(f(s, o)).\nOtherwise, None is returned.

\n
Examples
\n
#![feature(option_zip)]\n\n#[derive(Debug, PartialEq)]\nstruct Point {\n    x: f64,\n    y: f64,\n}\n\nimpl Point {\n    fn new(x: f64, y: f64) -> Self {\n        Self { x, y }\n    }\n}\n\nlet x = Some(17.5);\nlet y = Some(42.7);\n\nassert_eq!(x.zip_with(y, Point::new), Some(Point { x: 17.5, y: 42.7 }));\nassert_eq!(x.zip_with(None, Point::new), None);
\n
",0,"wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
source§

impl<T> FromResidual<Yeet<()>> for Option<T>

source§

fn from_residual(_: Yeet<()>) -> Option<T>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
source§

impl<T> FromResidual for Option<T>

source§

fn from_residual(residual: Option<Infallible>) -> Option<T>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
source§

impl<T> Try for Option<T>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Option<Infallible>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Option<T> as Try>::Output) -> Option<T>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self\n) -> ControlFlow<<Option<T> as Try>::Residual, <Option<T> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> StructuralEq for Option<T>

","StructuralEq","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> Eq for Option<T>where\n T: Eq,

","Eq","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> Ord for Option<T>where\n T: Ord,

source§

fn cmp(&self, other: &Option<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<A, V> FromIterator<Option<A>> for Option<V>where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Option<V>where\n I: IntoIterator<Item = Option<A>>,

Takes each element in the Iterator: if it is None,\nno further elements are taken, and the None is\nreturned. Should no None occur, a container of type\nV containing the values of each Option is returned.

\n
Examples
\n

Here is an example which increments every integer in a vector.\nWe use the checked variant of add that returns None when the\ncalculation would result in an overflow.

\n\n
let items = vec![0_u16, 1, 2];\n\nlet res: Option<Vec<u16>> = items\n    .iter()\n    .map(|x| x.checked_add(1))\n    .collect();\n\nassert_eq!(res, Some(vec![1, 2, 3]));
\n

As you can see, this will return the expected, valid items.

\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let items = vec![2_u16, 1, 0];\n\nlet res: Option<Vec<u16>> = items\n    .iter()\n    .map(|x| x.checked_sub(1))\n    .collect();\n\nassert_eq!(res, None);
\n

Since the last element is zero, it would underflow. Thus, the resulting\nvalue is None.

\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first None.

\n\n
let items = vec![3_u16, 2, 1, 10];\n\nlet mut shared = 0;\n\nlet res: Option<Vec<u16>> = items\n    .iter()\n    .map(|x| { shared += x; x.checked_sub(2) })\n    .collect();\n\nassert_eq!(res, None);\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> PartialEq for Option<T>where\n T: PartialEq,

source§

fn eq(&self, other: &Option<T>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> Clone for Option<T>where\n T: Clone,

source§

fn clone(&self) -> Option<T>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Option<T>)

Performs copy-assignment from source. Read more
","Clone","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> Hash for Option<T>where\n T: Hash,

source§

fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> IntoIterator for Option<T>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n
Examples
\n
let x = Some("string");\nlet v: Vec<&str> = x.into_iter().collect();\nassert_eq!(v, ["string"]);\n\nlet x = None;\nlet v: Vec<&str> = x.into_iter().collect();\nassert!(v.is_empty());
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> StructuralPartialEq for Option<T>

","StructuralPartialEq","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.37.0 · source§

impl<T, U> Sum<Option<U>> for Option<T>where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Option<T>where\n I: Iterator<Item = Option<U>>,

Takes each element in the Iterator: if it is a None, no further\nelements are taken, and the None is returned. Should no None\noccur, the sum of all elements is returned.

\n
Examples
\n

This sums up the position of the character ‘a’ in a vector of strings,\nif a word did not have the character ‘a’ the operation returns None:

\n\n
let words = vec!["have", "a", "great", "day"];\nlet total: Option<usize> = words.iter().map(|w| w.find('a')).sum();\nassert_eq!(total, Some(5));\nlet words = vec!["have", "a", "good", "day"];\nlet total: Option<usize> = words.iter().map(|w| w.find('a')).sum();\nassert_eq!(total, None);
\n
","Sum>","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> Debug for Option<T>where\n T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.12.0 · source§

impl<T> From<T> for Option<T>

source§

fn from(val: T) -> Option<T>

Moves val into a new Some.

\n
Examples
\n
let o: Option<u8> = Option::from(67);\n\nassert_eq!(Some(67), o);
\n
","From","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> Copy for Option<T>where\n T: Copy,

","Copy","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> PartialOrd for Option<T>where\n T: PartialOrd,

source§

fn partial_cmp(&self, other: &Option<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.0.0 · source§

impl<T> Default for Option<T>

source§

fn default() -> Option<T>

Returns None.

\n
Examples
\n
let opt: Option<u32> = Option::default();\nassert!(opt.is_none());
\n
","Default","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
1.37.0 · source§

impl<T, U> Product<Option<U>> for Option<T>where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Option<T>where\n I: Iterator<Item = Option<U>>,

Takes each element in the Iterator: if it is a None, no further\nelements are taken, and the None is returned. Should no None\noccur, the product of all elements is returned.

\n
Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns None:

\n\n
let nums = vec!["5", "10", "1", "2"];\nlet total: Option<usize> = nums.iter().map(|w| w.parse::<usize>().ok()).product();\nassert_eq!(total, Some(100));\nlet nums = vec!["5", "10", "one", "2"];\nlet total: Option<usize> = nums.iter().map(|w| w.parse::<usize>().ok()).product();\nassert_eq!(total, None);
\n
","Product>","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
§

impl<'a, T> Parse<'a> for Option<T>where\n T: Peek + Parse<'a>,

§

fn parse(parser: Parser<'a>) -> Result<Option<T>, Error>

Attempts to parse Self from parser, returning an error if it could\nnot be parsed. Read more
","Parse<'a>","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"],["
§

impl<T> Encode for Option<T>where\n T: Encode,

§

fn encode(&self, sink: &mut Vec<u8>)

Encode the type into the given byte sink.
","Encode","wasmedge_sys::ffi::WasmEdge_HostFunc_t","wasmedge_sys::ffi::WasmEdge_WrapFunc_t"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/core/result/enum.Result.js b/type.impl/core/result/enum.Result.js new file mode 100644 index 000000000..cf81849c0 --- /dev/null +++ b/type.impl/core/result/enum.Result.js @@ -0,0 +1,4 @@ +(function() {var type_impls = { +"wasmedge_sdk":[["
source§

impl<T, E> Result<T, E>

1.0.0 (const: 1.48.0) · source

pub const fn is_ok(&self) -> bool

Returns true if the result is Ok.

\n
Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err("Some error message");\nassert_eq!(x.is_ok(), false);
\n
1.70.0 · source

pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the result is Ok and the value inside of it matches a predicate.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err("hey");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_err(&self) -> bool

Returns true if the result is Err.

\n
Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err("Some error message");\nassert_eq!(x.is_err(), true);
\n
1.70.0 · source

pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

Returns true if the result is Err and the value inside of it matches a predicate.

\n
Examples
\n
use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, "!"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
\n
1.0.0 · source

pub fn ok(self) -> Option<T>

Converts from Result<T, E> to Option<T>.

\n

Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err("Nothing here");\nassert_eq!(x.ok(), None);
\n
1.0.0 · source

pub fn err(self) -> Option<E>

Converts from Result<T, E> to Option<E>.

\n

Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err("Nothing here");\nassert_eq!(x.err(), Some("Nothing here"));
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Result<&T, &E>

Converts from &Result<T, E> to Result<&T, &E>.

\n

Produces a new Result, containing a reference\ninto the original, leaving the original in place.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err("Error");\nassert_eq!(x.as_ref(), Err(&"Error"));
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

\n
Examples
\n
fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
\n
1.0.0 · source

pub fn map<U, F>(self, op: F) -> Result<U, E>where\n F: FnOnce(T) -> U,

Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

\n

This function can be used to compose the results of two functions.

\n
Examples
\n

Print the numbers on each line of a string multiplied by two.

\n\n
let line = "1\\n2\\n3\\n4\\n";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!("{n}"),\n        Err(..) => {}\n    }\n}
\n
1.41.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> Uwhere\n F: FnOnce(T) -> U,

Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
Examples
\n
let x: Result<_, &str> = Ok("foo");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err("bar");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.41.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> Uwhere\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

\n

This function can be used to unpack a successful result\nwhile handling an error.

\n
Examples
\n
let k = 21;\n\nlet x : Result<_, &str> = Ok("foo");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err("bar");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_err<F, O>(self, op: O) -> Result<T, F>where\n O: FnOnce(E) -> F,

Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

\n

This function can be used to pass through a successful result while handling\nan error.

\n
Examples
\n
fn stringify(x: u32) -> String { format!("error code: {x}") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err("error code: 13".to_string()));
\n
1.76.0 · source

pub fn inspect<F>(self, f: F) -> Result<T, E>where\n F: FnOnce(&T),

Calls the provided closure with a reference to the contained value (if Ok).

\n
Examples
\n
let x: u8 = "4"\n    .parse::<u8>()\n    .inspect(|x| println!("original: {x}"))\n    .map(|x| x.pow(3))\n    .expect("failed to parse number");
\n
1.76.0 · source

pub fn inspect_err<F>(self, f: F) -> Result<T, E>where\n F: FnOnce(&E),

Calls the provided closure with a reference to the contained error (if Err).

\n
Examples
\n
use std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string("address.txt")\n        .inspect_err(|e| eprintln!("failed to read file: {e}"))\n}
\n
1.47.0 · source

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>where\n T: Deref,

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

\n

Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

\n
Examples
\n
let x: Result<String, u32> = Ok("hello".to_string());\nlet y: Result<&str, &u32> = Ok("hello");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
\n
1.47.0 · source

pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>where\n T: DerefMut,

Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

\n

Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

\n
Examples
\n
let mut s = "HELLO".to_string();\nlet mut x: Result<String, u32> = Ok("hello".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
Examples
\n
let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err("nothing!");\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
Examples
\n
let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err("nothing!");\nassert_eq!(x.iter_mut().next(), None);
\n
1.4.0 · source

pub fn expect(self, msg: &str) -> Twhere\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
Panics
\n

Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

\n
Examples
\n
let x: Result<u32, &str> = Err("emergency failure");\nx.expect("Testing expect"); // panics with `Testing expect: emergency failure`
\n
Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

\n\n
let path = std::env::var("IMPORTANT_PATH")\n    .expect("env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

\n
1.0.0 · source

pub fn unwrap(self) -> Twhere\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
Panics
\n

Panics if the value is an Err, with a panic message provided by the\nErr’s value.

\n
Examples
\n

Basic usage:

\n\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
\n\n
let x: Result<u32, &str> = Err("emergency failure");\nx.unwrap(); // panics with `emergency failure`
\n
1.16.0 · source

pub fn unwrap_or_default(self) -> Twhere\n T: Default,

Returns the contained Ok value or a default

\n

Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

\n
Examples
\n

Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

\n\n
let good_year_from_input = "1909";\nlet bad_year_from_input = "190blarg";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
\n
1.17.0 · source

pub fn expect_err(self, msg: &str) -> Ewhere\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
Panics
\n

Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

\n
Examples
\n
let x: Result<u32, &str> = Ok(10);\nx.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
\n
1.0.0 · source

pub fn unwrap_err(self) -> Ewhere\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
Panics
\n

Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
\n\n
let x: Result<u32, &str> = Err("emergency failure");\nassert_eq!(x.unwrap_err(), "emergency failure");
\n
source

pub fn into_ok(self) -> Twhere\n E: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Ok value, but never panics.

\n

Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

\n
Examples
\n
\nfn only_good_news() -> Result<String, !> {\n    Ok("this is fine".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!("{s}");
\n
source

pub fn into_err(self) -> Ewhere\n T: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Err value, but never panics.

\n

Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

\n
Examples
\n
\nfn only_bad_news() -> Result<!, String> {\n    Err("Oops, it failed".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!("{error}");
\n
1.0.0 · source

pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

Returns res if the result is Ok, otherwise returns the Err value of self.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err("late error");\nassert_eq!(x.and(y), Err("late error"));\n\nlet x: Result<u32, &str> = Err("early error");\nlet y: Result<&str, &str> = Ok("foo");\nassert_eq!(x.and(y), Err("early error"));\n\nlet x: Result<u32, &str> = Err("not a 2");\nlet y: Result<&str, &str> = Err("late error");\nassert_eq!(x.and(y), Err("not a 2"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok("different result type");\nassert_eq!(x.and(y), Ok("different result type"));
\n
1.0.0 · source

pub fn and_then<U, F>(self, op: F) -> Result<U, E>where\n F: FnOnce(T) -> Result<U, E>,

Calls op if the result is Ok, otherwise returns the Err value of self.

\n

This function can be used for control flow based on Result values.

\n
Examples
\n
fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or("overflowed")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err("overflowed"));\nassert_eq!(Err("not a number").and_then(sq_then_to_string), Err("not a number"));
\n

Often used to chain fallible operations that may return Err.

\n\n
use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows "/" maps to "C:\\"\nlet root_modified_time = Path::new("/").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new("/bad/path").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
\n
1.0.0 · source

pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

Returns res if the result is Err, otherwise returns the Ok value of self.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err("late error");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err("early error");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err("not a 2");\nlet y: Result<u32, &str> = Err("late error");\nassert_eq!(x.or(y), Err("late error"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
\n
1.0.0 · source

pub fn or_else<F, O>(self, op: O) -> Result<T, F>where\n O: FnOnce(E) -> Result<T, F>,

Calls op if the result is Err, otherwise returns the Ok value of self.

\n

This function can be used for control flow based on result values.

\n
Examples
\n
fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Ok value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
Examples
\n
let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err("error");\nassert_eq!(x.unwrap_or(default), default);
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, op: F) -> Twhere\n F: FnOnce(E) -> T,

Returns the contained Ok value or computes it from a closure.

\n
Examples
\n
fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err("foo").unwrap_or_else(count), 3);
\n
1.58.0 · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

\n
Safety
\n

Calling this method on an Err is undefined behavior.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
\n\n
let x: Result<u32, &str> = Err("emergency failure");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
\n
1.58.0 · source

pub unsafe fn unwrap_err_unchecked(self) -> E

Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

\n
Safety
\n

Calling this method on an Ok is undefined behavior.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
\n\n
let x: Result<u32, &str> = Err("emergency failure");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure");
\n
",0,"wasmedge_sdk::WasmEdgeResult"],["
source§

impl<T, E> Result<&T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>where\n T: Copy,

Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>where\n T: Clone,

Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"wasmedge_sdk::WasmEdgeResult"],["
source§

impl<T, E> Result<&mut T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>where\n T: Copy,

Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>where\n T: Clone,

Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"wasmedge_sdk::WasmEdgeResult"],["
source§

impl<T, E> Result<Option<T>, E>

1.33.0 (const: unstable) · source

pub fn transpose(self) -> Option<Result<T, E>>

Transposes a Result of an Option into an Option of a Result.

\n

Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

\n
Examples
\n
#[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
\n
",0,"wasmedge_sdk::WasmEdgeResult"],["
source§

impl<T, E> Result<Result<T, E>, E>

source

pub fn flatten(self) -> Result<T, E>

🔬This is a nightly-only experimental API. (result_flattening)

Converts from Result<Result<T, E>, E> to Result<T, E>

\n
Examples
\n
#![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok("hello"));\nassert_eq!(Ok("hello"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
\n

Flattening only removes one level of nesting at a time:

\n\n
#![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok("hello")));\nassert_eq!(Ok(Ok("hello")), x.flatten());\nassert_eq!(Ok("hello"), x.flatten().flatten());
\n
",0,"wasmedge_sdk::WasmEdgeResult"],["
1.61.0 · source§

impl<T, E> Termination for Result<T, E>where\n T: Termination,\n E: Debug,

source§

fn report(self) -> ExitCode

Is called to get the representation of the value as status code.\nThis status code is returned to the operating system.
","Termination","wasmedge_sdk::WasmEdgeResult"],["
source§

impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>where\n F: From<E>,

source§

fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","wasmedge_sdk::WasmEdgeResult"],["
source§

impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>where\n F: From<E>,

source§

fn from_residual(_: Yeet<E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","wasmedge_sdk::WasmEdgeResult"],["
source§

impl<T, E> Try for Result<T, E>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Result<Infallible, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> StructuralEq for Result<T, E>

","StructuralEq","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Eq for Result<T, E>where\n T: Eq,\n E: Eq,

","Eq","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Ord for Result<T, E>where\n T: Ord,\n E: Ord,

source§

fn cmp(&self, other: &Result<T, E>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Result<V, E>where\n I: IntoIterator<Item = Result<A, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

\n

Here is an example which increments every integer in a vector,\nchecking for overflow:

\n\n
let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or("Overflow!")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or("Underflow!")\n).collect();\nassert_eq!(res, Err("Underflow!"));
\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

\n\n
let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or("Underflow!")\n}).collect();\nassert_eq!(res, Err("Underflow!"));\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> PartialEq for Result<T, E>where\n T: PartialEq,\n E: PartialEq,

source§

fn eq(&self, other: &Result<T, E>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Clone for Result<T, E>where\n T: Clone,\n E: Clone,

source§

fn clone(&self) -> Result<T, E>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Result<T, E>)

Performs copy-assignment from source. Read more
","Clone","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Hash for Result<T, E>where\n T: Hash,\n E: Hash,

source§

fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> IntoIterator for Result<T, E>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
Examples
\n
let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err("nothing!");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","wasmedge_sdk::WasmEdgeResult"],["
source§

impl<T, E> Residual<T> for Result<Infallible, E>

§

type TryType = Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2_residual)
The “return” type of this meta-function.
","Residual","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> StructuralPartialEq for Result<T, E>

","StructuralPartialEq","wasmedge_sdk::WasmEdgeResult"],["
1.16.0 · source§

impl<T, U, E> Sum<Result<U, E>> for Result<T, E>where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Result<T, E>where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

\n
Examples
\n

This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

\n\n
let f = |&x: &i32| if x < 0 { Err("Negative element found") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err("Negative element found"));
\n
","Sum>","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Debug for Result<T, E>where\n T: Debug,\n E: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Copy for Result<T, E>where\n T: Copy,\n E: Copy,

","Copy","wasmedge_sdk::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> PartialOrd for Result<T, E>where\n T: PartialOrd,\n E: PartialOrd,

source§

fn partial_cmp(&self, other: &Result<T, E>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","wasmedge_sdk::WasmEdgeResult"],["
1.16.0 · source§

impl<T, U, E> Product<Result<U, E>> for Result<T, E>where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Result<T, E>where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

\n
Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

\n\n
let nums = vec!["5", "10", "1", "2"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec!["5", "10", "one", "2"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
\n
","Product>","wasmedge_sdk::WasmEdgeResult"]], +"wasmedge_types":[["
source§

impl<T, E> Result<T, E>

1.0.0 (const: 1.48.0) · source

pub const fn is_ok(&self) -> bool

Returns true if the result is Ok.

\n
Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err("Some error message");\nassert_eq!(x.is_ok(), false);
\n
1.70.0 · source

pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the result is Ok and the value inside of it matches a predicate.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err("hey");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_err(&self) -> bool

Returns true if the result is Err.

\n
Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err("Some error message");\nassert_eq!(x.is_err(), true);
\n
1.70.0 · source

pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

Returns true if the result is Err and the value inside of it matches a predicate.

\n
Examples
\n
use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, "!"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
\n
1.0.0 · source

pub fn ok(self) -> Option<T>

Converts from Result<T, E> to Option<T>.

\n

Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err("Nothing here");\nassert_eq!(x.ok(), None);
\n
1.0.0 · source

pub fn err(self) -> Option<E>

Converts from Result<T, E> to Option<E>.

\n

Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err("Nothing here");\nassert_eq!(x.err(), Some("Nothing here"));
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Result<&T, &E>

Converts from &Result<T, E> to Result<&T, &E>.

\n

Produces a new Result, containing a reference\ninto the original, leaving the original in place.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err("Error");\nassert_eq!(x.as_ref(), Err(&"Error"));
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

\n
Examples
\n
fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
\n
1.0.0 · source

pub fn map<U, F>(self, op: F) -> Result<U, E>where\n F: FnOnce(T) -> U,

Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

\n

This function can be used to compose the results of two functions.

\n
Examples
\n

Print the numbers on each line of a string multiplied by two.

\n\n
let line = "1\\n2\\n3\\n4\\n";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!("{n}"),\n        Err(..) => {}\n    }\n}
\n
1.41.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> Uwhere\n F: FnOnce(T) -> U,

Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
Examples
\n
let x: Result<_, &str> = Ok("foo");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err("bar");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.41.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> Uwhere\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

\n

This function can be used to unpack a successful result\nwhile handling an error.

\n
Examples
\n
let k = 21;\n\nlet x : Result<_, &str> = Ok("foo");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err("bar");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_err<F, O>(self, op: O) -> Result<T, F>where\n O: FnOnce(E) -> F,

Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

\n

This function can be used to pass through a successful result while handling\nan error.

\n
Examples
\n
fn stringify(x: u32) -> String { format!("error code: {x}") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err("error code: 13".to_string()));
\n
1.76.0 · source

pub fn inspect<F>(self, f: F) -> Result<T, E>where\n F: FnOnce(&T),

Calls the provided closure with a reference to the contained value (if Ok).

\n
Examples
\n
let x: u8 = "4"\n    .parse::<u8>()\n    .inspect(|x| println!("original: {x}"))\n    .map(|x| x.pow(3))\n    .expect("failed to parse number");
\n
1.76.0 · source

pub fn inspect_err<F>(self, f: F) -> Result<T, E>where\n F: FnOnce(&E),

Calls the provided closure with a reference to the contained error (if Err).

\n
Examples
\n
use std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string("address.txt")\n        .inspect_err(|e| eprintln!("failed to read file: {e}"))\n}
\n
1.47.0 · source

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>where\n T: Deref,

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

\n

Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

\n
Examples
\n
let x: Result<String, u32> = Ok("hello".to_string());\nlet y: Result<&str, &u32> = Ok("hello");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
\n
1.47.0 · source

pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>where\n T: DerefMut,

Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

\n

Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

\n
Examples
\n
let mut s = "HELLO".to_string();\nlet mut x: Result<String, u32> = Ok("hello".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
Examples
\n
let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err("nothing!");\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
Examples
\n
let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err("nothing!");\nassert_eq!(x.iter_mut().next(), None);
\n
1.4.0 · source

pub fn expect(self, msg: &str) -> Twhere\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
Panics
\n

Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

\n
Examples
\n
let x: Result<u32, &str> = Err("emergency failure");\nx.expect("Testing expect"); // panics with `Testing expect: emergency failure`
\n
Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

\n\n
let path = std::env::var("IMPORTANT_PATH")\n    .expect("env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

\n
1.0.0 · source

pub fn unwrap(self) -> Twhere\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
Panics
\n

Panics if the value is an Err, with a panic message provided by the\nErr’s value.

\n
Examples
\n

Basic usage:

\n\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
\n\n
let x: Result<u32, &str> = Err("emergency failure");\nx.unwrap(); // panics with `emergency failure`
\n
1.16.0 · source

pub fn unwrap_or_default(self) -> Twhere\n T: Default,

Returns the contained Ok value or a default

\n

Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

\n
Examples
\n

Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

\n\n
let good_year_from_input = "1909";\nlet bad_year_from_input = "190blarg";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
\n
1.17.0 · source

pub fn expect_err(self, msg: &str) -> Ewhere\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
Panics
\n

Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

\n
Examples
\n
let x: Result<u32, &str> = Ok(10);\nx.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
\n
1.0.0 · source

pub fn unwrap_err(self) -> Ewhere\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
Panics
\n

Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
\n\n
let x: Result<u32, &str> = Err("emergency failure");\nassert_eq!(x.unwrap_err(), "emergency failure");
\n
source

pub fn into_ok(self) -> Twhere\n E: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Ok value, but never panics.

\n

Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

\n
Examples
\n
\nfn only_good_news() -> Result<String, !> {\n    Ok("this is fine".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!("{s}");
\n
source

pub fn into_err(self) -> Ewhere\n T: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Err value, but never panics.

\n

Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

\n
Examples
\n
\nfn only_bad_news() -> Result<!, String> {\n    Err("Oops, it failed".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!("{error}");
\n
1.0.0 · source

pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

Returns res if the result is Ok, otherwise returns the Err value of self.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err("late error");\nassert_eq!(x.and(y), Err("late error"));\n\nlet x: Result<u32, &str> = Err("early error");\nlet y: Result<&str, &str> = Ok("foo");\nassert_eq!(x.and(y), Err("early error"));\n\nlet x: Result<u32, &str> = Err("not a 2");\nlet y: Result<&str, &str> = Err("late error");\nassert_eq!(x.and(y), Err("not a 2"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok("different result type");\nassert_eq!(x.and(y), Ok("different result type"));
\n
1.0.0 · source

pub fn and_then<U, F>(self, op: F) -> Result<U, E>where\n F: FnOnce(T) -> Result<U, E>,

Calls op if the result is Ok, otherwise returns the Err value of self.

\n

This function can be used for control flow based on Result values.

\n
Examples
\n
fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or("overflowed")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err("overflowed"));\nassert_eq!(Err("not a number").and_then(sq_then_to_string), Err("not a number"));
\n

Often used to chain fallible operations that may return Err.

\n\n
use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows "/" maps to "C:\\"\nlet root_modified_time = Path::new("/").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new("/bad/path").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
\n
1.0.0 · source

pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

Returns res if the result is Err, otherwise returns the Ok value of self.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err("late error");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err("early error");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err("not a 2");\nlet y: Result<u32, &str> = Err("late error");\nassert_eq!(x.or(y), Err("late error"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
\n
1.0.0 · source

pub fn or_else<F, O>(self, op: O) -> Result<T, F>where\n O: FnOnce(E) -> Result<T, F>,

Calls op if the result is Err, otherwise returns the Ok value of self.

\n

This function can be used for control flow based on result values.

\n
Examples
\n
fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Ok value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
Examples
\n
let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err("error");\nassert_eq!(x.unwrap_or(default), default);
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, op: F) -> Twhere\n F: FnOnce(E) -> T,

Returns the contained Ok value or computes it from a closure.

\n
Examples
\n
fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err("foo").unwrap_or_else(count), 3);
\n
1.58.0 · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

\n
Safety
\n

Calling this method on an Err is undefined behavior.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
\n\n
let x: Result<u32, &str> = Err("emergency failure");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
\n
1.58.0 · source

pub unsafe fn unwrap_err_unchecked(self) -> E

Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

\n
Safety
\n

Calling this method on an Ok is undefined behavior.

\n
Examples
\n
let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
\n\n
let x: Result<u32, &str> = Err("emergency failure");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure");
\n
",0,"wasmedge_types::WasmEdgeResult"],["
source§

impl<T, E> Result<&T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>where\n T: Copy,

Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>where\n T: Clone,

Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"wasmedge_types::WasmEdgeResult"],["
source§

impl<T, E> Result<&mut T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>where\n T: Copy,

Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>where\n T: Clone,

Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"wasmedge_types::WasmEdgeResult"],["
source§

impl<T, E> Result<Option<T>, E>

1.33.0 (const: unstable) · source

pub fn transpose(self) -> Option<Result<T, E>>

Transposes a Result of an Option into an Option of a Result.

\n

Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

\n
Examples
\n
#[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
\n
",0,"wasmedge_types::WasmEdgeResult"],["
source§

impl<T, E> Result<Result<T, E>, E>

source

pub fn flatten(self) -> Result<T, E>

🔬This is a nightly-only experimental API. (result_flattening)

Converts from Result<Result<T, E>, E> to Result<T, E>

\n
Examples
\n
#![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok("hello"));\nassert_eq!(Ok("hello"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
\n

Flattening only removes one level of nesting at a time:

\n\n
#![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok("hello")));\nassert_eq!(Ok(Ok("hello")), x.flatten());\nassert_eq!(Ok("hello"), x.flatten().flatten());
\n
",0,"wasmedge_types::WasmEdgeResult"],["
1.61.0 · source§

impl<T, E> Termination for Result<T, E>where\n T: Termination,\n E: Debug,

source§

fn report(self) -> ExitCode

Is called to get the representation of the value as status code.\nThis status code is returned to the operating system.
","Termination","wasmedge_types::WasmEdgeResult"],["
source§

impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>where\n F: From<E>,

source§

fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","wasmedge_types::WasmEdgeResult"],["
source§

impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>where\n F: From<E>,

source§

fn from_residual(_: Yeet<E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","wasmedge_types::WasmEdgeResult"],["
source§

impl<T, E> Try for Result<T, E>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Result<Infallible, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> StructuralEq for Result<T, E>

","StructuralEq","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Eq for Result<T, E>where\n T: Eq,\n E: Eq,

","Eq","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Ord for Result<T, E>where\n T: Ord,\n E: Ord,

source§

fn cmp(&self, other: &Result<T, E>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Result<V, E>where\n I: IntoIterator<Item = Result<A, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

\n

Here is an example which increments every integer in a vector,\nchecking for overflow:

\n\n
let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or("Overflow!")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or("Underflow!")\n).collect();\nassert_eq!(res, Err("Underflow!"));
\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

\n\n
let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or("Underflow!")\n}).collect();\nassert_eq!(res, Err("Underflow!"));\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> PartialEq for Result<T, E>where\n T: PartialEq,\n E: PartialEq,

source§

fn eq(&self, other: &Result<T, E>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Clone for Result<T, E>where\n T: Clone,\n E: Clone,

source§

fn clone(&self) -> Result<T, E>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Result<T, E>)

Performs copy-assignment from source. Read more
","Clone","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Hash for Result<T, E>where\n T: Hash,\n E: Hash,

source§

fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> IntoIterator for Result<T, E>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
Examples
\n
let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err("nothing!");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","wasmedge_types::WasmEdgeResult"],["
source§

impl<T, E> Residual<T> for Result<Infallible, E>

§

type TryType = Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2_residual)
The “return” type of this meta-function.
","Residual","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> StructuralPartialEq for Result<T, E>

","StructuralPartialEq","wasmedge_types::WasmEdgeResult"],["
1.16.0 · source§

impl<T, U, E> Sum<Result<U, E>> for Result<T, E>where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Result<T, E>where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

\n
Examples
\n

This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

\n\n
let f = |&x: &i32| if x < 0 { Err("Negative element found") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err("Negative element found"));
\n
","Sum>","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Debug for Result<T, E>where\n T: Debug,\n E: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> Copy for Result<T, E>where\n T: Copy,\n E: Copy,

","Copy","wasmedge_types::WasmEdgeResult"],["
1.0.0 · source§

impl<T, E> PartialOrd for Result<T, E>where\n T: PartialOrd,\n E: PartialOrd,

source§

fn partial_cmp(&self, other: &Result<T, E>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","wasmedge_types::WasmEdgeResult"],["
1.16.0 · source§

impl<T, U, E> Product<Result<U, E>> for Result<T, E>where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Result<T, E>where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

\n
Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

\n\n
let nums = vec!["5", "10", "1", "2"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec!["5", "10", "one", "2"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
\n
","Product>","wasmedge_types::WasmEdgeResult"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/os/raw/type.c_int.js b/type.impl/std/os/raw/type.c_int.js new file mode 100644 index 000000000..9aad6baa2 --- /dev/null +++ b/type.impl/std/os/raw/type.c_int.js @@ -0,0 +1,4 @@ +(function() {var type_impls = { +"async_wasi":[], +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/os/raw/type.c_long.js b/type.impl/std/os/raw/type.c_long.js new file mode 100644 index 000000000..9aad6baa2 --- /dev/null +++ b/type.impl/std/os/raw/type.c_long.js @@ -0,0 +1,4 @@ +(function() {var type_impls = { +"async_wasi":[], +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/os/raw/type.c_schar.js b/type.impl/std/os/raw/type.c_schar.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/std/os/raw/type.c_schar.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/os/raw/type.c_short.js b/type.impl/std/os/raw/type.c_short.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/std/os/raw/type.c_short.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/os/raw/type.c_uchar.js b/type.impl/std/os/raw/type.c_uchar.js new file mode 100644 index 000000000..9aad6baa2 --- /dev/null +++ b/type.impl/std/os/raw/type.c_uchar.js @@ -0,0 +1,4 @@ +(function() {var type_impls = { +"async_wasi":[], +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/os/raw/type.c_uint.js b/type.impl/std/os/raw/type.c_uint.js new file mode 100644 index 000000000..9aad6baa2 --- /dev/null +++ b/type.impl/std/os/raw/type.c_uint.js @@ -0,0 +1,4 @@ +(function() {var type_impls = { +"async_wasi":[], +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/os/raw/type.c_ulong.js b/type.impl/std/os/raw/type.c_ulong.js new file mode 100644 index 000000000..9aad6baa2 --- /dev/null +++ b/type.impl/std/os/raw/type.c_ulong.js @@ -0,0 +1,4 @@ +(function() {var type_impls = { +"async_wasi":[], +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/os/raw/type.c_ushort.js b/type.impl/std/os/raw/type.c_ushort.js new file mode 100644 index 000000000..9aad6baa2 --- /dev/null +++ b/type.impl/std/os/raw/type.c_ushort.js @@ -0,0 +1,4 @@ +(function() {var type_impls = { +"async_wasi":[], +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.fn.js b/type.impl/std/primitive.fn.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/std/primitive.fn.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.i128.js b/type.impl/std/primitive.i128.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/std/primitive.i128.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.i32.js b/type.impl/std/primitive.i32.js new file mode 100644 index 000000000..6d83b286c --- /dev/null +++ b/type.impl/std/primitive.i32.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"async_wasi":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.i64.js b/type.impl/std/primitive.i64.js new file mode 100644 index 000000000..6d83b286c --- /dev/null +++ b/type.impl/std/primitive.i64.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"async_wasi":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.pointer.js b/type.impl/std/primitive.pointer.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/std/primitive.pointer.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.u128.js b/type.impl/std/primitive.u128.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/std/primitive.u128.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.u16.js b/type.impl/std/primitive.u16.js new file mode 100644 index 000000000..6d83b286c --- /dev/null +++ b/type.impl/std/primitive.u16.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"async_wasi":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.u32.js b/type.impl/std/primitive.u32.js new file mode 100644 index 000000000..6d83b286c --- /dev/null +++ b/type.impl/std/primitive.u32.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"async_wasi":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.u64.js b/type.impl/std/primitive.u64.js new file mode 100644 index 000000000..6d83b286c --- /dev/null +++ b/type.impl/std/primitive.u64.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"async_wasi":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/std/primitive.u8.js b/type.impl/std/primitive.u8.js new file mode 100644 index 000000000..6d83b286c --- /dev/null +++ b/type.impl/std/primitive.u8.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"async_wasi":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sdk/struct.Instance.js b/type.impl/wasmedge_sdk/struct.Instance.js new file mode 100644 index 000000000..16f6b280d --- /dev/null +++ b/type.impl/wasmedge_sdk/struct.Instance.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sdk":[["
source§

impl Instance

source

pub fn name(&self) -> Option<String>

Returns the name of this exported module instance.

\n

If this module instance is an active instance, return None.

\n
source

pub fn func_count(&self) -> usize

Returns the count of the exported function instances in this module instance.

\n
source

pub fn func_names(&self) -> Option<Vec<String>>

Returns the names of the exported function instances in this module instance.

\n
source

pub fn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func>

Returns the exported function instance in this module instance by the given function name.

\n
Argument
\n\n
source

pub fn global_count(&self) -> usize

Returns the count of the exported global instances in this module instance.

\n
source

pub fn global_names(&self) -> Option<Vec<String>>

Returns the names of the exported global instances in this module instance.

\n
source

pub fn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>

Returns the exported global instance in this module instance by the given global name.

\n
Argument
\n\n
source

pub fn memory_count(&self) -> usize

Returns the count of the exported memory instances in this module instance.

\n
source

pub fn memory_names(&self) -> Option<Vec<String>>

Returns the names of the exported memory instances in this module instance.

\n
source

pub fn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>

Returns the exported memory instance in this module instance by the given memory name.

\n
Argument
\n\n
source

pub fn table_count(&self) -> usize

Returns the count of the exported table instances in this module instance.

\n
source

pub fn table_names(&self) -> Option<Vec<String>>

Returns the names of the exported table instances in this module instance.

\n
source

pub fn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>

Returns the exported table instance in this module instance by the given table name.

\n
Argument
\n\n
source

pub fn host_data<T: Send + Sync + Clone>(&mut self) -> Option<&mut T>

Returns the host data held by the module instance.

\n
",0,"wasmedge_sdk::plugin::PluginInstance"],["
source§

impl Clone for Instance

source§

fn clone(&self) -> Instance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","wasmedge_sdk::plugin::PluginInstance"],["
source§

impl Debug for Instance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","wasmedge_sdk::plugin::PluginInstance"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__int16_t.js b/type.impl/wasmedge_sys/ffi/type.__int16_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__int16_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__int32_t.js b/type.impl/wasmedge_sys/ffi/type.__int32_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__int32_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__int64_t.js b/type.impl/wasmedge_sys/ffi/type.__int64_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__int64_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__int8_t.js b/type.impl/wasmedge_sys/ffi/type.__int8_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__int8_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__int_least16_t.js b/type.impl/wasmedge_sys/ffi/type.__int_least16_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__int_least16_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__int_least32_t.js b/type.impl/wasmedge_sys/ffi/type.__int_least32_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__int_least32_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__int_least64_t.js b/type.impl/wasmedge_sys/ffi/type.__int_least64_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__int_least64_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__int_least8_t.js b/type.impl/wasmedge_sys/ffi/type.__int_least8_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__int_least8_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__intmax_t.js b/type.impl/wasmedge_sys/ffi/type.__intmax_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__intmax_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__off64_t.js b/type.impl/wasmedge_sys/ffi/type.__off64_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__off64_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uint16_t.js b/type.impl/wasmedge_sys/ffi/type.__uint16_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uint16_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uint32_t.js b/type.impl/wasmedge_sys/ffi/type.__uint32_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uint32_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uint64_t.js b/type.impl/wasmedge_sys/ffi/type.__uint64_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uint64_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uint8_t.js b/type.impl/wasmedge_sys/ffi/type.__uint8_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uint8_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uint_least16_t.js b/type.impl/wasmedge_sys/ffi/type.__uint_least16_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uint_least16_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uint_least32_t.js b/type.impl/wasmedge_sys/ffi/type.__uint_least32_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uint_least32_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uint_least64_t.js b/type.impl/wasmedge_sys/ffi/type.__uint_least64_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uint_least64_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uint_least8_t.js b/type.impl/wasmedge_sys/ffi/type.__uint_least8_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uint_least8_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/ffi/type.__uintmax_t.js b/type.impl/wasmedge_sys/ffi/type.__uintmax_t.js new file mode 100644 index 000000000..b42111463 --- /dev/null +++ b/type.impl/wasmedge_sys/ffi/type.__uintmax_t.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sys":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/plugin/enum.ProgramOptionType.js b/type.impl/wasmedge_sys/plugin/enum.ProgramOptionType.js new file mode 100644 index 000000000..7143d4848 --- /dev/null +++ b/type.impl/wasmedge_sys/plugin/enum.ProgramOptionType.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sdk":[["
§

impl Debug for ProgramOptionType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","wasmedge_sdk::plugin::ProgramOptionType"],["
§

impl StructuralEq for ProgramOptionType

","StructuralEq","wasmedge_sdk::plugin::ProgramOptionType"],["
§

impl Clone for ProgramOptionType

§

fn clone(&self) -> ProgramOptionType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","wasmedge_sdk::plugin::ProgramOptionType"],["
§

impl Eq for ProgramOptionType

","Eq","wasmedge_sdk::plugin::ProgramOptionType"],["
§

impl StructuralPartialEq for ProgramOptionType

","StructuralPartialEq","wasmedge_sdk::plugin::ProgramOptionType"],["
§

impl Copy for ProgramOptionType

","Copy","wasmedge_sdk::plugin::ProgramOptionType"],["
§

impl From<u32> for ProgramOptionType

§

fn from(ty: u32) -> ProgramOptionType

Converts to this type from the input type.
","From","wasmedge_sdk::plugin::ProgramOptionType"],["
§

impl PartialEq for ProgramOptionType

§

fn eq(&self, other: &ProgramOptionType) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","wasmedge_sdk::plugin::ProgramOptionType"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/plugin/type.ModuleInstanceCreateFn.js b/type.impl/wasmedge_sys/plugin/type.ModuleInstanceCreateFn.js new file mode 100644 index 000000000..b6719214b --- /dev/null +++ b/type.impl/wasmedge_sys/plugin/type.ModuleInstanceCreateFn.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sdk":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_sys/types/struct.WasmValue.js b/type.impl/wasmedge_sys/types/struct.WasmValue.js new file mode 100644 index 000000000..618b126a2 --- /dev/null +++ b/type.impl/wasmedge_sys/types/struct.WasmValue.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sdk":[["
§

impl WasmValue

pub fn as_raw(&self) -> WasmEdge_Value

Returns the raw WasmEdge_Value.

\n

pub fn ty(&self) -> ValType

Returns the type of a [WasmValue].

\n

pub fn from_i32(val: i32) -> WasmValue

Creates a [WasmValue] from a i32 value.

\n
Argument
\n
    \n
  • val - The source i32 value.
  • \n
\n

pub fn to_i32(&self) -> i32

Generates a i32 value from a [WasmValue].

\n

pub fn from_i64(val: i64) -> WasmValue

Creates a [WasmValue] from a i64 value.

\n
Argument
\n
    \n
  • val - The source i64 value.
  • \n
\n

pub fn to_i64(&self) -> i64

Generates a i64 value from a [WasmValue].

\n

pub fn from_f32(val: f32) -> WasmValue

Creates a [WasmValue] from a f32 value.

\n
Argument
\n
    \n
  • val - The source f32 value.
  • \n
\n

pub fn to_f32(&self) -> f32

Generates a f32 value from a [WasmValue].

\n

pub fn from_f64(val: f64) -> WasmValue

Creates a [WasmValue] from a f64 value.

\n
Argument
\n
    \n
  • val - The source f64 value.
  • \n
\n

pub fn to_f64(&self) -> f64

Generates a f64 value from a [WasmValue].

\n

pub fn from_v128(val: i128) -> WasmValue

Creates a [WasmValue] from a i128 value.

\n
Argument
\n
    \n
  • val - The source i128 value.
  • \n
\n

pub fn to_v128(&self) -> i128

Generates a v128 value from a [WasmValue].

\n

pub fn from_null_ref(ref_ty: RefType) -> WasmValue

Creates a [WasmValue] from a RefType value.

\n
Argument
\n
    \n
  • val - The [RefType`] value.
  • \n
\n

pub fn is_null_ref(&self) -> bool

Checks if a [WasmValue] is NullRef or not.

\n

pub fn from_func_ref(func_ref: FuncRef) -> WasmValue

Creates a [WasmValue] from a FuncRef.

\n

Notice that the [WasmValue]s generated from FuncRefs are only meaningful when the bulk_memory_operations or reference_types option is enabled in the Config.

\n
Argument
\n
    \n
  • func_ref - A [FuncRef] instance.
  • \n
\n

pub fn func_ref(&self) -> Option<FuncRef>

Returns the FuncRef(crate::FuncRef).

\n

If the [WasmValue] is a NullRef, then None is returned.

\n

pub fn from_extern_ref<T>(extern_obj: &mut T) -> WasmValue

Creates a [WasmValue] from a reference to an external object.

\n

The [WasmValue]s generated by this function are only meaningful when the reference_types option is enabled in\nthe Config.

\n
Argument
\n
    \n
  • extern_obj - The reference to an external object.
  • \n
\n

pub fn extern_ref<T>(&self) -> Option<&T>

Returns the reference to an external object.

\n

If the [WasmValue] is a NullRef, then None is returned.

\n
",0,"wasmedge_sdk::WasmValue"],["
§

impl Debug for WasmValue

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","wasmedge_sdk::WasmValue"],["
§

impl Clone for WasmValue

§

fn clone(&self) -> WasmValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","wasmedge_sdk::WasmValue"],["
§

impl Copy for WasmValue

","Copy","wasmedge_sdk::WasmValue"],["
§

impl From<WasmEdge_Value> for WasmValue

§

fn from(raw_val: WasmEdge_Value) -> WasmValue

Converts to this type from the input type.
","From","wasmedge_sdk::WasmValue"],["
source§

impl From<Val> for WasmValue

source§

fn from(val: Val) -> Self

Converts to this type from the input type.
","From","wasmedge_sdk::WasmValue"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/wasmedge_types/enum.NeverType.js b/type.impl/wasmedge_types/enum.NeverType.js new file mode 100644 index 000000000..82b9e6e42 --- /dev/null +++ b/type.impl/wasmedge_types/enum.NeverType.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"wasmedge_sdk":[["
§

impl Sync for NeverType

","Sync","wasmedge_sdk::NeverType"],["
§

impl Debug for NeverType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","wasmedge_sdk::NeverType"],["
§

impl Clone for NeverType

§

fn clone(&self) -> NeverType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","wasmedge_sdk::NeverType"],["
§

impl Send for NeverType

","Send","wasmedge_sdk::NeverType"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/wasmedge_macro/all.html b/wasmedge_macro/all.html new file mode 100644 index 000000000..7f0b89a9c --- /dev/null +++ b/wasmedge_macro/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Attribute Macros

\ No newline at end of file diff --git a/wasmedge_macro/attr.async_host_function.html b/wasmedge_macro/attr.async_host_function.html new file mode 100644 index 000000000..c1f9783ad --- /dev/null +++ b/wasmedge_macro/attr.async_host_function.html @@ -0,0 +1,2 @@ +async_host_function in wasmedge_macro - Rust

Attribute Macro wasmedge_macro::async_host_function

source ·
#[async_host_function]
Expand description

Declare a native async function that will be used to create an async host function instance.

+
\ No newline at end of file diff --git a/wasmedge_macro/attr.host_function.html b/wasmedge_macro/attr.host_function.html new file mode 100644 index 000000000..cd023aec9 --- /dev/null +++ b/wasmedge_macro/attr.host_function.html @@ -0,0 +1,2 @@ +host_function in wasmedge_macro - Rust

Attribute Macro wasmedge_macro::host_function

source ·
#[host_function]
Expand description

Declare a native function that will be used to create a host function instance.

+
\ No newline at end of file diff --git a/wasmedge_macro/index.html b/wasmedge_macro/index.html new file mode 100644 index 000000000..8d3ac52c7 --- /dev/null +++ b/wasmedge_macro/index.html @@ -0,0 +1,4 @@ +wasmedge_macro - Rust

Crate wasmedge_macro

source ·
Expand description

Overview

+

The wasmedge-macro crate defines a group of procedural macros used by both wasmedge-sdk and wasmedge-sys crates.

+

Attribute Macros

  • Declare a native async function that will be used to create an async host function instance.
  • Declare a native function that will be used to create a host function instance.
\ No newline at end of file diff --git a/wasmedge_macro/sidebar-items.js b/wasmedge_macro/sidebar-items.js new file mode 100644 index 000000000..88eec8d55 --- /dev/null +++ b/wasmedge_macro/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"attr":["async_host_function","host_function"]}; \ No newline at end of file diff --git a/wasmedge_sdk/all.html b/wasmedge_sdk/all.html new file mode 100644 index 000000000..4616fd01b --- /dev/null +++ b/wasmedge_sdk/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Attribute Macros

Functions

Type Aliases

\ No newline at end of file diff --git a/wasmedge_sdk/attr.host_function.html b/wasmedge_sdk/attr.host_function.html new file mode 100644 index 000000000..ba2af99b9 --- /dev/null +++ b/wasmedge_sdk/attr.host_function.html @@ -0,0 +1,2 @@ +host_function in wasmedge_sdk - Rust

Attribute Macro wasmedge_sdk::host_function

source ·
#[host_function]
Expand description

Declare a native function that will be used to create a host function instance.

+
\ No newline at end of file diff --git a/wasmedge_sdk/caller/struct.Caller.html b/wasmedge_sdk/caller/struct.Caller.html new file mode 100644 index 000000000..4bda69e4a --- /dev/null +++ b/wasmedge_sdk/caller/struct.Caller.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.Caller.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/compiler/struct.Compiler.html b/wasmedge_sdk/compiler/struct.Compiler.html new file mode 100644 index 000000000..a5757dc6a --- /dev/null +++ b/wasmedge_sdk/compiler/struct.Compiler.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.Compiler.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/config/index.html b/wasmedge_sdk/config/index.html new file mode 100644 index 000000000..61f369d5a --- /dev/null +++ b/wasmedge_sdk/config/index.html @@ -0,0 +1,2 @@ +wasmedge_sdk::config - Rust

Module wasmedge_sdk::config

source ·
Expand description

Defines the structs used to construct configurations.

+

Structs

\ No newline at end of file diff --git a/wasmedge_sdk/config/sidebar-items.js b/wasmedge_sdk/config/sidebar-items.js new file mode 100644 index 000000000..29784b70f --- /dev/null +++ b/wasmedge_sdk/config/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["CommonConfigOptions","CompilerConfigOptions","Config","ConfigBuilder","HostRegistrationConfigOptions","RuntimeConfigOptions","StatisticsConfigOptions"]}; \ No newline at end of file diff --git a/wasmedge_sdk/config/struct.CommonConfigOptions.html b/wasmedge_sdk/config/struct.CommonConfigOptions.html new file mode 100644 index 000000000..81370f80e --- /dev/null +++ b/wasmedge_sdk/config/struct.CommonConfigOptions.html @@ -0,0 +1,137 @@ +CommonConfigOptions in wasmedge_sdk::config - Rust
pub struct CommonConfigOptions { /* private fields */ }
Expand description

Defines the common configuration options.

+

CommonConfigOptions is used to set the common configuration options, which are

+ +

Implementations§

source§

impl CommonConfigOptions

source

pub fn new() -> Self

Creates a new instance of CommonConfigOptions.

+

The default options are:

+
    +
  • mutable_globals: true,
  • +
  • non_trap_conversions: true,
  • +
  • sign_extension_operators: true,
  • +
  • multi_value: true,
  • +
  • bulk_memory_operations: true,
  • +
  • reference_types: true,
  • +
  • simd: true,
  • +
  • multi_memories: false,
  • +
  • threads: false,
  • +
  • tail_call: false,
  • +
  • function_references: false,
  • +
  • interpreter_mode: false,
  • +
+
source

pub fn mutable_globals(self, enable: bool) -> Self

Enables or disables the ImportExportMutGlobals option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn non_trap_conversions(self, enable: bool) -> Self

Enables or disables the NonTrapFloatToIntConversions option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn sign_extension_operators(self, enable: bool) -> Self

Enables or disables the SignExtensionOperators option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn multi_value(self, enable: bool) -> Self

Enables or disables the MultiValue option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn bulk_memory_operations(self, enable: bool) -> Self

Enables or disables the BulkMemoryOperations option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn reference_types(self, enable: bool) -> Self

Enables or disables the ReferenceTypes option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn simd(self, enable: bool) -> Self

Enables or disables the SIMD option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn multi_memories(self, enable: bool) -> Self

Enables or disables the MultiMemories option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn threads(self, enable: bool) -> Self

Enables or disables the Threads option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn tail_call(self, enable: bool) -> Self

Enables or disables the TailCall option.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+
source

pub fn function_references(self, enable: bool) -> Self

Enables or disables the FunctionReferences option.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn interpreter_mode(self, enable: bool) -> Self

Enables or disables the ForceInterpreter option.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+

Trait Implementations§

source§

impl Clone for CommonConfigOptions

source§

fn clone(&self) -> CommonConfigOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CommonConfigOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CommonConfigOptions

source§

fn default() -> Self

Creates a new default instance of CommonConfigOptions.

+

The default options are:

+
    +
  • mutable_globals: true,
  • +
  • non_trap_conversions: true,
  • +
  • sign_extension_operators: true,
  • +
  • multi_value: true,
  • +
  • bulk_memory_operations: true,
  • +
  • reference_types: true,
  • +
  • simd: true,
  • +
  • multi_memories: false,
  • +
  • threads: false,
  • +
  • tail_call: false,
  • +
  • function_references: false,
  • +
  • interpreter_mode: false,
  • +
+
source§

impl Copy for CommonConfigOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/config/struct.CompilerConfigOptions.html b/wasmedge_sdk/config/struct.CompilerConfigOptions.html new file mode 100644 index 000000000..fc1fc84fd --- /dev/null +++ b/wasmedge_sdk/config/struct.CompilerConfigOptions.html @@ -0,0 +1,86 @@ +CompilerConfigOptions in wasmedge_sdk::config - Rust
pub struct CompilerConfigOptions { /* private fields */ }
Available on crate feature aot only.
Expand description

Defines a group of configuration options for AOT compiler.

+

CompilerConfigOptions is used to set the AOT compiler related configuration options, which are

+
    +
  • +

    Compiler Optimization Levels

    +
      +
    • +

      O0 performs as many optimizations as possible.

      +
    • +
    • +

      O1 optimizes quickly without destroying debuggability

      +
    • +
    • +

      02 optimizes for fast execution as much as possible without triggering significant incremental +compile time or code size growth

      +
    • +
    • +

      O3 optimizes for fast execution as much as possible

      +
    • +
    • +

      Os optimizes for small code size as much as possible without triggering significant incremental +compile time or execution time slowdowns

      +
    • +
    • +

      Oz optimizes for small code size as much as possible

      +
    • +
    +
  • +
  • +

    Compiler Output Formats

    +
      +
    • Native specifies the output format is native dynamic library (*.wasm.so)
    • +
    • Wasm specifies the output format is WebAssembly with AOT compiled codes in custom section (*.wasm).
    • +
    +
  • +
  • +

    dump_ir determines if AOT compiler generates IR or not

    +
  • +
  • +

    generic_binary determines if AOT compiler generates the generic binary or not.

    +
  • +
  • +

    interruptible determines if AOT compiler generates interruptible binary or not.

    +
  • +
+

The configuration options above are only effective to AOT compiler.

+

Implementations§

source§

impl CompilerConfigOptions

source

pub fn new() -> Self

Creates a new instance of CompilerConfigOptions.

+
source

pub fn out_format(self, format: CompilerOutputFormat) -> Self

Sets the output binary format of AOT compiler.

+
Argument
+
    +
  • format specifies the format of the output binary.
  • +
+
source

pub fn optimization_level(self, level: CompilerOptimizationLevel) -> Self

Sets the optimization level of AOT compiler.

+
Argument
+
    +
  • level specifies the optimization level of AOT compiler.
  • +
+
source

pub fn dump_ir(self, enable: bool) -> Self

Sets the dump IR option of AOT compiler.

+
Argument
+
    +
  • enable specifies if dump ir or not.
  • +
+
source

pub fn generic_binary(self, enable: bool) -> Self

Sets the generic binary option of AOT compiler.

+
Argument
+
    +
  • enable specifies if generate the generic binary or not when perform AOT compilation.
  • +
+
source

pub fn interruptible(self, enable: bool) -> Self

Enables or Disables the Interruptible option of AOT compiler.

+

This option determines to generate interruptible binary or not when compilation in AOT compiler.

+
Argument
+
    +
  • enable specifies if turn on the Interruptible option.
  • +
+

Trait Implementations§

source§

impl Clone for CompilerConfigOptions

source§

fn clone(&self) -> CompilerConfigOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CompilerConfigOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CompilerConfigOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for CompilerConfigOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/config/struct.Config.html b/wasmedge_sdk/config/struct.Config.html new file mode 100644 index 000000000..651f7e961 --- /dev/null +++ b/wasmedge_sdk/config/struct.Config.html @@ -0,0 +1,69 @@ +Config in wasmedge_sdk::config - Rust

Struct wasmedge_sdk::config::Config

source ·
pub struct Config { /* private fields */ }
Expand description

Defines Config struct used to check/set the configuration options.

+

Example

+

The following code shows how to create a Config with ConfigBuilder.

+ +

+use wasmedge_sdk::{config::{Config, ConfigBuilder, CommonConfigOptions, StatisticsConfigOptions, RuntimeConfigOptions, HostRegistrationConfigOptions}};
+use wasmedge_types::{CompilerOutputFormat, CompilerOptimizationLevel};
+
+let common_options = CommonConfigOptions::default()
+    .bulk_memory_operations(true)
+    .multi_value(true)
+    .mutable_globals(true)
+    .non_trap_conversions(true)
+    .reference_types(true)
+    .sign_extension_operators(true)
+    .simd(true);
+
+let stat_options = StatisticsConfigOptions::default()
+    .count_instructions(true)
+    .measure_cost(true)
+    .measure_time(true);
+
+let runtime_options = RuntimeConfigOptions::default().max_memory_pages(1024);
+
+let host_options = HostRegistrationConfigOptions::default()
+    .wasi(true);
+
+let result = ConfigBuilder::new(common_options)
+    .with_statistics_config(stat_options)
+    .with_runtime_config(runtime_options)
+    .with_host_registration_config(host_options)
+    .build();
+assert!(result.is_ok());
+let config = result.unwrap();
+

Implementations§

source§

impl Config

source

pub fn wasi_enabled(&self) -> bool

Checks if the host registration wasi option turns on or not.

+
source

pub fn max_memory_pages(&self) -> u32

Returns the number of the memory pages available.

+
source

pub fn mutable_globals_enabled(&self) -> bool

Checks if the ImportExportMutGlobals option turns on or not.

+
source

pub fn non_trap_conversions_enabled(&self) -> bool

Checks if the NonTrapFloatToIntConversions option turns on or not.

+
source

pub fn sign_extension_operators_enabled(&self) -> bool

Checks if the SignExtensionOperators option turns on or not.

+
source

pub fn multi_value_enabled(&self) -> bool

Checks if the MultiValue option turns on or not.

+
source

pub fn bulk_memory_operations_enabled(&self) -> bool

Checks if the BulkMemoryOperations option turns on or not.

+
source

pub fn reference_types_enabled(&self) -> bool

Checks if the ReferenceTypes option turns on or not.

+
source

pub fn simd_enabled(&self) -> bool

Checks if the SIMD option turns on or not.

+
source

pub fn multi_memories_enabled(&self) -> bool

Checks if the MultiMemories option turns on or not.

+
source

pub fn threads_enabled(&self) -> bool

Checks if the Threads option turns on or not.

+
source

pub fn tail_call_enabled(&self) -> bool

Checks if the TailCall option turns on or not.

+
source

pub fn function_references_enabled(&self) -> bool

Checks if the FunctionReferences option turns on or not.

+
source

pub fn interpreter_mode_enabled(&self) -> bool

Checks if the ForceInterpreter option turns on or not.

+
source

pub fn optimization_level(&self) -> CompilerOptimizationLevel

Available on crate feature aot only.

Returns the optimization level of AOT compiler.

+
source

pub fn out_format(&self) -> CompilerOutputFormat

Available on crate feature aot only.

Returns the output binary format of AOT compiler.

+
source

pub fn dump_ir_enabled(&self) -> bool

Available on crate feature aot only.

Checks if the dump IR option turns on or not.

+
source

pub fn generic_binary_enabled(&self) -> bool

Available on crate feature aot only.

Checks if the generic binary option of AOT compiler turns on or not.

+
source

pub fn interruptible_enabled(&self) -> bool

Available on crate feature aot only.

Checks if the Interruptible option of AOT Compiler turns on or not.

+
source

pub fn instruction_counting_enabled(&self) -> bool

Checks if the instruction counting option turns on or not.

+
source

pub fn cost_measuring_enabled(&self) -> bool

Checks if the cost measuring option turns on or not.

+
source

pub fn time_measuring_enabled(&self) -> bool

Checks if the cost measuring option turns on or not.

+

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/config/struct.ConfigBuilder.html b/wasmedge_sdk/config/struct.ConfigBuilder.html new file mode 100644 index 000000000..f4a7120b1 --- /dev/null +++ b/wasmedge_sdk/config/struct.ConfigBuilder.html @@ -0,0 +1,40 @@ +ConfigBuilder in wasmedge_sdk::config - Rust
pub struct ConfigBuilder { /* private fields */ }
Expand description

Defines a builder for creating a Config.

+

Implementations§

source§

impl ConfigBuilder

source

pub fn new(options: CommonConfigOptions) -> Self

Creates a new ConfigBuilder with the given CommonConfigOptions setting.

+
source

pub fn with_statistics_config(self, options: StatisticsConfigOptions) -> Self

Sets the StatisticsConfigOptions for the ConfigBuilder.

+
Argument
+ +
source

pub fn with_runtime_config(self, options: RuntimeConfigOptions) -> Self

Sets the RuntimeConfigOptions for the ConfigBuilder.

+
Argument
+ +
source

pub fn with_compiler_config(self, options: CompilerConfigOptions) -> Self

Available on crate feature aot only.

Sets the CompilerConfigOptions for the ConfigBuilder.

+
Argument
+ +
source

pub fn with_host_registration_config( + self, + options: HostRegistrationConfigOptions +) -> Self

Sets the HostRegistrationConfigOptions for the ConfigBuilder.

+
Argument
+ +
source

pub fn build(self) -> WasmEdgeResult<Config>

Creates a new Config from the ConfigBuilder.

+
Errors
+

If fail to create a Config, then an error is returned.

+

Trait Implementations§

source§

impl Debug for ConfigBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ConfigBuilder

source§

fn default() -> ConfigBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/config/struct.HostRegistrationConfigOptions.html b/wasmedge_sdk/config/struct.HostRegistrationConfigOptions.html new file mode 100644 index 000000000..1e218dda5 --- /dev/null +++ b/wasmedge_sdk/config/struct.HostRegistrationConfigOptions.html @@ -0,0 +1,24 @@ +HostRegistrationConfigOptions in wasmedge_sdk::config - Rust
pub struct HostRegistrationConfigOptions { /* private fields */ }
Expand description

Defines the host registration configuration options.

+

HostRegistrationConfigOptions is used to set the host registration configuration options, which are

+
    +
  • Wasi turns on the WASI support.
  • +
+

Implementations§

source§

impl HostRegistrationConfigOptions

source

pub fn new() -> Self

Creates a new instance of HostRegistrationConfigOptions.

+
source

pub fn wasi(self, enable: bool) -> Self

Enables or disables host registration wasi.

+
Argument
+
    +
  • enable specifies if the option turns on or not.
  • +
+

Trait Implementations§

source§

impl Clone for HostRegistrationConfigOptions

source§

fn clone(&self) -> HostRegistrationConfigOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HostRegistrationConfigOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for HostRegistrationConfigOptions

source§

fn default() -> HostRegistrationConfigOptions

Returns the “default value” for a type. Read more
source§

impl Copy for HostRegistrationConfigOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/config/struct.RuntimeConfigOptions.html b/wasmedge_sdk/config/struct.RuntimeConfigOptions.html new file mode 100644 index 000000000..39a59fbe5 --- /dev/null +++ b/wasmedge_sdk/config/struct.RuntimeConfigOptions.html @@ -0,0 +1,25 @@ +RuntimeConfigOptions in wasmedge_sdk::config - Rust
pub struct RuntimeConfigOptions { /* private fields */ }
Expand description

Defines a group of runtime configuration options.

+

RuntimeConfigOptions is used to set the runtime configuration options, which are

+
    +
  • maximum_memory_page limits the page size of Memory. This option is only effective to +Executor.
  • +
+

Implementations§

source§

impl RuntimeConfigOptions

source

pub fn new() -> Self

Creates a new instance of RuntimeConfigOptions.

+
source

pub fn max_memory_pages(self, count: u32) -> Self

Sets the maximum number of the memory pages available.

+
Argument
+
    +
  • count specifies the page count (64KB per page).
  • +
+

Trait Implementations§

source§

impl Clone for RuntimeConfigOptions

source§

fn clone(&self) -> RuntimeConfigOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeConfigOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RuntimeConfigOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for RuntimeConfigOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/config/struct.StatisticsConfigOptions.html b/wasmedge_sdk/config/struct.StatisticsConfigOptions.html new file mode 100644 index 000000000..faf5a840d --- /dev/null +++ b/wasmedge_sdk/config/struct.StatisticsConfigOptions.html @@ -0,0 +1,42 @@ +StatisticsConfigOptions in wasmedge_sdk::config - Rust
pub struct StatisticsConfigOptions { /* private fields */ }
Expand description

Defines a group of the statistics configuration options.

+

StatisticsConfigOptions is used to set the statistics configuration options, which are

+
    +
  • +

    count_instructions determines if measuring the count of instructions when running a compiled or pure WASM.

    +
  • +
  • +

    measure_cost determines if measuring the instruction costs when running a compiled or pure WASM.

    +
  • +
  • +

    measure_time determines if measuring the running time when running a compiled or pure WASM.

    +
  • +
+

Implementations§

source§

impl StatisticsConfigOptions

source

pub fn new() -> Self

Creates a new instance of StatisticsConfigOptions.

+
source

pub fn count_instructions(self, enable: bool) -> Self

Sets the instruction counting option.

+
Argument
+
    +
  • enable specifies if support instruction counting or not when execution after AOT compilation.
  • +
+
source

pub fn measure_cost(self, enable: bool) -> Self

Sets the cost measuring option.

+
Argument
+
    +
  • enable specifies if support cost measuring or not when execution after AOT compilation.
  • +
+
source

pub fn measure_time(self, enable: bool) -> Self

Sets the time measuring option.

+
Argument
+
    +
  • enable specifies if support time measuring or not when execution after AOT compilation.
  • +
+

Trait Implementations§

source§

impl Clone for StatisticsConfigOptions

source§

fn clone(&self) -> StatisticsConfigOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StatisticsConfigOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for StatisticsConfigOptions

source§

fn default() -> StatisticsConfigOptions

Returns the “default value” for a type. Read more
source§

impl Copy for StatisticsConfigOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/dock/enum.Param.html b/wasmedge_sdk/dock/enum.Param.html new file mode 100644 index 000000000..9e9a0720a --- /dev/null +++ b/wasmedge_sdk/dock/enum.Param.html @@ -0,0 +1,34 @@ +Param in wasmedge_sdk::dock - Rust

Enum wasmedge_sdk::dock::Param

source ·
pub enum Param<'a> {
+
Show 20 variants I8(i8), + U8(u8), + I16(i16), + U16(u16), + I32(i32), + U32(u32), + I64(i64), + U64(u64), + F32(f32), + F64(f64), + Bool(bool), + VecI8(&'a Vec<i8>), + VecU8(&'a Vec<u8>), + VecI16(&'a Vec<i16>), + VecU16(&'a Vec<u16>), + VecI32(&'a Vec<i32>), + VecU32(&'a Vec<u32>), + VecI64(&'a Vec<i64>), + VecU64(&'a Vec<u64>), + String(&'a str), +
}
Expand description

Defines a type container that wraps a value of Rust built-in type.

+

Variants§

§

I8(i8)

§

U8(u8)

§

I16(i16)

§

U16(u16)

§

I32(i32)

§

U32(u32)

§

I64(i64)

§

U64(u64)

§

F32(f32)

§

F64(f64)

§

Bool(bool)

§

VecI8(&'a Vec<i8>)

§

VecU8(&'a Vec<u8>)

§

VecI16(&'a Vec<i16>)

§

VecU16(&'a Vec<u16>)

§

VecI32(&'a Vec<i32>)

§

VecU32(&'a Vec<u32>)

§

VecI64(&'a Vec<i64>)

§

VecU64(&'a Vec<u64>)

§

String(&'a str)

Trait Implementations§

source§

impl<'a> Debug for Param<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Param<'a>

§

impl<'a> Send for Param<'a>

§

impl<'a> Sync for Param<'a>

§

impl<'a> Unpin for Param<'a>

§

impl<'a> UnwindSafe for Param<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/dock/index.html b/wasmedge_sdk/dock/index.html new file mode 100644 index 000000000..465ab52be --- /dev/null +++ b/wasmedge_sdk/dock/index.html @@ -0,0 +1,2 @@ +wasmedge_sdk::dock - Rust

Module wasmedge_sdk::dock

source ·
Expand description

Defines WasmEdge VmDock and Param types.

+

Structs

  • Extends a Vm instance by supporting function arguments of Rust built-in types.

Enums

  • Defines a type container that wraps a value of Rust built-in type.
\ No newline at end of file diff --git a/wasmedge_sdk/dock/sidebar-items.js b/wasmedge_sdk/dock/sidebar-items.js new file mode 100644 index 000000000..a71803f7f --- /dev/null +++ b/wasmedge_sdk/dock/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Param"],"struct":["VmDock"]}; \ No newline at end of file diff --git a/wasmedge_sdk/dock/struct.VmDock.html b/wasmedge_sdk/dock/struct.VmDock.html new file mode 100644 index 000000000..d00417ab0 --- /dev/null +++ b/wasmedge_sdk/dock/struct.VmDock.html @@ -0,0 +1,34 @@ +VmDock in wasmedge_sdk::dock - Rust

Struct wasmedge_sdk::dock::VmDock

source ·
pub struct VmDock { /* private fields */ }
Expand description

Extends a Vm instance by supporting function arguments of Rust built-in types.

+

Implementations§

source§

impl VmDock

source

pub fn new(vm: Vm) -> Self

Creates a new VmDock to be associated with the given Vm.

+
Arguments
+
    +
  • vm - The Vm instance to be extended.
  • +
+
source

pub fn run_func( + &self, + func_name: impl AsRef<str>, + params: Vec<Param<'_>> +) -> WasmEdgeResult<Result<Vec<Box<dyn Any + Send + Sync>>, String>>

Runs an exported WASM function registered in a named or active module.

+
Arguments
+
    +
  • +

    func_name - The name of the exported WASM function to run.

    +
  • +
  • +

    params - The parameter values passed to the exported WASM function.

    +
  • +
+
Error
+

If fail to run the WASM function, then an error is returned.

+

Trait Implementations§

source§

impl Debug for VmDock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Send for VmDock

source§

impl Sync for VmDock

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/enum.CompilerOptimizationLevel.html b/wasmedge_sdk/enum.CompilerOptimizationLevel.html new file mode 100644 index 000000000..340e0c8d6 --- /dev/null +++ b/wasmedge_sdk/enum.CompilerOptimizationLevel.html @@ -0,0 +1,30 @@ +CompilerOptimizationLevel in wasmedge_sdk - Rust
pub enum CompilerOptimizationLevel {
+    O0,
+    O1,
+    O2,
+    O3,
+    Os,
+    Oz,
+}
Expand description

Defines WasmEdge AOT compiler optimization level.

+

Variants§

§

O0

Disable as many optimizations as possible.

+
§

O1

Optimize quickly without destroying debuggability.

+
§

O2

Optimize for fast execution as much as possible without triggering significant incremental compile time or code size growth.

+
§

O3

Optimize for fast execution as much as possible.

+
§

Os

Optimize for small code size as much as possible without triggering +significant incremental compile time or execution time slowdowns.

+
§

Oz

Optimize for small code size as much as possible.

+

Trait Implementations§

§

impl Clone for CompilerOptimizationLevel

§

fn clone(&self) -> CompilerOptimizationLevel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CompilerOptimizationLevel

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<i32> for CompilerOptimizationLevel

§

fn from(val: i32) -> CompilerOptimizationLevel

Converts to this type from the input type.
§

impl From<u32> for CompilerOptimizationLevel

§

fn from(val: u32) -> CompilerOptimizationLevel

Converts to this type from the input type.
§

impl PartialEq for CompilerOptimizationLevel

§

fn eq(&self, other: &CompilerOptimizationLevel) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Copy for CompilerOptimizationLevel

§

impl Eq for CompilerOptimizationLevel

§

impl StructuralEq for CompilerOptimizationLevel

§

impl StructuralPartialEq for CompilerOptimizationLevel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/enum.CompilerOutputFormat.html b/wasmedge_sdk/enum.CompilerOutputFormat.html new file mode 100644 index 000000000..441cce9f0 --- /dev/null +++ b/wasmedge_sdk/enum.CompilerOutputFormat.html @@ -0,0 +1,21 @@ +CompilerOutputFormat in wasmedge_sdk - Rust
pub enum CompilerOutputFormat {
+    Native,
+    Wasm,
+}
Expand description

Defines WasmEdge AOT compiler output binary format.

+

Variants§

§

Native

Native dynamic library format.

+
§

Wasm

WebAssembly with AOT compiled codes in custom sections.

+

Trait Implementations§

§

impl Clone for CompilerOutputFormat

§

fn clone(&self) -> CompilerOutputFormat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CompilerOutputFormat

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<i32> for CompilerOutputFormat

§

fn from(val: i32) -> CompilerOutputFormat

Converts to this type from the input type.
§

impl From<u32> for CompilerOutputFormat

§

fn from(val: u32) -> CompilerOutputFormat

Converts to this type from the input type.
§

impl PartialEq for CompilerOutputFormat

§

fn eq(&self, other: &CompilerOutputFormat) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Copy for CompilerOutputFormat

§

impl Eq for CompilerOutputFormat

§

impl StructuralEq for CompilerOutputFormat

§

impl StructuralPartialEq for CompilerOutputFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/enum.ExternalInstanceType.html b/wasmedge_sdk/enum.ExternalInstanceType.html new file mode 100644 index 000000000..2475575fd --- /dev/null +++ b/wasmedge_sdk/enum.ExternalInstanceType.html @@ -0,0 +1,26 @@ +ExternalInstanceType in wasmedge_sdk - Rust
pub enum ExternalInstanceType {
+    Func(FuncType),
+    Table(TableType),
+    Memory(MemoryType),
+    Global(GlobalType),
+}
Expand description

Defines the type of external WasmEdge instances.

+

Variants§

§

Func(FuncType)

A WasmEdge instance that is a WasmEdge Func.

+
§

Table(TableType)

A WasmEdge instance that is a WasmEdge Table.

+
§

Memory(MemoryType)

A WasmEdge instance that is a WasmEdge Memory.

+
§

Global(GlobalType)

A WasmEdge instance that is a WasmEdge Global.

+

Trait Implementations§

§

impl Clone for ExternalInstanceType

§

fn clone(&self) -> ExternalInstanceType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ExternalInstanceType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for ExternalInstanceType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<i32> for ExternalInstanceType

§

fn from(value: i32) -> ExternalInstanceType

Converts to this type from the input type.
§

impl From<u32> for ExternalInstanceType

§

fn from(value: u32) -> ExternalInstanceType

Converts to this type from the input type.
§

impl PartialEq for ExternalInstanceType

§

fn eq(&self, other: &ExternalInstanceType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for ExternalInstanceType

§

impl StructuralEq for ExternalInstanceType

§

impl StructuralPartialEq for ExternalInstanceType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/enum.HostRegistration.html b/wasmedge_sdk/enum.HostRegistration.html new file mode 100644 index 000000000..3fdfb6204 --- /dev/null +++ b/wasmedge_sdk/enum.HostRegistration.html @@ -0,0 +1,28 @@ +HostRegistration in wasmedge_sdk - Rust
pub enum HostRegistration {
+    Wasi,
+    WasmEdgeProcess,
+    WasiNn,
+    WasiCryptoCommon,
+    WasiCryptoAsymmetricCommon,
+    WasiCryptoKx,
+    WasiCryptoSignatures,
+    WasiCryptoSymmetric,
+}
Expand description

Defines WasmEdge host module registration enum.

+

Variants§

§

Wasi

§

WasmEdgeProcess

§

WasiNn

§

WasiCryptoCommon

§

WasiCryptoAsymmetricCommon

§

WasiCryptoKx

§

WasiCryptoSignatures

§

WasiCryptoSymmetric

Trait Implementations§

§

impl Clone for HostRegistration

§

fn clone(&self) -> HostRegistration

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for HostRegistration

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<u32> for HostRegistration

§

fn from(val: u32) -> HostRegistration

Converts to this type from the input type.
§

impl Hash for HostRegistration

§

fn hash<__H>(&self, state: &mut __H)where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq for HostRegistration

§

fn eq(&self, other: &HostRegistration) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Copy for HostRegistration

§

impl Eq for HostRegistration

§

impl StructuralEq for HostRegistration

§

impl StructuralPartialEq for HostRegistration

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/enum.Mutability.html b/wasmedge_sdk/enum.Mutability.html new file mode 100644 index 000000000..334689648 --- /dev/null +++ b/wasmedge_sdk/enum.Mutability.html @@ -0,0 +1,22 @@ +Mutability in wasmedge_sdk - Rust
pub enum Mutability {
+    Const,
+    Var,
+}
Expand description

Defines the mutability property of WasmEdge Global variables.

+

Mutability determines the mutability property of a WasmEdge Global variable is either mutable or immutable.

+

Variants§

§

Const

Identifies an immutable global variable.

+
§

Var

Identifies a mutable global variable.

+

Trait Implementations§

§

impl Clone for Mutability

§

fn clone(&self) -> Mutability

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Mutability

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<i32> for Mutability

§

fn from(value: i32) -> Mutability

Converts to this type from the input type.
§

impl From<u32> for Mutability

§

fn from(value: u32) -> Mutability

Converts to this type from the input type.
§

impl PartialEq for Mutability

§

fn eq(&self, other: &Mutability) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Copy for Mutability

§

impl Eq for Mutability

§

impl StructuralEq for Mutability

§

impl StructuralPartialEq for Mutability

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/enum.RefType.html b/wasmedge_sdk/enum.RefType.html new file mode 100644 index 000000000..827e5e5e2 --- /dev/null +++ b/wasmedge_sdk/enum.RefType.html @@ -0,0 +1,21 @@ +RefType in wasmedge_sdk - Rust
pub enum RefType {
+    FuncRef,
+    ExternRef,
+}
Expand description

Defines WasmEdge reference types.

+

Variants§

§

FuncRef

Refers to the infinite union of all references to host functions, regardless of their function types.

+
§

ExternRef

Refers to the infinite union of all references to objects and that can be passed into WebAssembly under this type.

+

Trait Implementations§

§

impl Clone for RefType

§

fn clone(&self) -> RefType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for RefType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<i32> for RefType

§

fn from(value: i32) -> RefType

Converts to this type from the input type.
§

impl From<u32> for RefType

§

fn from(value: u32) -> RefType

Converts to this type from the input type.
§

impl PartialEq for RefType

§

fn eq(&self, other: &RefType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Copy for RefType

§

impl Eq for RefType

§

impl StructuralEq for RefType

§

impl StructuralPartialEq for RefType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/enum.ValType.html b/wasmedge_sdk/enum.ValType.html new file mode 100644 index 000000000..fef219b93 --- /dev/null +++ b/wasmedge_sdk/enum.ValType.html @@ -0,0 +1,35 @@ +ValType in wasmedge_sdk - Rust
pub enum ValType {
+    I32,
+    I64,
+    F32,
+    F64,
+    V128,
+    FuncRef,
+    ExternRef,
+}
Expand description

Defines WasmEdge value types.

+

Variants§

§

I32

32-bit integer.

+

Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.

+
§

I64

64-bit integer.

+

Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.

+
§

F32

32-bit floating-point data as defined by the IEEE 754-2019.

+
§

F64

64-bit floating-point data as defined by the IEEE 754-2019.

+
§

V128

128-bit vector of packed integer or floating-point data.

+

The packed data can be interpreted as signed or unsigned integers, single or double precision floating-point +values, or a single 128 bit type. The interpretation is determined by individual operations.

+
§

FuncRef

A reference to a host function.

+
§

ExternRef

A reference to object.

+

Trait Implementations§

§

impl Clone for ValType

§

fn clone(&self) -> ValType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ValType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<i32> for ValType

§

fn from(value: i32) -> ValType

Converts to this type from the input type.
§

impl From<u32> for ValType

§

fn from(value: u32) -> ValType

Converts to this type from the input type.
§

impl PartialEq for ValType

§

fn eq(&self, other: &ValType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Copy for ValType

§

impl Eq for ValType

§

impl StructuralEq for ValType

§

impl StructuralPartialEq for ValType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.CoreCommonError.html b/wasmedge_sdk/error/enum.CoreCommonError.html new file mode 100644 index 000000000..13082ec09 --- /dev/null +++ b/wasmedge_sdk/error/enum.CoreCommonError.html @@ -0,0 +1,26 @@ +CoreCommonError in wasmedge_sdk::error - Rust
pub enum CoreCommonError {
+    RuntimeError,
+    CostLimitExceeded,
+    WrongVMWorkflow,
+    FuncNotFound,
+    AOTDisabled,
+    Interrupted,
+    UserDefError,
+    NotValidated,
+}
Expand description

The error type for the common errors from WasmEdge Core.

+

Variants§

§

RuntimeError

§

CostLimitExceeded

§

WrongVMWorkflow

§

FuncNotFound

§

AOTDisabled

§

Interrupted

§

UserDefError

§

NotValidated

Trait Implementations§

§

impl Clone for CoreCommonError

§

fn clone(&self) -> CoreCommonError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CoreCommonError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for CoreCommonError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for CoreCommonError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for CoreCommonError

§

fn eq(&self, other: &CoreCommonError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for CoreCommonError

§

impl StructuralEq for CoreCommonError

§

impl StructuralPartialEq for CoreCommonError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.CoreError.html b/wasmedge_sdk/error/enum.CoreError.html new file mode 100644 index 000000000..ecd3a13c3 --- /dev/null +++ b/wasmedge_sdk/error/enum.CoreError.html @@ -0,0 +1,23 @@ +CoreError in wasmedge_sdk::error - Rust
pub enum CoreError {
+    Common(CoreCommonError),
+    Load(CoreLoadError),
+    Validation(CoreValidationError),
+    Instantiation(CoreInstantiationError),
+    Execution(CoreExecutionError),
+}
Expand description

The error types raised by WasmEdge Core.

+

Variants§

Trait Implementations§

§

impl Clone for CoreError

§

fn clone(&self) -> CoreError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CoreError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for CoreError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for CoreError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for CoreError

§

fn eq(&self, other: &CoreError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for CoreError

§

impl StructuralEq for CoreError

§

impl StructuralPartialEq for CoreError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.CoreExecutionError.html b/wasmedge_sdk/error/enum.CoreExecutionError.html new file mode 100644 index 000000000..25bbdf867 --- /dev/null +++ b/wasmedge_sdk/error/enum.CoreExecutionError.html @@ -0,0 +1,35 @@ +CoreExecutionError in wasmedge_sdk::error - Rust
pub enum CoreExecutionError {
+
Show 17 variants WrongInstanceAddress, + WrongInstanceIndex, + InstrTypeMismatch, + FuncTypeMismatch, + DivideByZero, + IntegerOverflow, + InvalidConvToInt, + TableOutOfBounds, + MemoryOutOfBounds, + Unreachable, + UninitializedElement, + UndefinedElement, + IndirectCallTypeMismatch, + HostFuncFailed, + RefTypeMismatch, + UnalignedAtomicAccess, + ExpectSharedMemory, +
}
Expand description

The error type for the execution phase from WasmEdge Core.

+

Variants§

§

WrongInstanceAddress

§

WrongInstanceIndex

§

InstrTypeMismatch

§

FuncTypeMismatch

§

DivideByZero

§

IntegerOverflow

§

InvalidConvToInt

§

TableOutOfBounds

§

MemoryOutOfBounds

§

Unreachable

§

UninitializedElement

§

UndefinedElement

§

IndirectCallTypeMismatch

§

HostFuncFailed

§

RefTypeMismatch

§

UnalignedAtomicAccess

§

ExpectSharedMemory

Trait Implementations§

§

impl Clone for CoreExecutionError

§

fn clone(&self) -> CoreExecutionError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CoreExecutionError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for CoreExecutionError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for CoreExecutionError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for CoreExecutionError

§

fn eq(&self, other: &CoreExecutionError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for CoreExecutionError

§

impl StructuralEq for CoreExecutionError

§

impl StructuralPartialEq for CoreExecutionError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.CoreInstantiationError.html b/wasmedge_sdk/error/enum.CoreInstantiationError.html new file mode 100644 index 000000000..a84896719 --- /dev/null +++ b/wasmedge_sdk/error/enum.CoreInstantiationError.html @@ -0,0 +1,23 @@ +CoreInstantiationError in wasmedge_sdk::error - Rust
pub enum CoreInstantiationError {
+    ModuleNameConflict,
+    IncompatibleImportType,
+    UnknownImport,
+    DataSegDoesNotFit,
+    ElemSegDoesNotFit,
+}
Expand description

The error type for the instantiation phase from WasmEdge Core.

+

Variants§

§

ModuleNameConflict

§

IncompatibleImportType

§

UnknownImport

§

DataSegDoesNotFit

§

ElemSegDoesNotFit

Trait Implementations§

§

impl Clone for CoreInstantiationError

§

fn clone(&self) -> CoreInstantiationError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CoreInstantiationError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for CoreInstantiationError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for CoreInstantiationError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for CoreInstantiationError

§

fn eq(&self, other: &CoreInstantiationError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for CoreInstantiationError

§

impl StructuralEq for CoreInstantiationError

§

impl StructuralPartialEq for CoreInstantiationError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.CoreLoadError.html b/wasmedge_sdk/error/enum.CoreLoadError.html new file mode 100644 index 000000000..d29cb8874 --- /dev/null +++ b/wasmedge_sdk/error/enum.CoreLoadError.html @@ -0,0 +1,43 @@ +CoreLoadError in wasmedge_sdk::error - Rust
pub enum CoreLoadError {
+
Show 25 variants IllegalPath, + ReadError, + UnexpectedEnd, + MalformedMagic, + MalformedVersion, + MalformedSection, + SectionSizeMismatch, + NameSizeOutOfBounds, + JunkSection, + IncompatibleFuncCode, + IncompatibleDataCount, + DataCountRequired, + MalformedImportKind, + MalformedExportKind, + ExpectedZeroByte, + InvalidMut, + TooManyLocals, + MalformedValType, + MalformedElemType, + MalformedRefType, + MalformedUTF8, + IntegerTooLarge, + IntegerTooLong, + IllegalOpCode, + IllegalGrammar, +
}
Expand description

The error type for the load phase from WasmEdge Core.

+

Variants§

§

IllegalPath

§

ReadError

§

UnexpectedEnd

§

MalformedMagic

§

MalformedVersion

§

MalformedSection

§

SectionSizeMismatch

§

NameSizeOutOfBounds

§

JunkSection

§

IncompatibleFuncCode

§

IncompatibleDataCount

§

DataCountRequired

§

MalformedImportKind

§

MalformedExportKind

§

ExpectedZeroByte

§

InvalidMut

§

TooManyLocals

§

MalformedValType

§

MalformedElemType

§

MalformedRefType

§

MalformedUTF8

§

IntegerTooLarge

§

IntegerTooLong

§

IllegalOpCode

§

IllegalGrammar

Trait Implementations§

§

impl Clone for CoreLoadError

§

fn clone(&self) -> CoreLoadError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CoreLoadError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for CoreLoadError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for CoreLoadError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for CoreLoadError

§

fn eq(&self, other: &CoreLoadError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for CoreLoadError

§

impl StructuralEq for CoreLoadError

§

impl StructuralPartialEq for CoreLoadError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.CoreValidationError.html b/wasmedge_sdk/error/enum.CoreValidationError.html new file mode 100644 index 000000000..b142010c9 --- /dev/null +++ b/wasmedge_sdk/error/enum.CoreValidationError.html @@ -0,0 +1,40 @@ +CoreValidationError in wasmedge_sdk::error - Rust
pub enum CoreValidationError {
+
Show 22 variants InvalidAlignment, + TypeCheckFailed, + InvalidLabelIdx, + InvalidLocalIdx, + InvalidFuncTypeIdx, + InvalidFuncIdx, + InvalidTableIdx, + InvalidMemoryIdx, + InvalidGlobalIdx, + InvalidElemIdx, + InvalidDataIdx, + InvalidRefIdx, + ConstExprRequired, + DupExportName, + ImmutableGlobal, + InvalidResultArity, + MultiTables, + MultiMemories, + InvalidLimit, + InvalidMemPages, + InvalidStartFunc, + InvalidLaneIdx, +
}
Expand description

The error type for the validation phase from WasmEdge Core.

+

Variants§

§

InvalidAlignment

§

TypeCheckFailed

§

InvalidLabelIdx

§

InvalidLocalIdx

§

InvalidFuncTypeIdx

§

InvalidFuncIdx

§

InvalidTableIdx

§

InvalidMemoryIdx

§

InvalidGlobalIdx

§

InvalidElemIdx

§

InvalidDataIdx

§

InvalidRefIdx

§

ConstExprRequired

§

DupExportName

§

ImmutableGlobal

§

InvalidResultArity

§

MultiTables

§

MultiMemories

§

InvalidLimit

§

InvalidMemPages

§

InvalidStartFunc

§

InvalidLaneIdx

Trait Implementations§

§

impl Clone for CoreValidationError

§

fn clone(&self) -> CoreValidationError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CoreValidationError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for CoreValidationError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for CoreValidationError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for CoreValidationError

§

fn eq(&self, other: &CoreValidationError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for CoreValidationError

§

impl StructuralEq for CoreValidationError

§

impl StructuralPartialEq for CoreValidationError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.ExportError.html b/wasmedge_sdk/error/enum.ExportError.html new file mode 100644 index 000000000..66468c88c --- /dev/null +++ b/wasmedge_sdk/error/enum.ExportError.html @@ -0,0 +1,26 @@ +ExportError in wasmedge_sdk::error - Rust
pub enum ExportError {
+    Type {
+        expected: ExternalInstanceType,
+        actual: ExternalInstanceType,
+    },
+    FuncType(String),
+    TableType(String),
+    MemType(String),
+    GlobalType(String),
+}
Expand description

The error types for WasmEdge ExportType.

+

Variants§

§

Type

§

FuncType(String)

§

TableType(String)

§

MemType(String)

§

GlobalType(String)

Trait Implementations§

§

impl Clone for ExportError

§

fn clone(&self) -> ExportError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ExportError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for ExportError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for ExportError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for ExportError

§

fn eq(&self, other: &ExportError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for ExportError

§

impl StructuralEq for ExportError

§

impl StructuralPartialEq for ExportError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.FuncError.html b/wasmedge_sdk/error/enum.FuncError.html new file mode 100644 index 000000000..0932221d7 --- /dev/null +++ b/wasmedge_sdk/error/enum.FuncError.html @@ -0,0 +1,21 @@ +FuncError in wasmedge_sdk::error - Rust
pub enum FuncError {
+    Create,
+    CreateBinding(String),
+    Type,
+}
Expand description

The error types for WasmEdge Function.

+

Variants§

§

Create

§

CreateBinding(String)

§

Type

Trait Implementations§

§

impl Clone for FuncError

§

fn clone(&self) -> FuncError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for FuncError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for FuncError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for FuncError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for FuncError

§

fn eq(&self, other: &FuncError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for FuncError

§

impl StructuralEq for FuncError

§

impl StructuralPartialEq for FuncError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.GlobalError.html b/wasmedge_sdk/error/enum.GlobalError.html new file mode 100644 index 000000000..3d608cf55 --- /dev/null +++ b/wasmedge_sdk/error/enum.GlobalError.html @@ -0,0 +1,22 @@ +GlobalError in wasmedge_sdk::error - Rust
pub enum GlobalError {
+    Create,
+    Type,
+    ModifyConst,
+    UnmatchedValType,
+}
Expand description

The error types for WasmEdge Global.

+

Variants§

§

Create

§

Type

§

ModifyConst

§

UnmatchedValType

Trait Implementations§

§

impl Clone for GlobalError

§

fn clone(&self) -> GlobalError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for GlobalError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for GlobalError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for GlobalError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for GlobalError

§

fn eq(&self, other: &GlobalError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for GlobalError

§

impl StructuralEq for GlobalError

§

impl StructuralPartialEq for GlobalError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.HostFuncError.html b/wasmedge_sdk/error/enum.HostFuncError.html new file mode 100644 index 000000000..062bfc92e --- /dev/null +++ b/wasmedge_sdk/error/enum.HostFuncError.html @@ -0,0 +1,20 @@ +HostFuncError in wasmedge_sdk::error - Rust
pub enum HostFuncError {
+    User(u32),
+    Runtime(u32),
+}
Expand description

The error type for the host function definition.

+

Variants§

§

User(u32)

§

Runtime(u32)

Trait Implementations§

§

impl Clone for HostFuncError

§

fn clone(&self) -> HostFuncError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for HostFuncError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for HostFuncError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for HostFuncError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for HostFuncError

§

fn eq(&self, other: &HostFuncError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for HostFuncError

§

impl StructuralEq for HostFuncError

§

impl StructuralPartialEq for HostFuncError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.ImportError.html b/wasmedge_sdk/error/enum.ImportError.html new file mode 100644 index 000000000..9f215771c --- /dev/null +++ b/wasmedge_sdk/error/enum.ImportError.html @@ -0,0 +1,26 @@ +ImportError in wasmedge_sdk::error - Rust
pub enum ImportError {
+    Type {
+        expected: ExternalInstanceType,
+        actual: ExternalInstanceType,
+    },
+    FuncType(String),
+    TableType(String),
+    MemType(String),
+    GlobalType(String),
+}
Expand description

The error types for WasmEdge ImportType.

+

Variants§

§

Type

§

FuncType(String)

§

TableType(String)

§

MemType(String)

§

GlobalType(String)

Trait Implementations§

§

impl Clone for ImportError

§

fn clone(&self) -> ImportError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ImportError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for ImportError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for ImportError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for ImportError

§

fn eq(&self, other: &ImportError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for ImportError

§

impl StructuralEq for ImportError

§

impl StructuralPartialEq for ImportError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.InstanceError.html b/wasmedge_sdk/error/enum.InstanceError.html new file mode 100644 index 000000000..e83a01b55 --- /dev/null +++ b/wasmedge_sdk/error/enum.InstanceError.html @@ -0,0 +1,27 @@ +InstanceError in wasmedge_sdk::error - Rust
pub enum InstanceError {
+    Create,
+    CreateWasi,
+    CreateWasmEdgeProcess,
+    CreateImportModule,
+    NotFoundFunc(String),
+    NotFoundTable(String),
+    NotFoundMem(String),
+    NotFoundGlobal(String),
+    NotFoundMappedFdHandler,
+}
Expand description

The error types for WasmEdge Instance.

+

Variants§

§

Create

§

CreateWasi

§

CreateWasmEdgeProcess

§

CreateImportModule

§

NotFoundFunc(String)

§

NotFoundTable(String)

§

NotFoundMem(String)

§

NotFoundGlobal(String)

§

NotFoundMappedFdHandler

Trait Implementations§

§

impl Clone for InstanceError

§

fn clone(&self) -> InstanceError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for InstanceError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for InstanceError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for InstanceError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for InstanceError

§

fn eq(&self, other: &InstanceError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for InstanceError

§

impl StructuralEq for InstanceError

§

impl StructuralPartialEq for InstanceError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.MemError.html b/wasmedge_sdk/error/enum.MemError.html new file mode 100644 index 000000000..bc2376790 --- /dev/null +++ b/wasmedge_sdk/error/enum.MemError.html @@ -0,0 +1,24 @@ +MemError in wasmedge_sdk::error - Rust
pub enum MemError {
+    Create,
+    CreateSharedType,
+    Type,
+    ConstPtr,
+    MutPtr,
+    Ptr2Ref,
+}
Expand description

The error types for WasmEdge Memory.

+

Variants§

§

Create

§

CreateSharedType

§

Type

§

ConstPtr

§

MutPtr

§

Ptr2Ref

Trait Implementations§

§

impl Clone for MemError

§

fn clone(&self) -> MemError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for MemError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for MemError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for MemError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for MemError

§

fn eq(&self, other: &MemError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for MemError

§

impl StructuralEq for MemError

§

impl StructuralPartialEq for MemError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.PluginError.html b/wasmedge_sdk/error/enum.PluginError.html new file mode 100644 index 000000000..006c99804 --- /dev/null +++ b/wasmedge_sdk/error/enum.PluginError.html @@ -0,0 +1,20 @@ +PluginError in wasmedge_sdk::error - Rust
pub enum PluginError {
+    Create(String),
+    NotFound(String),
+}
Expand description

The error types for WasmEdge plugin.

+

Variants§

§

Create(String)

§

NotFound(String)

Trait Implementations§

§

impl Clone for PluginError

§

fn clone(&self) -> PluginError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for PluginError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for PluginError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for PluginError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for PluginError

§

fn eq(&self, other: &PluginError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for PluginError

§

impl StructuralEq for PluginError

§

impl StructuralPartialEq for PluginError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.StoreError.html b/wasmedge_sdk/error/enum.StoreError.html new file mode 100644 index 000000000..753b3acd6 --- /dev/null +++ b/wasmedge_sdk/error/enum.StoreError.html @@ -0,0 +1,41 @@ +StoreError in wasmedge_sdk::error - Rust
pub enum StoreError {
+    Create,
+    NotFoundFunc(String),
+    NotFoundFuncRegistered {
+        func_name: String,
+        mod_name: String,
+    },
+    NotFoundTable(String),
+    NotFoundTableRegistered {
+        table_name: String,
+        mod_name: String,
+    },
+    NotFoundMem(String),
+    NotFoundMemRegistered {
+        mem_name: String,
+        mod_name: String,
+    },
+    NotFoundGlobal(String),
+    NotFoundGlobalRegistered {
+        global_name: String,
+        mod_name: String,
+    },
+    NotFoundModule(String),
+    NotFoundActiveModule,
+}
Expand description

The error types for WasmEdge Store.

+

Variants§

§

Create

§

NotFoundFunc(String)

§

NotFoundFuncRegistered

Fields

§func_name: String
§mod_name: String
§

NotFoundTable(String)

§

NotFoundTableRegistered

Fields

§table_name: String
§mod_name: String
§

NotFoundMem(String)

§

NotFoundMemRegistered

Fields

§mem_name: String
§mod_name: String
§

NotFoundGlobal(String)

§

NotFoundGlobalRegistered

Fields

§global_name: String
§mod_name: String
§

NotFoundModule(String)

§

NotFoundActiveModule

Trait Implementations§

§

impl Clone for StoreError

§

fn clone(&self) -> StoreError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for StoreError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for StoreError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for StoreError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for StoreError

§

fn eq(&self, other: &StoreError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for StoreError

§

impl StructuralEq for StoreError

§

impl StructuralPartialEq for StoreError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.TableError.html b/wasmedge_sdk/error/enum.TableError.html new file mode 100644 index 000000000..e86049dbf --- /dev/null +++ b/wasmedge_sdk/error/enum.TableError.html @@ -0,0 +1,20 @@ +TableError in wasmedge_sdk::error - Rust
pub enum TableError {
+    Create,
+    Type,
+}
Expand description

The error types for WasmEdge Table.

+

Variants§

§

Create

§

Type

Trait Implementations§

§

impl Clone for TableError

§

fn clone(&self) -> TableError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for TableError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for TableError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for TableError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for TableError

§

fn eq(&self, other: &TableError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for TableError

§

impl StructuralEq for TableError

§

impl StructuralPartialEq for TableError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.VmError.html b/wasmedge_sdk/error/enum.VmError.html new file mode 100644 index 000000000..1daf4d7c1 --- /dev/null +++ b/wasmedge_sdk/error/enum.VmError.html @@ -0,0 +1,40 @@ +VmError in wasmedge_sdk::error - Rust
pub enum VmError {
+
Show 22 variants Create, + CreateWithWasiContext, + NotFoundFuncType(String), + NotFoundModule(String), + NotFoundWasiModule, + NotFoundWasmEdgeProcessModule, + NotFoundWasiNnModule, + NotFoundWasiCryptoCommonModule, + NotFoundWasiCryptoAsymmetricCommonModule, + NotFoundWasiCryptoSymmetricModule, + NotFoundWasiCryptoKxModule, + NotFoundWasiCryptoSignaturesModule, + NotFoundStore, + NotFoundStatistics, + NotFoundImportModule(String), + DuplicateImportModule(String), + DuplicateModuleInstance(String), + NotFoundLoader, + NotFoundValidator, + NotFoundExecutor, + InvalidImportModule, + NotFoundActiveModule, +
}
Expand description

The error types for WasmEdge Vm.

+

Variants§

§

Create

§

CreateWithWasiContext

§

NotFoundFuncType(String)

§

NotFoundModule(String)

§

NotFoundWasiModule

§

NotFoundWasmEdgeProcessModule

§

NotFoundWasiNnModule

§

NotFoundWasiCryptoCommonModule

§

NotFoundWasiCryptoAsymmetricCommonModule

§

NotFoundWasiCryptoSymmetricModule

§

NotFoundWasiCryptoKxModule

§

NotFoundWasiCryptoSignaturesModule

§

NotFoundStore

§

NotFoundStatistics

§

NotFoundImportModule(String)

§

DuplicateImportModule(String)

§

DuplicateModuleInstance(String)

§

NotFoundLoader

§

NotFoundValidator

§

NotFoundExecutor

§

InvalidImportModule

§

NotFoundActiveModule

Trait Implementations§

§

impl Clone for VmError

§

fn clone(&self) -> VmError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for VmError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for VmError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for VmError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl PartialEq for VmError

§

fn eq(&self, other: &VmError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for VmError

§

impl StructuralEq for VmError

§

impl StructuralPartialEq for VmError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/enum.WasmEdgeError.html b/wasmedge_sdk/error/enum.WasmEdgeError.html new file mode 100644 index 000000000..c6154d11d --- /dev/null +++ b/wasmedge_sdk/error/enum.WasmEdgeError.html @@ -0,0 +1,50 @@ +WasmEdgeError in wasmedge_sdk::error - Rust
pub enum WasmEdgeError {
+
Show 31 variants Operation(String), + User(u32), + Core(CoreError), + ImportObjCreate, + ExecutorCreate, + Store(StoreError), + StatisticsCreate, + ModuleCreate, + LoaderCreate, + ConfigCreate, + CompilerCreate, + ValidatorCreate, + Vm(VmError), + Func(FuncError), + FuncTypeCreate, + ExecuteTimeout, + Mem(MemError), + MemTypeCreate, + Global(GlobalError), + GlobalTypeCreate, + Table(TableError), + TableTypeCreate, + Import(ImportError), + Export(ExportError), + Instance(InstanceError), + Plugin(PluginError), + FoundNulByte(NulError), + NotFoundNulByte(FromBytesWithNulError), + Utf8(Utf8Error), + FromUtf8(FromUtf8Error), + WindowsPathConversion(String), +
}
Expand description

The error types used by both wasmedge-sys and wasmedge crates.

+

Variants§

§

Operation(String)

§

User(u32)

§

Core(CoreError)

Errors raised by WasmEdge Core.

+
§

ImportObjCreate

§

ExecutorCreate

§

Store(StoreError)

§

StatisticsCreate

§

ModuleCreate

§

LoaderCreate

§

ConfigCreate

§

CompilerCreate

§

ValidatorCreate

§

Vm(VmError)

§

Func(FuncError)

§

FuncTypeCreate

§

ExecuteTimeout

§

Mem(MemError)

§

MemTypeCreate

§

Global(GlobalError)

§

GlobalTypeCreate

§

Table(TableError)

§

TableTypeCreate

§

Import(ImportError)

§

Export(ExportError)

§

Instance(InstanceError)

§

Plugin(PluginError)

§

FoundNulByte(NulError)

§

NotFoundNulByte(FromBytesWithNulError)

§

Utf8(Utf8Error)

§

FromUtf8(FromUtf8Error)

§

WindowsPathConversion(String)

Trait Implementations§

§

impl Clone for WasmEdgeError

§

fn clone(&self) -> WasmEdgeError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for WasmEdgeError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for WasmEdgeError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for WasmEdgeError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<FromBytesWithNulError> for WasmEdgeError

§

fn from(source: FromBytesWithNulError) -> WasmEdgeError

Converts to this type from the input type.
§

impl From<FromUtf8Error> for WasmEdgeError

§

fn from(source: FromUtf8Error) -> WasmEdgeError

Converts to this type from the input type.
§

impl From<NulError> for WasmEdgeError

§

fn from(source: NulError) -> WasmEdgeError

Converts to this type from the input type.
§

impl From<Utf8Error> for WasmEdgeError

§

fn from(source: Utf8Error) -> WasmEdgeError

Converts to this type from the input type.
§

impl PartialEq for WasmEdgeError

§

fn eq(&self, other: &WasmEdgeError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for WasmEdgeError

§

impl StructuralEq for WasmEdgeError

§

impl StructuralPartialEq for WasmEdgeError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/error/index.html b/wasmedge_sdk/error/index.html new file mode 100644 index 000000000..237eb7e60 --- /dev/null +++ b/wasmedge_sdk/error/index.html @@ -0,0 +1,2 @@ +wasmedge_sdk::error - Rust

Module wasmedge_sdk::error

Expand description

Defines WasmEdge error types.

+

Enums

\ No newline at end of file diff --git a/wasmedge_sdk/error/sidebar-items.js b/wasmedge_sdk/error/sidebar-items.js new file mode 100644 index 000000000..bc753e2ef --- /dev/null +++ b/wasmedge_sdk/error/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CoreCommonError","CoreError","CoreExecutionError","CoreInstantiationError","CoreLoadError","CoreValidationError","ExportError","FuncError","GlobalError","HostFuncError","ImportError","InstanceError","MemError","PluginError","StoreError","TableError","VmError","WasmEdgeError"]}; \ No newline at end of file diff --git a/wasmedge_sdk/executor/struct.Executor.html b/wasmedge_sdk/executor/struct.Executor.html new file mode 100644 index 000000000..c15f140e0 --- /dev/null +++ b/wasmedge_sdk/executor/struct.Executor.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.Executor.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/externals/function/struct.Func.html b/wasmedge_sdk/externals/function/struct.Func.html new file mode 100644 index 000000000..8585dcf47 --- /dev/null +++ b/wasmedge_sdk/externals/function/struct.Func.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../wasmedge_sdk/struct.Func.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/externals/function/struct.FuncRef.html b/wasmedge_sdk/externals/function/struct.FuncRef.html new file mode 100644 index 000000000..8d17ebe6e --- /dev/null +++ b/wasmedge_sdk/externals/function/struct.FuncRef.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../wasmedge_sdk/struct.FuncRef.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/externals/function/struct.FuncTypeBuilder.html b/wasmedge_sdk/externals/function/struct.FuncTypeBuilder.html new file mode 100644 index 000000000..d862b3f04 --- /dev/null +++ b/wasmedge_sdk/externals/function/struct.FuncTypeBuilder.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../wasmedge_sdk/struct.FuncTypeBuilder.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/externals/global/struct.Global.html b/wasmedge_sdk/externals/global/struct.Global.html new file mode 100644 index 000000000..763ccc6ce --- /dev/null +++ b/wasmedge_sdk/externals/global/struct.Global.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../wasmedge_sdk/struct.Global.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/externals/memory/struct.Memory.html b/wasmedge_sdk/externals/memory/struct.Memory.html new file mode 100644 index 000000000..5d9995e70 --- /dev/null +++ b/wasmedge_sdk/externals/memory/struct.Memory.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../wasmedge_sdk/struct.Memory.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/externals/table/struct.Table.html b/wasmedge_sdk/externals/table/struct.Table.html new file mode 100644 index 000000000..31ade3ba1 --- /dev/null +++ b/wasmedge_sdk/externals/table/struct.Table.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../wasmedge_sdk/struct.Table.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/fn.wat2wasm.html b/wasmedge_sdk/fn.wat2wasm.html new file mode 100644 index 000000000..4172eb65e --- /dev/null +++ b/wasmedge_sdk/fn.wat2wasm.html @@ -0,0 +1,27 @@ +wat2wasm in wasmedge_sdk - Rust

Function wasmedge_sdk::wat2wasm

pub fn wat2wasm(bytes: &[u8]) -> Result<Cow<'_, [u8]>, Error>
Expand description

Parses in-memory bytes as either the WebAssembly Text format, or a +binary WebAssembly module.

+

This function will attempt to interpret the given bytes as one of two +options:

+
    +
  • A utf-8 string which is a *.wat file to be parsed.
  • +
  • A binary WebAssembly file starting with b"\0asm"
  • +
+

If the input is a string then it will be parsed as *.wat, and then after +parsing it will be encoded back into a WebAssembly binary module. If the +input is a binary that starts with b"\0asm" it will be returned verbatim. +Everything that doesn’t start with b"\0asm" will be parsed as a utf-8 +*.wat file, returning errors as appropriate.

+

For more information about parsing wat files, see [parse_str].

+

Errors

+

In addition to all of the errors that can be returned from [parse_str], +this function will also return an error if the input does not start with +b"\0asm" and is invalid utf-8. (failed to even try to call [parse_str]).

+

Examples

+
// Parsing bytes that are actually `*.wat` files
+assert_eq!(&*wat::parse_bytes(b"(module)")?, b"\0asm\x01\0\0\0");
+assert!(wat::parse_bytes(b"module").is_err());
+assert!(wat::parse_bytes(b"binary\0file\0\that\0is\0not\0wat").is_err());
+
+// Pass through binaries that look like real wasm files
+assert_eq!(&*wat::parse_bytes(b"\0asm\x01\0\0\0")?, b"\0asm\x01\0\0\0");
+
\ No newline at end of file diff --git a/wasmedge_sdk/import/struct.ImportObject.html b/wasmedge_sdk/import/struct.ImportObject.html new file mode 100644 index 000000000..f4f7e87e8 --- /dev/null +++ b/wasmedge_sdk/import/struct.ImportObject.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.ImportObject.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/import/struct.ImportObjectBuilder.html b/wasmedge_sdk/import/struct.ImportObjectBuilder.html new file mode 100644 index 000000000..82961596b --- /dev/null +++ b/wasmedge_sdk/import/struct.ImportObjectBuilder.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.ImportObjectBuilder.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/index.html b/wasmedge_sdk/index.html new file mode 100644 index 000000000..705c7020c --- /dev/null +++ b/wasmedge_sdk/index.html @@ -0,0 +1,69 @@ +wasmedge_sdk - Rust

Crate wasmedge_sdk

source ·
Expand description

Overview

+

WasmEdge Rust SDK provides idiomatic Rust language bindings for WasmEdge

+

Notice: This project is still under active development and not guaranteed to have a stable API.

+ +

Get Started

+

Since this crate depends on the WasmEdge C API, it needs to be installed in your system first. Please refer to WasmEdge Installation and Uninstallation to install the WasmEdge library. The versioning table below shows the version of the WasmEdge library required by each version of the wasmedge-sdk crate.

+
+ + + + + + + + + + + + + + + + + + + + +
wasmedge-sdkWasmEdge libwasmedge-syswasmedge-typeswasmedge-macroasync-wasi
0.13.10.13.50.17.30.4.40.6.10.1.0
0.13.00.13.50.17.30.4.40.6.10.1.0
0.12.20.13.40.17.20.4.40.6.10.1.0
0.12.10.13.40.17.10.4.40.6.10.1.0
0.12.00.13.40.17.00.4.40.6.10.1.0
0.11.20.13.30.16.20.4.30.6.10.1.0
0.11.00.13.30.16.00.4.30.6.00.0.3
0.10.10.13.30.15.10.4.20.5.00.0.2
0.10.00.13.20.15.00.4.20.5.00.0.2
0.9.00.13.10.14.00.4.20.4.00.0.1
0.9.00.13.00.14.00.4.20.4.00.0.1
0.8.10.12.10.13.10.4.10.3.0-
0.8.00.12.00.13.00.4.10.3.0-
0.7.10.11.20.12.20.3.10.3.0-
0.7.00.11.20.120.3.10.3.0-
0.6.00.11.20.110.3.00.2.0-
0.5.00.11.10.100.3.00.1.0-
0.4.00.11.00.90.2.1--
0.3.00.10.10.80.2--
0.1.00.10.00.70.1--
+
+

WasmEdge Rust SDK will automatically search for the WasmEdge library in your system. Alternatively you can set the WASMEDGE_DIR environment variable to the path of the WasmEdge library (or the WASMEDGE_INCLUDE_DIR and WASMEDGE_LIB_DIR variables for more fine-grained control). If you want to use a local cmake build of WasmEdge you can set the WASMEDGE_BUILD_DIR instead.

+

WasmEdge Rust SDK will search for the WasmEdge library in the following paths in order:

+
    +
  • $WASMEDGE_[INCLUDE|LIB]_DIR
  • +
  • $WASMEDGE_DIR
  • +
  • $WASMEDGE_BUILD_DIR
  • +
  • $HOME/.wasmedge
  • +
  • /usr/local
  • +
  • $HOME/.local
  • +
+

When the standalone feature is enabled the correct library will be downloaded during build time and the previous locations are ignored. You can specify a proxy for the download process using the WASMEDGE_STANDALONE_PROXY, WASMEDGE_STANDALONE_PROXY_USER and WASMEDGE_STANDALONE_PROXY_PASS environment variables. You can set the WASMEDGE_STANDALONE_ARCHIVE environment variable to use a local archive instead of downloading one. +The following architectures are supported for automatic downloads:

+
+ + + +
oslibcarchitecturelinking type
macos-x86_64, aarch64dynamic
linuxglibcx86_64, aarch64static, dynamic
linuxmuslx86_64, aarch64static
+
+

This crate uses rust-bindgen during the build process. If you would like to use an external rust-bindgen you can set the WASMEDGE_RUST_BINDGEN_PATH environment variable to the bindgen executable path. This is particularly useful in systems like Alpine Linux (see rust-lang/rust-bindgen#2360, rust-lang/rust-bindgen#2333).

+

Notice: The minimum supported Rust version is 1.71.

+

API Reference

+ +

Examples

+

The Examples of WasmEdge RustSDK repo contains a number of examples that demonstrate how to use the WasmEdge Rust SDK.

+

Contributing

+

Please read the contribution guidelines on how to contribute code.

+

License

+

This project is licensed under the terms of the Apache 2.0 license.

+

Modules

  • Defines the structs used to construct configurations.
  • Defines WasmEdge VmDock and Param types.
  • Defines WasmEdge error types.
  • Defines plugin related structs.
  • Defines the general types.
  • Defines WasmEdge Driver and CoreVersion types
  • Defines wasi module instance.

Macros

Structs

  • Represents the calling frame on top of stack.
  • Defines WasmEdge ahead-of-time(AOT) compiler and the relevant APIs.
  • Defines an execution environment for both pure WASM and compiled WASM.
  • Defines the types of the exported instances.
  • Defines a host function instance.
  • Defines a reference to a host function.
  • Struct of WasmEdge FuncType.
  • Defines a type builder for creating a FuncType instance.
  • Defines a WebAssembly global variable, which stores a single value of the given GlobalType and a flag indicating whether it is mutable or not.
  • Struct of WasmEdge GlobalType.
  • Defines an import object that contains the required import data used when instantiating a module.
  • Creates a normal or wasi import object.
  • Defines the types of the imported instances.
  • Represents an instantiated module.
  • Manipulates the runtime logger.
  • Defines a linear memory.
  • Struct of WasmEdge MemoryType.
  • Defines compiled in-memory representation of an input WASM binary.
  • Used to collect statistics of the WasmEdge runtime, such as the count of instructions in execution.
  • Represents all global state that can be manipulated by WebAssembly programs. A store consists of the runtime representation of all instances of functions, tables, memories, and globals.
  • Defines a table storing the references to host functions or external objects.
  • Struct of WasmEdge TableType.
  • A Vm defines a virtual environment for managing WebAssembly programs.
  • Constructs a Vm instance.

Enums

Traits

  • The object used as an module instance is required to implement this trait.
  • The object that is used to perform a host function is required to implement this trait.
  • Defines the function converting a value of Rust type to the one of Wasm type.
  • Describes the mapping of Rust type to Wasm type.
  • Describes the mapping of a tuple of Rust types to Wasm types.

Functions

Type Aliases

Attribute Macros

  • Declare a native function that will be used to create a host function instance.
\ No newline at end of file diff --git a/wasmedge_sdk/instance/struct.Instance.html b/wasmedge_sdk/instance/struct.Instance.html new file mode 100644 index 000000000..91186db74 --- /dev/null +++ b/wasmedge_sdk/instance/struct.Instance.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.Instance.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/instance/trait.AsInstance.html b/wasmedge_sdk/instance/trait.AsInstance.html new file mode 100644 index 000000000..f1376b087 --- /dev/null +++ b/wasmedge_sdk/instance/trait.AsInstance.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/trait.AsInstance.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/io/trait.WasmVal.html b/wasmedge_sdk/io/trait.WasmVal.html new file mode 100644 index 000000000..0c52198b0 --- /dev/null +++ b/wasmedge_sdk/io/trait.WasmVal.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/trait.WasmVal.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/io/trait.WasmValType.html b/wasmedge_sdk/io/trait.WasmValType.html new file mode 100644 index 000000000..42a8bbae2 --- /dev/null +++ b/wasmedge_sdk/io/trait.WasmValType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/trait.WasmValType.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/io/trait.WasmValTypeList.html b/wasmedge_sdk/io/trait.WasmValTypeList.html new file mode 100644 index 000000000..05388c26f --- /dev/null +++ b/wasmedge_sdk/io/trait.WasmValTypeList.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/trait.WasmValTypeList.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/log/struct.LogManager.html b/wasmedge_sdk/log/struct.LogManager.html new file mode 100644 index 000000000..2ead988d7 --- /dev/null +++ b/wasmedge_sdk/log/struct.LogManager.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.LogManager.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/macro.params!.html b/wasmedge_sdk/macro.params!.html new file mode 100644 index 000000000..612a78740 --- /dev/null +++ b/wasmedge_sdk/macro.params!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.params.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/macro.params.html b/wasmedge_sdk/macro.params.html new file mode 100644 index 000000000..1be356c1c --- /dev/null +++ b/wasmedge_sdk/macro.params.html @@ -0,0 +1,5 @@ +params in wasmedge_sdk - Rust

Macro wasmedge_sdk::params

source ·
macro_rules! params {
+    ( $( $x:expr ),* ) => { ... };
+}
Expand description

Generates arguments of WasmValue types.

+

Notice that to use the macro, it is required to use WasmVal trait.

+
\ No newline at end of file diff --git a/wasmedge_sdk/module/struct.ExportType.html b/wasmedge_sdk/module/struct.ExportType.html new file mode 100644 index 000000000..b2868a97c --- /dev/null +++ b/wasmedge_sdk/module/struct.ExportType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.ExportType.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/module/struct.ImportType.html b/wasmedge_sdk/module/struct.ImportType.html new file mode 100644 index 000000000..a3071ce71 --- /dev/null +++ b/wasmedge_sdk/module/struct.ImportType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.ImportType.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/module/struct.Module.html b/wasmedge_sdk/module/struct.Module.html new file mode 100644 index 000000000..4718eef0f --- /dev/null +++ b/wasmedge_sdk/module/struct.Module.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.Module.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/plugin/enum.ExecutionTarget.html b/wasmedge_sdk/plugin/enum.ExecutionTarget.html new file mode 100644 index 000000000..99c45f169 --- /dev/null +++ b/wasmedge_sdk/plugin/enum.ExecutionTarget.html @@ -0,0 +1,27 @@ +ExecutionTarget in wasmedge_sdk::plugin - Rust
pub enum ExecutionTarget {
+    CPU,
+    GPU,
+    TPU,
+    AUTO,
+}
Available on crate feature wasi_nn only.
Expand description

Define where the graph should be executed.

+

Variants§

§

CPU

§

GPU

§

TPU

§

AUTO

Trait Implementations§

source§

impl Clone for ExecutionTarget

source§

fn clone(&self) -> ExecutionTarget

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutionTarget

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ExecutionTarget

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for ExecutionTarget

§

type Err = WasmEdgeError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Ord for ExecutionTarget

source§

fn cmp(&self, other: &ExecutionTarget) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for ExecutionTarget

source§

fn eq(&self, other: &ExecutionTarget) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ExecutionTarget

source§

fn partial_cmp(&self, other: &ExecutionTarget) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for ExecutionTarget

source§

impl StructuralEq for ExecutionTarget

source§

impl StructuralPartialEq for ExecutionTarget

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/enum.GraphEncoding.html b/wasmedge_sdk/plugin/enum.GraphEncoding.html new file mode 100644 index 000000000..aca085e22 --- /dev/null +++ b/wasmedge_sdk/plugin/enum.GraphEncoding.html @@ -0,0 +1,30 @@ +GraphEncoding in wasmedge_sdk::plugin - Rust
pub enum GraphEncoding {
+    OpenVINO,
+    ONNX,
+    TensorFlow,
+    PyTorch,
+    TensorFlowLite,
+    Autodetect,
+    GGML,
+}
Available on crate feature wasi_nn only.
Expand description

Describes the encoding of the graph.

+

Variants§

§

OpenVINO

§

ONNX

§

TensorFlow

§

PyTorch

§

TensorFlowLite

§

Autodetect

§

GGML

Trait Implementations§

source§

impl Clone for GraphEncoding

source§

fn clone(&self) -> GraphEncoding

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GraphEncoding

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for GraphEncoding

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for GraphEncoding

§

type Err = WasmEdgeError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Ord for GraphEncoding

source§

fn cmp(&self, other: &GraphEncoding) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for GraphEncoding

source§

fn eq(&self, other: &GraphEncoding) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for GraphEncoding

source§

fn partial_cmp(&self, other: &GraphEncoding) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for GraphEncoding

source§

impl StructuralEq for GraphEncoding

source§

impl StructuralPartialEq for GraphEncoding

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/ffi/index.html b/wasmedge_sdk/plugin/ffi/index.html new file mode 100644 index 000000000..47d935069 --- /dev/null +++ b/wasmedge_sdk/plugin/ffi/index.html @@ -0,0 +1,2 @@ +wasmedge_sdk::plugin::ffi - Rust

Module wasmedge_sdk::plugin::ffi

source ·
Expand description

Defines low-level types used in Plugin development.

+

Structs

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/ffi/sidebar-items.js b/wasmedge_sdk/plugin/ffi/sidebar-items.js new file mode 100644 index 000000000..048f6f7c4 --- /dev/null +++ b/wasmedge_sdk/plugin/ffi/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["WasmEdge_ModuleDescriptor","WasmEdge_ModuleInstanceContext","WasmEdge_PluginDescriptor"]}; \ No newline at end of file diff --git a/wasmedge_sdk/plugin/ffi/struct.WasmEdge_ModuleDescriptor.html b/wasmedge_sdk/plugin/ffi/struct.WasmEdge_ModuleDescriptor.html new file mode 100644 index 000000000..dadbad6ab --- /dev/null +++ b/wasmedge_sdk/plugin/ffi/struct.WasmEdge_ModuleDescriptor.html @@ -0,0 +1,18 @@ +WasmEdge_ModuleDescriptor in wasmedge_sdk::plugin::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ModuleDescriptor { + pub Name: *const i8, + pub Description: *const i8, + pub Create: Option<unsafe extern "C" fn(_: *const WasmEdge_ModuleDescriptor) -> *mut WasmEdge_ModuleInstanceContext>, +}
Expand description

Module descriptor for plugins.

+

Fields§

§Name: *const i8§Description: *const i8§Create: Option<unsafe extern "C" fn(_: *const WasmEdge_ModuleDescriptor) -> *mut WasmEdge_ModuleInstanceContext>

Trait Implementations§

§

impl Clone for WasmEdge_ModuleDescriptor

§

fn clone(&self) -> WasmEdge_ModuleDescriptor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for WasmEdge_ModuleDescriptor

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Copy for WasmEdge_ModuleDescriptor

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/ffi/struct.WasmEdge_ModuleInstanceContext.html b/wasmedge_sdk/plugin/ffi/struct.WasmEdge_ModuleInstanceContext.html new file mode 100644 index 000000000..43f253dae --- /dev/null +++ b/wasmedge_sdk/plugin/ffi/struct.WasmEdge_ModuleInstanceContext.html @@ -0,0 +1,13 @@ +WasmEdge_ModuleInstanceContext in wasmedge_sdk::plugin::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ModuleInstanceContext { /* private fields */ }

Trait Implementations§

§

impl Clone for WasmEdge_ModuleInstanceContext

§

fn clone(&self) -> WasmEdge_ModuleInstanceContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for WasmEdge_ModuleInstanceContext

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Copy for WasmEdge_ModuleInstanceContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/ffi/struct.WasmEdge_PluginDescriptor.html b/wasmedge_sdk/plugin/ffi/struct.WasmEdge_PluginDescriptor.html new file mode 100644 index 000000000..a5e0a7a59 --- /dev/null +++ b/wasmedge_sdk/plugin/ffi/struct.WasmEdge_PluginDescriptor.html @@ -0,0 +1,23 @@ +WasmEdge_PluginDescriptor in wasmedge_sdk::plugin::ffi - Rust
#[repr(C)]
pub struct WasmEdge_PluginDescriptor { + pub Name: *const i8, + pub Description: *const i8, + pub APIVersion: u32, + pub Version: WasmEdge_PluginVersionData, + pub ModuleCount: u32, + pub ProgramOptionCount: u32, + pub ModuleDescriptions: *mut WasmEdge_ModuleDescriptor, + pub ProgramOptions: *mut WasmEdge_ProgramOption, +}
Expand description

Plugin descriptor for plugins.

+

Fields§

§Name: *const i8§Description: *const i8§APIVersion: u32§Version: WasmEdge_PluginVersionData§ModuleCount: u32§ProgramOptionCount: u32§ModuleDescriptions: *mut WasmEdge_ModuleDescriptor§ProgramOptions: *mut WasmEdge_ProgramOption

Trait Implementations§

§

impl Clone for WasmEdge_PluginDescriptor

§

fn clone(&self) -> WasmEdge_PluginDescriptor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for WasmEdge_PluginDescriptor

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Copy for WasmEdge_PluginDescriptor

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/index.html b/wasmedge_sdk/plugin/index.html new file mode 100644 index 000000000..bf97aee40 --- /dev/null +++ b/wasmedge_sdk/plugin/index.html @@ -0,0 +1,2 @@ +wasmedge_sdk::plugin - Rust

Module wasmedge_sdk::plugin

source ·
Expand description

Defines plugin related structs.

+

Modules

  • Defines low-level types used in Plugin development.

Structs

Enums

Type Aliases

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/sidebar-items.js b/wasmedge_sdk/plugin/sidebar-items.js new file mode 100644 index 000000000..e96547c07 --- /dev/null +++ b/wasmedge_sdk/plugin/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ExecutionTarget","GraphEncoding"],"mod":["ffi"],"struct":["NNPreload","Plugin","PluginDescriptor","PluginManager","PluginModule","PluginModuleBuilder","PluginVersion"],"type":["ModuleInstanceCreateFn","PluginInstance","ProgramOptionType"]}; \ No newline at end of file diff --git a/wasmedge_sdk/plugin/struct.NNPreload.html b/wasmedge_sdk/plugin/struct.NNPreload.html new file mode 100644 index 000000000..d2f44ee03 --- /dev/null +++ b/wasmedge_sdk/plugin/struct.NNPreload.html @@ -0,0 +1,35 @@ +NNPreload in wasmedge_sdk::plugin - Rust
pub struct NNPreload { /* private fields */ }
Available on crate feature wasi_nn only.
Expand description

Preload config for initializing the wasi_nn plug-in.

+

Implementations§

source§

impl NNPreload

source

pub fn new( + alias: impl AsRef<str>, + backend: GraphEncoding, + target: ExecutionTarget, + path: impl AsRef<Path> +) -> Self

Creates a new preload config.

+
Arguments
+
    +
  • +

    alias - The alias of the model in the WASI-NN environment.

    +
  • +
  • +

    backend - The inference backend.

    +
  • +
  • +

    target - The execution target, on which the inference runs.

    +
  • +
  • +

    path - The path to the model file. Note that the path is the guest path instead of the host path.

    +
  • +
+

Trait Implementations§

source§

impl Debug for NNPreload

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for NNPreload

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for NNPreload

§

type Err = WasmEdgeError

The associated error which can be returned from parsing.
source§

fn from_str(preload: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/struct.Plugin.html b/wasmedge_sdk/plugin/struct.Plugin.html new file mode 100644 index 000000000..aee4419b7 --- /dev/null +++ b/wasmedge_sdk/plugin/struct.Plugin.html @@ -0,0 +1,26 @@ +Plugin in wasmedge_sdk::plugin - Rust

Struct wasmedge_sdk::plugin::Plugin

source ·
pub struct Plugin { /* private fields */ }
Expand description

Represents a loaded plugin. It provides the APIs for accessing the plugin.

+

Implementations§

source§

impl Plugin

source

pub fn name(&self) -> String

Returns the name of this plugin.

+
source

pub fn mod_count(&self) -> u32

Returns the count of the module instances in this plugin.

+
source

pub fn mod_names(&self) -> Vec<String>

Returns the names of all module instances in this plugin.

+
source

pub fn mod_instance( + &self, + name: impl AsRef<str> +) -> WasmEdgeResult<PluginInstance>

Returns a module instance that is generated from the module with the given name in this plugin.

+
Argument
+
    +
  • name - The name of the target module.
  • +
+
Error
+

If failed to return the plugin module instance, then return PluginError::Create error.

+

Trait Implementations§

source§

impl Debug for Plugin

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/struct.PluginDescriptor.html b/wasmedge_sdk/plugin/struct.PluginDescriptor.html new file mode 100644 index 000000000..d834f34b0 --- /dev/null +++ b/wasmedge_sdk/plugin/struct.PluginDescriptor.html @@ -0,0 +1,73 @@ +PluginDescriptor in wasmedge_sdk::plugin - Rust
pub struct PluginDescriptor { /* private fields */ }
Expand description

Represents Plugin descriptor for plugins.

+

Implementations§

source§

impl PluginDescriptor

source

pub fn new( + name: impl AsRef<str>, + desc: impl AsRef<str>, + version: PluginVersion +) -> WasmEdgeResult<Self>

Creates a new plugin descriptor.

+
Arguments
+
    +
  • +

    name - The name of the plugin.

    +
  • +
  • +

    desc - The description of the plugin.

    +
  • +
  • +

    version - The version of the plugin.

    +
  • +
+
Error
+

If fail to create the plugin descriptor, then an error will be returned.

+
source

pub fn add_module_descriptor( + self, + name: impl AsRef<str>, + desc: impl AsRef<str>, + f: Option<ModuleInstanceCreateFn> +) -> WasmEdgeResult<Self>

Adds a module descriptor to the plugin descriptor.

+
Arguments
+
    +
  • +

    name - The name of the module.

    +
  • +
  • +

    desc - The description of the module.

    +
  • +
  • +

    f - The function that creates a module instance for the plugin.

    +
  • +
+
Error
+

If fail to add the module descriptor, then an error will be returned.

+
source

pub fn add_program_option( + self, + name: impl AsRef<str>, + desc: impl AsRef<str>, + ty: ProgramOptionType +) -> WasmEdgeResult<Self>

Adds a program option to the plugin descriptor.

+
Arguments
+
    +
  • +

    name - The name of the program option.

    +
  • +
  • +

    desc - The description of the program option.

    +
  • +
  • +

    ty - The type of the program option.

    +
  • +
+
Error
+

If fail to add the program option, then an error will be returned.

+
source

pub fn as_raw_ptr(&self) -> *const WasmEdge_PluginDescriptor

Available on crate feature ffi only.

Returns the raw pointer to the inner WasmEdge_PluginDescriptor.

+

Trait Implementations§

source§

impl Debug for PluginDescriptor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/struct.PluginManager.html b/wasmedge_sdk/plugin/struct.PluginManager.html new file mode 100644 index 000000000..91d04f85c --- /dev/null +++ b/wasmedge_sdk/plugin/struct.PluginManager.html @@ -0,0 +1,89 @@ +PluginManager in wasmedge_sdk::plugin - Rust
pub struct PluginManager {}
Expand description

Defines the API to manage plugins.

+

Implementations§

source§

impl PluginManager

source

pub fn load(path: Option<&Path>) -> WasmEdgeResult<()>

Load plugins from the given path.

+
    +
  • +

    If the path is not given, then the default plugin paths will be used. The default plugin paths are

    +
      +
    • +

      The environment variable “WASMEDGE_PLUGIN_PATH”.

      +
    • +
    • +

      The ../plugin/ directory related to the WasmEdge installation path.

      +
    • +
    • +

      The wasmedge/ directory under the library path if the WasmEdge is installed under the “/usr”.

      +
    • +
    +
  • +
  • +

    If the path is given, then

    +
      +
    • +

      If the path is pointing at a file , then it indicates that a single plugin will be loaded from the file.

      +
    • +
    • +

      If the path is pointing at a directory, then the method will load plugins from the files in the directory.

      +
    • +
    +
  • +
+
Argument
+
    +
  • path - A path to a plugin file or a directory holding plugin files. If None, then the default plugin path will be used.
  • +
+
source

pub fn nn_preload(preloads: Vec<NNPreload>)

Available on crate feature wasi_nn only.

Initialize the wasi_nn plug-in with the preloads.

+

Note that this function is only available after loading the wasi_nn plug-in and before creating, and before creating the module instance from the plug-in.

+
Argument
+
    +
  • preloads - The preload list.
  • +
+
Example
+
// load wasinn-pytorch-plugin from the default plugin directory: /usr/local/lib/wasmedge
+PluginManager::load(None)?;
+// preload named model
+PluginManager::nn_preload(vec![NNPreload::new(
+    "default",
+    GraphEncoding::GGML,
+    ExecutionTarget::CPU,
+    "llama-2-7b-chat.Q5_K_M.gguf",
+)]);
+

If a preload is string, then use NNPreload::from_str to create a NNPreload instance:

+ +
use std::str::FromStr;
+
+// load wasinn-pytorch-plugin from the default plugin directory: /usr/local/lib/wasmedge
+PluginManager::load(None)?;
+// preload named model
+PluginManager::nn_preload(vec![NNPreload::from_str("default:GGML:CPU:llama-2-7b-chat.Q5_K_M.gguf")?]);
+
+
source

pub fn count() -> u32

Returns the count of loaded plugins.

+
source

pub fn names() -> Vec<String>

Returns the names of all loaded plugins.

+
source

pub fn find(name: impl AsRef<str>) -> WasmEdgeResult<Plugin>

Returns the target plugin by its name.

+
Argument
+
    +
  • name - The name of the target plugin.
  • +
+
Error
+

If failed to return the plugin module instance, then return PluginError::NotFound error.

+
source

pub fn init_wasmedge_process(allowed_cmds: Option<Vec<&str>>, allowed: bool)

Available on Linux and crate feature wasmedge_process and non-crate feature static only.

Initializes the wasmedge_process plugin module instance with the parameters.

+
Arguments
+
    +
  • +

    allowed_cmds - A white list of commands.

    +
  • +
  • +

    allowed - Determines if wasmedge_process is allowed to execute all commands on the white list.

    +
  • +
+

Trait Implementations§

source§

impl Debug for PluginManager

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/struct.PluginModule.html b/wasmedge_sdk/plugin/struct.PluginModule.html new file mode 100644 index 000000000..a7d21788a --- /dev/null +++ b/wasmedge_sdk/plugin/struct.PluginModule.html @@ -0,0 +1,17 @@ +PluginModule in wasmedge_sdk::plugin - Rust
pub struct PluginModule(/* private fields */);
Expand description

Defines an import object that contains the required import data used when instantiating a module.

+

An PluginModule instance is created with PluginModuleBuilder.

+

Implementations§

source§

impl PluginModule

source

pub fn name(&self) -> &str

Returns the name of the plugin module instance.

+
source

pub fn as_raw_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Returns the raw pointer to the inner WasmEdge_ModuleInstanceContext.

+

Trait Implementations§

source§

impl Clone for PluginModule

source§

fn clone(&self) -> PluginModule

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PluginModule

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/struct.PluginModuleBuilder.html b/wasmedge_sdk/plugin/struct.PluginModuleBuilder.html new file mode 100644 index 000000000..a10f250b9 --- /dev/null +++ b/wasmedge_sdk/plugin/struct.PluginModuleBuilder.html @@ -0,0 +1,86 @@ +PluginModuleBuilder in wasmedge_sdk::plugin - Rust
pub struct PluginModuleBuilder<T: ?Sized + Send + Sync + Clone> { /* private fields */ }
Expand description

Implementations§

source§

impl<T: ?Sized + Send + Sync + Clone> PluginModuleBuilder<T>

source

pub fn new() -> Self

Creates a new PluginModuleBuilder.

+
source

pub fn with_func<Args, Rets, D>( + self, + name: impl AsRef<str>, + real_func: impl Fn(CallingFrame, Vec<WasmValue>, *mut c_void) -> Result<Vec<WasmValue>, HostFuncError> + Send + Sync + 'static, + data: Option<Box<D>> +) -> WasmEdgeResult<Self>where + Args: WasmValTypeList, + Rets: WasmValTypeList,

Adds a host function to the crate::ImportObject to create.

+

N.B. that this function can be used in thread-safe scenarios.

+
Arguments
+
    +
  • +

    name - The exported name of the host function to add.

    +
  • +
  • +

    real_func - The native function.

    +
  • +
  • +

    data - The additional data object to set to this host function context.

    +
  • +
+
error
+

If fail to create or add the host function, then an error is returned.

+
source

pub fn with_global(self, name: impl AsRef<str>, global: Global) -> Self

Adds a global to the PluginModule to create.

+
Arguments
+ +
source

pub fn with_memory(self, name: impl AsRef<str>, memory: Memory) -> Self

Adds a memory to the PluginModule to create.

+
Arguments
+ +
source

pub fn with_table(self, name: impl AsRef<str>, table: Table) -> Self

Adds a table to the PluginModule to create.

+
Arguments
+
    +
  • +

    name - The exported name of the table to add.

    +
  • +
  • +

    table - The wasm table instance to add.

    +
  • +
+
source

pub fn with_host_data(self, host_data: Box<T>) -> Self

Adds host data to the PluginModule to create.

+
Arguments
+
    +
  • +

    host_data - The host data to be stored in the module instance.

    +
  • +
  • +

    finalizer - The function to drop the host data. Notice that this argument is available only if host_data is set some value.

    +
  • +
+
source

pub fn build(self, name: impl AsRef<str>) -> WasmEdgeResult<PluginModule>

Creates a new PluginModule.

+
Argument
+ +
Error
+

If fail to create the PluginModule, then an error is returned.

+

Trait Implementations§

source§

impl<T: Debug + ?Sized + Send + Sync + Clone> Debug for PluginModuleBuilder<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default + ?Sized + Send + Sync + Clone> Default for PluginModuleBuilder<T>

source§

fn default() -> PluginModuleBuilder<T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/struct.PluginVersion.html b/wasmedge_sdk/plugin/struct.PluginVersion.html new file mode 100644 index 000000000..a2692dc94 --- /dev/null +++ b/wasmedge_sdk/plugin/struct.PluginVersion.html @@ -0,0 +1,16 @@ +PluginVersion in wasmedge_sdk::plugin - Rust
pub struct PluginVersion {
+    pub inner: PluginVersion,
+}
Expand description

Defines the version of a plugin.

+

Fields§

§inner: PluginVersion

Implementations§

source§

impl PluginVersion

source

pub fn new(major: u32, minor: u32, patch: u32, build: u32) -> Self

Creates a new plugin version.

+

Trait Implementations§

source§

impl Debug for PluginVersion

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/plugin/type.ModuleInstanceCreateFn.html b/wasmedge_sdk/plugin/type.ModuleInstanceCreateFn.html new file mode 100644 index 000000000..fafdb32e6 --- /dev/null +++ b/wasmedge_sdk/plugin/type.ModuleInstanceCreateFn.html @@ -0,0 +1,2 @@ +ModuleInstanceCreateFn in wasmedge_sdk::plugin - Rust
pub type ModuleInstanceCreateFn = ModuleInstanceCreateFn;
Expand description

Defines the type of the function that creates a module instance for a plugin.

+
\ No newline at end of file diff --git a/wasmedge_sdk/plugin/type.PluginInstance.html b/wasmedge_sdk/plugin/type.PluginInstance.html new file mode 100644 index 000000000..d1db6321e --- /dev/null +++ b/wasmedge_sdk/plugin/type.PluginInstance.html @@ -0,0 +1 @@ +PluginInstance in wasmedge_sdk::plugin - Rust
pub type PluginInstance = Instance;

Aliased Type§

struct PluginInstance { /* private fields */ }
\ No newline at end of file diff --git a/wasmedge_sdk/plugin/type.ProgramOptionType.html b/wasmedge_sdk/plugin/type.ProgramOptionType.html new file mode 100644 index 000000000..f0e0e1ed8 --- /dev/null +++ b/wasmedge_sdk/plugin/type.ProgramOptionType.html @@ -0,0 +1,16 @@ +ProgramOptionType in wasmedge_sdk::plugin - Rust
pub type ProgramOptionType = ProgramOptionType;
Expand description

Defines the type of the program options.

+

Aliased Type§

enum ProgramOptionType {
+
Show 13 variants None = 0, + Toggle = 1, + I8 = 2, + I16 = 3, + I32 = 4, + I64 = 5, + U8 = 6, + U16 = 7, + U32 = 8, + U64 = 9, + F32 = 10, + F64 = 11, + String = 12, +
}

Variants§

§

None = 0

§

Toggle = 1

§

I8 = 2

§

I16 = 3

§

I32 = 4

§

I64 = 5

§

U8 = 6

§

U16 = 7

§

U32 = 8

§

U64 = 9

§

F32 = 10

§

F64 = 11

§

String = 12

\ No newline at end of file diff --git a/wasmedge_sdk/sidebar-items.js b/wasmedge_sdk/sidebar-items.js new file mode 100644 index 000000000..f4a502577 --- /dev/null +++ b/wasmedge_sdk/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"attr":["host_function"],"enum":["CompilerOptimizationLevel","CompilerOutputFormat","ExternalInstanceType","HostRegistration","Mutability","RefType","ValType"],"fn":["wat2wasm"],"macro":["params"],"mod":["config","dock","error","plugin","types","utils","wasi"],"struct":["Caller","Compiler","Executor","ExportType","Func","FuncRef","FuncType","FuncTypeBuilder","Global","GlobalType","ImportObject","ImportObjectBuilder","ImportType","Instance","LogManager","Memory","MemoryType","Module","Statistics","Store","Table","TableType","Vm","VmBuilder"],"trait":["AsInstance","Engine","WasmVal","WasmValType","WasmValTypeList"],"type":["NeverType","WasmEdgeResult","WasmValue"]}; \ No newline at end of file diff --git a/wasmedge_sdk/statistics/struct.Statistics.html b/wasmedge_sdk/statistics/struct.Statistics.html new file mode 100644 index 000000000..d3cd8648d --- /dev/null +++ b/wasmedge_sdk/statistics/struct.Statistics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.Statistics.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/store/struct.Store.html b/wasmedge_sdk/store/struct.Store.html new file mode 100644 index 000000000..dd6c2b44e --- /dev/null +++ b/wasmedge_sdk/store/struct.Store.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.Store.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/struct.Caller.html b/wasmedge_sdk/struct.Caller.html new file mode 100644 index 000000000..49e8519c4 --- /dev/null +++ b/wasmedge_sdk/struct.Caller.html @@ -0,0 +1,28 @@ +Caller in wasmedge_sdk - Rust

Struct wasmedge_sdk::Caller

source ·
pub struct Caller { /* private fields */ }
Expand description

Represents the calling frame on top of stack.

+

The Caller object is only used as the first argument when defining a host function. With this argument, +developers can have access to the Executor instance, the Instance instance, and the Memory instance inside the host functions they defined.

+

Implementations§

source§

impl Caller

source

pub fn new(frame: CallingFrame) -> Self

Creates a Caller instance with the given CallingFrame instance.

+
Caller vs. CallingFrame
+

CallingFrame is a low-level type defined in wasmedge-sys crate, while Caller is a high-level type. For developers using the APIs in wasmedge-sdk, they should create a Caller instance with the given CallingFrame instance, as Caller provides APIs to access high-level instances, such as executor and memory, related to the current calling frame.

+
source

pub fn executor(&self) -> Option<&Executor>

Returns the executor instance from this caller.

+
source

pub fn executor_mut(&mut self) -> Option<&mut Executor>

Returns the mutable executor instance from this caller.

+
source

pub fn instance(&self) -> Option<&Instance>

Returns the module instance in this caller.

+
source

pub fn instance_mut(&mut self) -> Option<&mut Instance>

Returns the mutable module instance in this caller.

+
source

pub fn memory(&self, idx: u32) -> Option<Memory>

Returns the memory instance by the given index from the module instance of this caller. If +the memory instance is not found, then return None.

+
Arguments
+
    +
  • idx - The index of the memory instance. By default, a WASM module has only one memory instance after instantiation. Therefore, users can pass in 0 as the index to get the memory instance in host function body. When the MultiMemories config option is enabled, there would be more than one memory instances in the wasm module. Users can retrieve the target memory instance by specifying the index of the memory instance in the wasm module instance.
  • +
+

Trait Implementations§

source§

impl Debug for Caller

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<CallingFrame> for Caller

source§

fn from(frame: CallingFrame) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Caller

§

impl Send for Caller

§

impl Sync for Caller

§

impl Unpin for Caller

§

impl !UnwindSafe for Caller

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Compiler.html b/wasmedge_sdk/struct.Compiler.html new file mode 100644 index 000000000..d2464c9b3 --- /dev/null +++ b/wasmedge_sdk/struct.Compiler.html @@ -0,0 +1,56 @@ +Compiler in wasmedge_sdk - Rust

Struct wasmedge_sdk::Compiler

source ·
pub struct Compiler { /* private fields */ }
Available on crate feature aot only.
Expand description

Defines WasmEdge ahead-of-time(AOT) compiler and the relevant APIs.

+

Implementations§

source§

impl Compiler

source

pub fn new(config: Option<&Config>) -> WasmEdgeResult<Self>

Creates a new AOT compiler.

+
Error
+

If fail to create a AOT compiler, then an error is returned.

+
source

pub fn compile_from_file( + &self, + wasm_file: impl AsRef<Path>, + filename: impl AsRef<str>, + out_dir: impl AsRef<Path> +) -> WasmEdgeResult<PathBuf>

Compiles the given wasm file into a shared library file (*.so in Linux, *.dylib in macOS, or *.dll in Windows). The file path of the generated shared library file will be returned if the method works successfully.

+
Arguments
+
    +
  • +

    wasm_file - The target wasm file.

    +
  • +
  • +

    filename - The filename of the generated shared library file.

    +
  • +
  • +

    out_dir - The target directory to save the generated shared library file.

    +
  • +
+
Error
+

If fail to compile, then an error is returned.

+
source

pub fn compile_from_bytes( + &self, + bytes: impl AsRef<[u8]>, + filename: impl AsRef<str>, + out_dir: impl AsRef<Path> +) -> WasmEdgeResult<PathBuf>

Compiles the given wasm bytes into a shared library file (*.so in Linux, *.dylib in macOS, or *.dll in Windows). The file path of the generated shared library file will be returned if the method works successfully.

+
Argument
+
    +
  • +

    bytes - A in-memory WASM bytes.

    +
  • +
  • +

    filename - The filename of the generated shared library file.

    +
  • +
  • +

    out_dir - The target directory to save the generated shared library file.

    +
  • +
+
Error
+

If fail to compile, then an error is returned.

+

Trait Implementations§

source§

impl Debug for Compiler

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Executor.html b/wasmedge_sdk/struct.Executor.html new file mode 100644 index 000000000..2fc1b0734 --- /dev/null +++ b/wasmedge_sdk/struct.Executor.html @@ -0,0 +1,81 @@ +Executor in wasmedge_sdk - Rust

Struct wasmedge_sdk::Executor

source ·
pub struct Executor { /* private fields */ }
Expand description

Defines an execution environment for both pure WASM and compiled WASM.

+

Implementations§

source§

impl Executor

source

pub fn new( + config: Option<&Config>, + stat: Option<&mut Statistics> +) -> WasmEdgeResult<Self>

Creates a new executor to be associated with the given config and statistics.

+
Arguments
+ +
Error
+

If fail to create a executor, then an error is returned.

+
source

pub fn run_func( + &self, + func: &Func, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance and returns the results.

+
Arguments
+
    +
  • +

    func - The function instance to run.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
+
Errors
+

If fail to run the host function, then an error is returned.

+
source

pub fn run_func_with_timeout( + &self, + func: &Func, + params: impl IntoIterator<Item = WasmValue>, + timeout: Duration +) -> WasmEdgeResult<Vec<WasmValue>>

Available on Linux and non-musl only.

Runs a host function instance with a timeout setting.

+
Arguments
+
    +
  • +

    func - The function instance to run.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
  • +

    timeout - The maximum execution time of the function to be run.

    +
  • +
+
Errors
+

If fail to run the host function, then an error is returned.

+
source

pub fn run_func_ref( + &self, + func_ref: &FuncRef, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function reference instance and returns the results.

+
Arguments
+
    +
  • +

    func_ref - The function reference instance to run.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
+
Errors
+

If fail to run the host function reference instance, then an error is returned.

+

Trait Implementations§

source§

impl Clone for Executor

source§

fn clone(&self) -> Executor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Executor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.ExportType.html b/wasmedge_sdk/struct.ExportType.html new file mode 100644 index 000000000..3da250dd7 --- /dev/null +++ b/wasmedge_sdk/struct.ExportType.html @@ -0,0 +1,15 @@ +ExportType in wasmedge_sdk - Rust
pub struct ExportType<'module> { /* private fields */ }
Expand description

Defines the types of the exported instances.

+

Implementations§

source§

impl<'module> ExportType<'module>

source

pub fn name(&self) -> Cow<'_, str>

Returns the exported name of the WasmEdge instance.

+
source

pub fn ty(&self) -> WasmEdgeResult<ExternalInstanceType>

Returns the type of the exported WasmEdge instance, which is one of the types defined in ExternalInstanceType.

+

Trait Implementations§

source§

impl<'module> Debug for ExportType<'module>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'module> RefUnwindSafe for ExportType<'module>

§

impl<'module> Send for ExportType<'module>

§

impl<'module> Sync for ExportType<'module>

§

impl<'module> Unpin for ExportType<'module>

§

impl<'module> UnwindSafe for ExportType<'module>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Func.html b/wasmedge_sdk/struct.Func.html new file mode 100644 index 000000000..08d9b9b7b --- /dev/null +++ b/wasmedge_sdk/struct.Func.html @@ -0,0 +1,99 @@ +Func in wasmedge_sdk - Rust

Struct wasmedge_sdk::Func

source ·
pub struct Func { /* private fields */ }
Expand description

Defines a host function instance.

+

A WasmEdge Func is a wasm function instance, which is a “wrapper” of the original function (defined in either the host or the WebAssembly module) over the runtime module instance of its originating module.

+

Implementations§

source§

impl Func

source

pub fn wrap<Args, Rets, T>( + real_func: impl Fn(CallingFrame, Vec<WasmValue>, *mut c_void) -> Result<Vec<WasmValue>, HostFuncError> + Send + Sync + 'static, + data: Option<Box<T>> +) -> WasmEdgeResult<Self>where + Args: WasmValTypeList, + Rets: WasmValTypeList,

Creates a host function by wrapping a native function.

+

N.B. that this function can be used in thread-safe scenarios.

+
Arguments
+
    +
  • +

    real_func - The native function to be wrapped.

    +
  • +
  • +

    data - The host context data used in this function.

    +
  • +
+
Error
+ +
source

pub fn wrap_with_type<T>( + ty: FuncType, + real_func: impl Fn(CallingFrame, Vec<WasmValue>, *mut c_void) -> Result<Vec<WasmValue>, HostFuncError> + Send + Sync + 'static, + data: Option<Box<T>> +) -> WasmEdgeResult<Self>

Creates a host function with the given func type.

+

N.B. that this function can be used in thread-safe scenarios.

+
Arguments
+
    +
  • +

    ty - The function type.

    +
  • +
  • +

    real_func - The native function that will be wrapped as a host function.

    +
  • +
  • +

    data - The host context data used in this function.

    +
  • +
+
Error
+ +
source

pub fn name(&self) -> Option<&str>

Returns the exported name of this function.

+

Notice that this field is meaningful only if this host function is used as an exported instance.

+
source

pub fn mod_name(&self) -> Option<&str>

Returns the name of the module instance from which this function exports.

+

Notice that this field is meaningful only if this host function is used as an exported instance.

+
source

pub fn ty(&self) -> &FuncType

Returns a reference to the type of the host function.

+
source

pub fn as_ref(&self) -> FuncRef

Returns a reference to this function instance.

+
source

pub fn run( + &self, + executor: &Executor, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs this host function and returns the result.

+
Arguments
+
    +
  • +

    executor - The Executor instance.

    +
  • +
  • +

    args - The arguments passed to the host function.

    +
  • +
+
Error
+

If fail to run the host function, then an error is returned.

+
source

pub fn run_with_timeout( + &self, + executor: &Executor, + args: impl IntoIterator<Item = WasmValue>, + timeout: Duration +) -> WasmEdgeResult<Vec<WasmValue>>

Available on Linux and non-musl only.

Runs this host function with a timeout setting.

+
Arguments
+
    +
  • +

    executor - The Executor instance.

    +
  • +
  • +

    args - The arguments passed to the host function.

    +
  • +
  • +

    timeout - The maximum execution time of the function to be run.

    +
  • +
+
Error
+

If fail to run the host function, then an error is returned.

+

Trait Implementations§

source§

impl Clone for Func

source§

fn clone(&self) -> Func

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Func

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Func

§

impl Send for Func

§

impl Sync for Func

§

impl Unpin for Func

§

impl !UnwindSafe for Func

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.FuncRef.html b/wasmedge_sdk/struct.FuncRef.html new file mode 100644 index 000000000..475809634 --- /dev/null +++ b/wasmedge_sdk/struct.FuncRef.html @@ -0,0 +1,34 @@ +FuncRef in wasmedge_sdk - Rust

Struct wasmedge_sdk::FuncRef

source ·
pub struct FuncRef { /* private fields */ }
Expand description

Defines a reference to a host function.

+

The table_and_funcref example presents how to obtain and use FuncRef.

+

Implementations§

source§

impl FuncRef

source

pub fn ty(&self) -> &FuncType

Returns a reference to the ty of the host function this FuncRef points to.

+
source

pub fn run( + &self, + executor: &Executor, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs this host function the reference refers to.

+
Arguments
+
    +
  • +

    executor - The Executor instance.

    +
  • +
  • +

    args - The arguments passed to the host function.

    +
  • +
+
Error
+

If fail to run the host function, then an error is returned.

+

Trait Implementations§

source§

impl Clone for FuncRef

source§

fn clone(&self) -> FuncRef

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FuncRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl WasmVal for FuncRef

source§

impl WasmValType for FuncRef

source§

const WASM_TYPE: ValType = ValType::FuncRef

The Wasm type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<A1> WasmValTypeList for A1where + A1: WasmValType,

§

type Array = [i128; 1]

The array type that can hold all the represented values. Read more
source§

fn wasm_types() -> &'static [ValType]

Get the Wasm types for the tuple (list) of currently +represented values.
\ No newline at end of file diff --git a/wasmedge_sdk/struct.FuncType.html b/wasmedge_sdk/struct.FuncType.html new file mode 100644 index 000000000..bc788bb10 --- /dev/null +++ b/wasmedge_sdk/struct.FuncType.html @@ -0,0 +1,34 @@ +FuncType in wasmedge_sdk - Rust

Struct wasmedge_sdk::FuncType

pub struct FuncType { /* private fields */ }
Expand description

Struct of WasmEdge FuncType.

+

A FuncType is used to declare the types of the parameters and return values of a WasmEdge Func to be created.

+

Implementations§

§

impl FuncType

pub fn new( + args: Option<Vec<ValType>>, + returns: Option<Vec<ValType>> +) -> FuncType

Creates a new FuncType with the given types of arguments and returns.

+
Arguments
+
    +
  • +

    args - A vector of ValTypes that represent the types of the arguments.

    +
  • +
  • +

    returns - A vector of ValTypes that represent the types of the returns.

    +
  • +
+

pub fn args(&self) -> Option<&[ValType]>

Returns the types of the arguments of a host function.

+

pub fn args_len(&self) -> u32

Returns the number of the arguments of a host function.

+

pub fn returns(&self) -> Option<&[ValType]>

Returns the types of the returns of a host function.

+

pub fn returns_len(&self) -> u32

Returns the number of the returns of a host function.

+

Trait Implementations§

§

impl Clone for FuncType

§

fn clone(&self) -> FuncType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for FuncType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for FuncType

§

fn default() -> FuncType

Returns the “default value” for a type. Read more
§

impl From<FuncType> for FuncType

§

fn from(ty: FuncType) -> FuncType

Converts to this type from the input type.
§

impl PartialEq for FuncType

§

fn eq(&self, other: &FuncType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for FuncType

§

impl StructuralEq for FuncType

§

impl StructuralPartialEq for FuncType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.FuncTypeBuilder.html b/wasmedge_sdk/struct.FuncTypeBuilder.html new file mode 100644 index 000000000..4d9cbc796 --- /dev/null +++ b/wasmedge_sdk/struct.FuncTypeBuilder.html @@ -0,0 +1,27 @@ +FuncTypeBuilder in wasmedge_sdk - Rust
pub struct FuncTypeBuilder { /* private fields */ }
Expand description

Defines a type builder for creating a FuncType instance.

+

Implementations§

source§

impl FuncTypeBuilder

source

pub fn new() -> Self

Creates a new FuncTypeBuilder.

+
source

pub fn with_args(self, args: impl IntoIterator<Item = ValType>) -> Self

Adds arguments to the function type.

+
Argument
+

args specifies the arguments to be added to the function type.

+
source

pub fn with_arg(self, arg: ValType) -> Self

Adds a single argument to the function type.

+
Argument
+

arg specifies the argument to be added to the function type.

+
source

pub fn with_returns(self, returns: impl IntoIterator<Item = ValType>) -> Self

Adds returns to the function type.

+
Argument
+

returns specifies the returns to be added to the function type.

+
source

pub fn with_return(self, ret: ValType) -> Self

Adds a single return to the function type.

+
Argument
+

ret specifies the return to be added to the function type.

+
source

pub fn build(self) -> FuncType

Returns a function type.

+

Trait Implementations§

source§

impl Debug for FuncTypeBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for FuncTypeBuilder

source§

fn default() -> FuncTypeBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Global.html b/wasmedge_sdk/struct.Global.html new file mode 100644 index 000000000..1ac7554a0 --- /dev/null +++ b/wasmedge_sdk/struct.Global.html @@ -0,0 +1,42 @@ +Global in wasmedge_sdk - Rust

Struct wasmedge_sdk::Global

source ·
pub struct Global { /* private fields */ }
Expand description

Defines a WebAssembly global variable, which stores a single value of the given GlobalType and a flag indicating whether it is mutable or not.

+

Implementations§

source§

impl Global

source

pub fn new(ty: GlobalType, init: Val) -> WasmEdgeResult<Self>

Creates a new wasm Global instance with the given type and initial value.

+
Arguments
+
    +
  • +

    ty - The type of the Global instance to be created.

    +
  • +
  • +

    init - The initial value of the Global instance.

    +
  • +
+
Error
+
    +
  • If fail to create the Global instance, then WasmEdgeError::Global(GlobalError::Create)(crate::error::GlobalError) is returned.
  • +
+
source

pub fn name(&self) -> Option<&str>

Returns the exported name of this Global instance.

+

Notice that this field is meaningful only if this Global instance is used as an exported instance.

+
source

pub fn mod_name(&self) -> Option<&str>

Returns the name of the module instance from which this Global instance exports.

+

Notice that this field is meaningful only if this Global instance is used as an exported instance.

+
source

pub fn ty(&self) -> &GlobalType

Returns a reference to the type of this Global instance.

+
source

pub fn get_value(&self) -> Val

Returns the current value of this Global instance.

+
source

pub fn set_value(&mut self, val: Val) -> WasmEdgeResult<()>

Sets a new value of this Global instance.

+

Notice that only global variables of Var type are allowed to perform this function.

+
Argument
+
    +
  • value - The new value of the Global instance.
  • +
+
Error
+

If fail to update the value of the global variable, then an error is returned.

+

Trait Implementations§

source§

impl Clone for Global

source§

fn clone(&self) -> Global

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Global

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Global

§

impl Send for Global

§

impl Sync for Global

§

impl Unpin for Global

§

impl !UnwindSafe for Global

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.GlobalType.html b/wasmedge_sdk/struct.GlobalType.html new file mode 100644 index 000000000..b3c684bb1 --- /dev/null +++ b/wasmedge_sdk/struct.GlobalType.html @@ -0,0 +1,29 @@ +GlobalType in wasmedge_sdk - Rust
pub struct GlobalType { /* private fields */ }
Expand description

Struct of WasmEdge GlobalType.

+

A GlobalType is used to declare the type of a WasmEdge Global to be created.

+

Implementations§

§

impl GlobalType

pub fn new(ty: ValType, mutability: Mutability) -> GlobalType

Creates a new GlobalType with the given value type and mutability.

+
Arguments
+
    +
  • +

    ty - The value type of the global to be created.

    +
  • +
  • +

    mutability - The value mutability property of the global to be created.

    +
  • +
+

pub fn value_ty(&self) -> ValType

Returns the value type defined in the GlobalType.

+

pub fn mutability(&self) -> Mutability

Returns the value mutability property defined in the GlobalType.

+

Trait Implementations§

§

impl Clone for GlobalType

§

fn clone(&self) -> GlobalType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for GlobalType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for GlobalType

§

fn default() -> GlobalType

Returns the “default value” for a type. Read more
§

impl From<GlobalType> for GlobalType

§

fn from(ty: GlobalType) -> GlobalType

Converts to this type from the input type.
§

impl PartialEq for GlobalType

§

fn eq(&self, other: &GlobalType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for GlobalType

§

impl StructuralEq for GlobalType

§

impl StructuralPartialEq for GlobalType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.ImportObject.html b/wasmedge_sdk/struct.ImportObject.html new file mode 100644 index 000000000..4813e17f4 --- /dev/null +++ b/wasmedge_sdk/struct.ImportObject.html @@ -0,0 +1,17 @@ +ImportObject in wasmedge_sdk - Rust
pub struct ImportObject<T: ?Sized + Send + Sync + Clone>(/* private fields */);
Expand description

Defines an import object that contains the required import data used when instantiating a module.

+

An ImportObject instance is created with ImportObjectBuilder.

+

Implementations§

source§

impl<T: ?Sized + Send + Sync + Clone> ImportObject<T>

source

pub fn name(&self) -> &str

Returns the name of the import object.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Returns the raw pointer to the inner WasmEdge_ModuleInstanceContext.

+

Trait Implementations§

source§

impl<T: Clone + ?Sized + Send + Sync + Clone> Clone for ImportObject<T>

source§

fn clone(&self) -> ImportObject<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + ?Sized + Send + Sync + Clone> Debug for ImportObject<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for ImportObject<T>

§

impl<T> Send for ImportObject<T>

§

impl<T> Sync for ImportObject<T>

§

impl<T> Unpin for ImportObject<T>

§

impl<T> !UnwindSafe for ImportObject<T>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.ImportObjectBuilder.html b/wasmedge_sdk/struct.ImportObjectBuilder.html new file mode 100644 index 000000000..dfafc113d --- /dev/null +++ b/wasmedge_sdk/struct.ImportObjectBuilder.html @@ -0,0 +1,111 @@ +ImportObjectBuilder in wasmedge_sdk - Rust
pub struct ImportObjectBuilder { /* private fields */ }
Expand description

Creates a normal or wasi import object.

+

Example

+

This example shows how to create a normal import object that contains a host function, a global variable, a memory and a table. The import object is named “extern”.

+

Implementations§

source§

impl ImportObjectBuilder

source

pub fn new() -> Self

Creates a new ImportObjectBuilder.

+
source

pub fn with_func<Args, Rets, D>( + self, + name: impl AsRef<str>, + real_func: impl Fn(CallingFrame, Vec<WasmValue>, *mut c_void) -> Result<Vec<WasmValue>, HostFuncError> + Send + Sync + 'static, + data: Option<Box<D>> +) -> WasmEdgeResult<Self>where + Args: WasmValTypeList, + Rets: WasmValTypeList,

Adds a host function to the ImportObject to create.

+

N.B. that this function can be used in thread-safe scenarios.

+
Arguments
+
    +
  • +

    name - The exported name of the host function to add.

    +
  • +
  • +

    real_func - The native function.

    +
  • +
  • +

    data - The host context data used in this function.

    +
  • +
+
error
+

If fail to create or add the host function, then an error is returned.

+
source

pub fn with_func_by_type<D>( + self, + name: impl AsRef<str>, + ty: FuncType, + real_func: impl Fn(CallingFrame, Vec<WasmValue>, *mut c_void) -> Result<Vec<WasmValue>, HostFuncError> + Send + Sync + 'static, + data: Option<Box<D>> +) -> WasmEdgeResult<Self>

Adds a host function to the ImportObject to create.

+

N.B. that this function can be used in thread-safe scenarios.

+
Arguments
+
    +
  • +

    name - The exported name of the host function to add.

    +
  • +
  • +

    ty - The function type.

    +
  • +
  • +

    real_func - The native function.

    +
  • +
  • +

    data - The host context data used in this function.

    +
  • +
+
error
+

If fail to create or add the host function, then an error is returned.

+
source

pub fn with_global(self, name: impl AsRef<str>, global: Global) -> Self

Adds a global to the ImportObject to create.

+
Arguments
+ +
source

pub fn with_memory(self, name: impl AsRef<str>, memory: Memory) -> Self

Adds a memory to the ImportObject to create.

+
Arguments
+ +
source

pub fn with_table(self, name: impl AsRef<str>, table: Table) -> Self

Adds a table to the ImportObject to create.

+
Arguments
+
    +
  • +

    name - The exported name of the table to add.

    +
  • +
  • +

    table - The wasm table instance to add.

    +
  • +
+
source

pub fn build<T>( + self, + name: impl AsRef<str>, + host_data: Option<Box<T>> +) -> WasmEdgeResult<ImportObject<T>>where + T: ?Sized + Send + Sync + Clone,

Creates a new ImportObject.

+
Argument
+
    +
  • +

    name - The name of the ImportObject to create.

    +
  • +
  • +

    host_data - The host context data to be stored in the module instance.

    +
  • +
+
Error
+

If fail to create the ImportObject, then an error is returned.

+

Trait Implementations§

source§

impl Debug for ImportObjectBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ImportObjectBuilder

source§

fn default() -> ImportObjectBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.ImportType.html b/wasmedge_sdk/struct.ImportType.html new file mode 100644 index 000000000..3b7e99919 --- /dev/null +++ b/wasmedge_sdk/struct.ImportType.html @@ -0,0 +1,16 @@ +ImportType in wasmedge_sdk - Rust
pub struct ImportType<'module> { /* private fields */ }
Expand description

Defines the types of the imported instances.

+

Implementations§

source§

impl<'module> ImportType<'module>

source

pub fn name(&self) -> Cow<'_, str>

Returns the imported name of the WasmEdge instance.

+
source

pub fn module_name(&self) -> Cow<'_, str>

Returns the name of the module hosting the imported WasmEdge instance.

+
source

pub fn ty(&self) -> WasmEdgeResult<ExternalInstanceType>

Returns the type of the imported WasmEdge instance, which is one of the types defined in ExternalInstanceType.

+

Trait Implementations§

source§

impl<'module> Debug for ImportType<'module>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'module> RefUnwindSafe for ImportType<'module>

§

impl<'module> Send for ImportType<'module>

§

impl<'module> Sync for ImportType<'module>

§

impl<'module> Unpin for ImportType<'module>

§

impl<'module> UnwindSafe for ImportType<'module>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Instance.html b/wasmedge_sdk/struct.Instance.html new file mode 100644 index 000000000..8de3f7bf3 --- /dev/null +++ b/wasmedge_sdk/struct.Instance.html @@ -0,0 +1,46 @@ +Instance in wasmedge_sdk - Rust

Struct wasmedge_sdk::Instance

source ·
pub struct Instance { /* private fields */ }
Expand description

Represents an instantiated module.

+

An Instance represents an instantiated module. In the instantiation process, A module instance is created based on a compiled module. From a [module instance] the exported host function, table, memory, and global instances can be fetched.

+

Implementations§

source§

impl Instance

source

pub fn name(&self) -> Option<String>

Returns the name of this exported module instance.

+

If this module instance is an active instance, return None.

+
source

pub fn func_count(&self) -> usize

Returns the count of the exported function instances in this module instance.

+
source

pub fn func_names(&self) -> Option<Vec<String>>

Returns the names of the exported function instances in this module instance.

+
source

pub fn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func>

Returns the exported function instance in this module instance by the given function name.

+
Argument
+ +
source

pub fn global_count(&self) -> usize

Returns the count of the exported global instances in this module instance.

+
source

pub fn global_names(&self) -> Option<Vec<String>>

Returns the names of the exported global instances in this module instance.

+
source

pub fn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>

Returns the exported global instance in this module instance by the given global name.

+
Argument
+ +
source

pub fn memory_count(&self) -> usize

Returns the count of the exported memory instances in this module instance.

+
source

pub fn memory_names(&self) -> Option<Vec<String>>

Returns the names of the exported memory instances in this module instance.

+
source

pub fn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>

Returns the exported memory instance in this module instance by the given memory name.

+
Argument
+ +
source

pub fn table_count(&self) -> usize

Returns the count of the exported table instances in this module instance.

+
source

pub fn table_names(&self) -> Option<Vec<String>>

Returns the names of the exported table instances in this module instance.

+
source

pub fn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>

Returns the exported table instance in this module instance by the given table name.

+
Argument
+ +
source

pub fn host_data<T: Send + Sync + Clone>(&mut self) -> Option<&mut T>

Returns the host data held by the module instance.

+

Trait Implementations§

source§

impl Clone for Instance

source§

fn clone(&self) -> Instance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Instance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.LogManager.html b/wasmedge_sdk/struct.LogManager.html new file mode 100644 index 000000000..16bfefd6e --- /dev/null +++ b/wasmedge_sdk/struct.LogManager.html @@ -0,0 +1,16 @@ +LogManager in wasmedge_sdk - Rust
pub struct LogManager {}
Expand description

Manipulates the runtime logger.

+

Implementations§

source§

impl LogManager

source

pub fn log_debug_info()

Logs the debug information.

+
source

pub fn log_error_info()

Logs the error information.

+
source

pub fn log_off()

Sets the logging system off.

+

Trait Implementations§

source§

impl Debug for LogManager

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Memory.html b/wasmedge_sdk/struct.Memory.html new file mode 100644 index 000000000..0671d9805 --- /dev/null +++ b/wasmedge_sdk/struct.Memory.html @@ -0,0 +1,106 @@ +Memory in wasmedge_sdk - Rust

Struct wasmedge_sdk::Memory

source ·
pub struct Memory { /* private fields */ }
Expand description

Defines a linear memory.

+

Implementations§

source§

impl Memory

source

pub fn new(ty: MemoryType) -> WasmEdgeResult<Self>

Creates a new wasm memory instance with the given type.

+
Argument
+
    +
  • ty - The type of the memory instance to be created.
  • +
+
Error
+ +
source

pub fn name(&self) -> Option<&str>

Returns the exported name of this memory.

+

Notice that this field is meaningful only if this memory is used as an exported instance.

+
source

pub fn mod_name(&self) -> Option<&str>

Returns the name of the module instance from which this memory exports.

+

Notice that this field is meaningful only if this memory is used as an exported instance.

+
source

pub fn ty(&self) -> &MemoryType

Returns a reference to the type of this memory.

+
source

pub fn page(&self) -> u32

Returns the size, in WebAssembly pages (64 KiB of each page), of this wasm memory.

+
source

pub fn size(&self) -> u64

Returns the byte length of this memory. The returned value will be a multiple of the wasm page size, 64k.

+
source

pub fn read(&self, offset: u32, len: u32) -> WasmEdgeResult<Vec<u8>>

Safely reads memory contents at the given offset into a buffer.

+
Arguments
+
    +
  • +

    offset - The offset from which to read.

    +
  • +
  • +

    len - the length of bytes to read.

    +
  • +
+
Error
+

If fail to read the memory, then an error is returned.

+
source

pub fn read_string(&self, offset: u32, len: u32) -> WasmEdgeResult<String>

Returns a string of byte length len from this memory, starting at offset.

+
Arguments
+
    +
  • +

    offset - The offset from which to read.

    +
  • +
  • +

    len - the length of bytes to read.

    +
  • +
+
Error
+

If fail to read, then an error is returned.

+
source

pub fn write( + &mut self, + data: impl AsRef<[u8]>, + offset: u32 +) -> WasmEdgeResult<()>

Safely writes contents of a buffer to this memory at the given offset.

+
Arguments
+
    +
  • +

    data - The bytes to write to this memory..

    +
  • +
  • +

    offset - The offset at which to write.

    +
  • +
+
Error
+

If fail to write to the memory, then an error is returned.

+
source

pub fn grow(&mut self, count: u32) -> WasmEdgeResult<()>

Grows this memory by the count pages.

+
Argument
+
    +
  • count - The number of pages to grow the memory by.
  • +
+
Error
+

If fail to grow the memory, then an error is returned.

+
source

pub fn data_pointer(&self, offset: u32, len: u32) -> WasmEdgeResult<*const u8>

Returns the const data pointer to this memory.

+
Arguments
+
    +
  • +

    offset - The data start offset in this memory.

    +
  • +
  • +

    len - The requested data length. If the size of offset + len is larger +than the data size in this memory.

    +
  • +
+
Errors
+

If fail to get the data pointer, then an error is returned.

+
source

pub fn data_pointer_mut( + &mut self, + offset: u32, + len: u32 +) -> WasmEdgeResult<*mut u8>

Returns the data pointer to this memory.

+
Arguments
+
    +
  • +

    offset - The data start offset in this memory.

    +
  • +
  • +

    len - The requested data length. If the size of offset + len is larger than the data size in this memory.

    +
  • +
+
Errors
+

If fail to get the data pointer, then an error is returned.

+

Trait Implementations§

source§

impl Clone for Memory

source§

fn clone(&self) -> Memory

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Memory

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Memory

§

impl Send for Memory

§

impl Sync for Memory

§

impl Unpin for Memory

§

impl !UnwindSafe for Memory

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.MemoryType.html b/wasmedge_sdk/struct.MemoryType.html new file mode 100644 index 000000000..337741a35 --- /dev/null +++ b/wasmedge_sdk/struct.MemoryType.html @@ -0,0 +1,37 @@ +MemoryType in wasmedge_sdk - Rust
pub struct MemoryType { /* private fields */ }
Expand description

Struct of WasmEdge MemoryType.

+

A MemoryType is used to declare the size range of a WasmEdge Memory to be created.

+

Implementations§

§

impl MemoryType

pub fn new( + min: u32, + max: Option<u32>, + shared: bool +) -> Result<MemoryType, Box<WasmEdgeError>>

Creates a new MemoryType with the given size range.

+
Arguments
+
    +
  • +

    min - The minimum size of the memory to be created.

    +
  • +
  • +

    max - The maximum size of the memory to be created. If shared is set to true, max must be set.

    +
  • +
  • +

    shared - Enables shared memory if true.

    +
  • +
+

pub fn minimum(&self) -> u32

Returns the minimum size defined in the MemoryType.

+

pub fn maximum(&self) -> Option<u32>

Returns the maximum size defined in the MemoryType.

+

pub fn shared(&self) -> bool

Returns whether the memory is shared.

+

Trait Implementations§

§

impl Clone for MemoryType

§

fn clone(&self) -> MemoryType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for MemoryType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for MemoryType

§

fn default() -> MemoryType

Returns the “default value” for a type. Read more
§

impl From<MemType> for MemoryType

§

fn from(ty: MemType) -> MemoryType

Converts to this type from the input type.
§

impl PartialEq for MemoryType

§

fn eq(&self, other: &MemoryType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for MemoryType

§

impl StructuralEq for MemoryType

§

impl StructuralPartialEq for MemoryType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Module.html b/wasmedge_sdk/struct.Module.html new file mode 100644 index 000000000..4a1e779de --- /dev/null +++ b/wasmedge_sdk/struct.Module.html @@ -0,0 +1,54 @@ +Module in wasmedge_sdk - Rust

Struct wasmedge_sdk::Module

source ·
pub struct Module { /* private fields */ }
Expand description

Defines compiled in-memory representation of an input WASM binary.

+

A Module is a compiled in-memory representation of an input WebAssembly binary. In the instantiation process, a Module is instatiated to a module instance, from which the exported function, table, memory, and global instances can be fetched.

+

Implementations§

source§

impl Module

source

pub fn from_file( + config: Option<&Config>, + file: impl AsRef<Path> +) -> WasmEdgeResult<Self>

Returns a validated module from a file.

+
Arguments
+
    +
  • +

    config - The global configuration.

    +
  • +
  • +

    file - A wasm file or an AOT wasm file.

    +
  • +
+
Error
+

If fail to load and valiate a module from a file, returns an error.

+
source

pub fn from_bytes( + config: Option<&Config>, + bytes: impl AsRef<[u8]> +) -> WasmEdgeResult<Self>

Loads a WebAssembly binary module from in-memory bytes.

+
Arguments
+
    +
  • +

    config - The global configuration.

    +
  • +
  • +

    bytes - The in-memory bytes to be parsed.

    +
  • +
+
Error
+

If fail to load and valiate the WebAssembly module from the given in-memory bytes, returns an error.

+
source

pub fn count_of_imports(&self) -> u32

Returns the count of the imported WasmEdge instances in the module.

+
source

pub fn imports(&self) -> Vec<ImportType<'_>>

Returns the import types of all imported WasmEdge instances in the module.

+
source

pub fn count_of_exports(&self) -> u32

Returns the count of the exported WasmEdge instances from the module.

+
source

pub fn exports(&self) -> Vec<ExportType<'_>>

Returns the export types of all exported WasmEdge instances (including funcs, tables, globals and memories) from the module.

+
source

pub fn get_export(&self, name: impl AsRef<str>) -> Option<ExternalInstanceType>

Gets the export type by the name of a specific exported WasmEdge instance, such as func, table, global or memory instance.

+
Argument
+
    +
  • name - The name of the target exported WasmEdge instance, such as func, table, global or memory instance.
  • +
+

Trait Implementations§

source§

impl Clone for Module

source§

fn clone(&self) -> Module

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Module

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Statistics.html b/wasmedge_sdk/struct.Statistics.html new file mode 100644 index 000000000..89fc9f359 --- /dev/null +++ b/wasmedge_sdk/struct.Statistics.html @@ -0,0 +1,47 @@ +Statistics in wasmedge_sdk - Rust
pub struct Statistics { /* private fields */ }
Expand description

Used to collect statistics of the WasmEdge runtime, such as the count of instructions in execution.

+

Implementations§

source§

impl Statistics

source

pub fn new() -> WasmEdgeResult<Self>

Creates a new Statistics.

+
Error
+

If fail to create a Statistics, then an error is returned.

+
source

pub fn count(&self) -> u64

Returns the instruction count in execution.

+
source

pub fn count_per_second(&self) -> f64

Returns the instruction count per second in execution.

+
Notice
+

For the following cases,

+
    +
  • Statistics is not enabled, or
  • +
  • the total execution time is 0
  • +
+

The instructions per second could be NaN, which represents divided-by-zero. +Use the is_nan function of F64 to check the return value before use it, +for example,

+ +
use wasmedge_sdk::Statistics;
+
+// create a Statistics instance
+let stat = Statistics::new().expect("fail to create a Statistics");
+
+// check instruction count per second
+assert!(stat.count_per_second().is_nan());
+
source

pub fn cost(&self) -> u64

Returns the total cost in execution.

+
source

pub fn set_cost_table(&mut self, cost_table: impl AsRef<[u64]>)

Sets the cost of instructions.

+
Arguments
+
    +
  • cost_table specifies the slice of cost table.
  • +
+
source

pub fn set_cost_limit(&mut self, limit: u64)

Sets the cost limit in execution.

+
Arguments
+
    +
  • limit specifies the cost limit.
  • +
+

Trait Implementations§

source§

impl Clone for Statistics

source§

fn clone(&self) -> Statistics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Statistics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Store.html b/wasmedge_sdk/struct.Store.html new file mode 100644 index 000000000..bf9ec4e7d --- /dev/null +++ b/wasmedge_sdk/struct.Store.html @@ -0,0 +1,102 @@ +Store in wasmedge_sdk - Rust

Struct wasmedge_sdk::Store

source ·
pub struct Store { /* private fields */ }
Expand description

Represents all global state that can be manipulated by WebAssembly programs. A store consists of the runtime representation of all instances of functions, tables, memories, and globals.

+

Implementations§

source§

impl Store

source

pub fn new() -> WasmEdgeResult<Self>

Creates a new Store.

+
Error
+

If fail to create a new Store, then an error is returned.

+
source

pub fn register_import_module<T>( + &mut self, + executor: &mut Executor, + import: &ImportObject<T> +) -> WasmEdgeResult<()>where + T: ?Sized + Send + Sync + Clone,

Registers and instantiates a WasmEdge import object into this store.

+
Arguments
+
    +
  • +

    executor - The executor that runs the host functions in this store.

    +
  • +
  • +

    import - The WasmEdge import object to be registered.

    +
  • +
+
Error
+

If fail to register the given import object, then an error is returned.

+
source

pub fn register_named_module( + &mut self, + executor: &mut Executor, + mod_name: impl AsRef<str>, + module: &Module +) -> WasmEdgeResult<Instance>

Registers and instantiates a WasmEdge compiled module into this store as a named module instance, and returns the module instance.

+

Instantiates the given WasmEdge compiled module, including the functions, memories, tables, and globals it hosts; and then, registers the module instance into the store with the given name.

+
Arguments
+
    +
  • +

    executor - The executor that runs the host functions in this store.

    +
  • +
  • +

    mod_name - The exported name of the registered module.

    +
  • +
  • +

    module - The validated module to be registered.

    +
  • +
+
Error
+

If fail to register the given module, then an error is returned.

+
source

pub fn register_active_module( + &mut self, + executor: &mut Executor, + module: &Module +) -> WasmEdgeResult<Instance>

Registers and instantiates a WasmEdge compiled module into this store as an anonymous active module instance, and returns the module instance.

+
Arguments
+
    +
  • +

    executor - The executor that runs the host functions in this store.

    +
  • +
  • +

    module - The validated module to be registered.

    +
  • +
+
Error
+

If fail to register the given module, then an error is returned.

+
source

pub fn register_plugin_module( + &mut self, + executor: &mut Executor, + plugin: &PluginInstance +) -> WasmEdgeResult<()>

Registers a PluginInstance into this store.

+
Arguments
+ +
Error
+

If fail to register the plugin instance, then an error is returned.

+
source

pub fn named_instance_count(&self) -> u32

Returns the number of the named module instances in this store.

+
source

pub fn instance_names(&self) -> Vec<String>

Returns the names of all registered named module instances.

+
source

pub fn named_instance( + &mut self, + name: impl AsRef<str> +) -> WasmEdgeResult<Instance>

Returns the named module instance with the given name.

+
Argument
+ +
source

pub fn contains(&self, mod_name: impl AsRef<str>) -> bool

Checks if the store contains a named module instance.

+
Argument
+
    +
  • mod_name - The name of the named module.
  • +
+

Trait Implementations§

source§

impl Clone for Store

source§

fn clone(&self) -> Store

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Store

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnwindSafe for Store

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Table.html b/wasmedge_sdk/struct.Table.html new file mode 100644 index 000000000..5c52c680e --- /dev/null +++ b/wasmedge_sdk/struct.Table.html @@ -0,0 +1,60 @@ +Table in wasmedge_sdk - Rust

Struct wasmedge_sdk::Table

source ·
pub struct Table { /* private fields */ }
Expand description

Defines a table storing the references to host functions or external objects.

+

Implementations§

source§

impl Table

source

pub fn new(ty: TableType) -> WasmEdgeResult<Self>

Creates a new wasm table instance with the given type.

+
Argument
+
    +
  • ty - The type of the table instance to be created.
  • +
+
Error
+
    +
  • If fail to create the table instance, then WasmEdgeError::Table(TableError::Create)(crate::error::TableError) is returned.
  • +
+
source

pub fn name(&self) -> Option<&str>

Returns the exported name of this table instance.

+

Notice that this field is meaningful only if this table is used as an exported instance.

+
source

pub fn mod_name(&self) -> Option<&str>

Returns the name of the module instance from which this table instance exports.

+

Notice that this field is meaningful only if this table is used as an exported instance.

+
source

pub fn ty(&self) -> &TableType

Returns a reference to the type of this table.

+
source

pub fn size(&self) -> u32

Returns the size of this Table.

+
source

pub fn grow(&mut self, delta: u32, init: Option<Val>) -> WasmEdgeResult<u32>

Grows the size of this table by delta, initializing the elements with the provided init value if init is given. Returns the previous size of the table.

+
Arguments
+
    +
  • +

    delta - The number of elements to grow the table instance by.

    +
  • +
  • +

    init - The value to initialize the new table slots with.

    +
  • +
+
Error
+

If fail to grow the table, then an error is returned.

+
source

pub fn get(&self, index: u32) -> WasmEdgeResult<Val>

Returns the table element at the index.

+
Argument
+
    +
  • index - the index of the table element to get.
  • +
+
Error
+

If fail to get the table element, then an error is returned.

+
source

pub fn set(&mut self, index: u32, data: Val) -> WasmEdgeResult<()>

Stores the data at the index of this table.

+
Arguments
+
    +
  • +

    index - the index of the table element to store.

    +
  • +
  • +

    data - the data to store at the index of this table.

    +
  • +
+
Error
+

If fail to store the data, then an error is returned.

+

Trait Implementations§

source§

impl Clone for Table

source§

fn clone(&self) -> Table

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Table

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl !UnwindSafe for Table

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.TableType.html b/wasmedge_sdk/struct.TableType.html new file mode 100644 index 000000000..f872a75cf --- /dev/null +++ b/wasmedge_sdk/struct.TableType.html @@ -0,0 +1,33 @@ +TableType in wasmedge_sdk - Rust

Struct wasmedge_sdk::TableType

pub struct TableType { /* private fields */ }
Expand description

Struct of WasmEdge TableType.

+

A TableType is used to declare the element type and the size range of a WasmEdge Table to be created.

+

Implementations§

§

impl TableType

pub fn new(elem_ty: RefType, min: u32, max: Option<u32>) -> TableType

Creates a new TableType with the given element type and the size range.

+
Arguments
+
    +
  • +

    elem_ty - The element type of the table to be created.

    +
  • +
  • +

    min - The minimum size of the table to be created.

    +
  • +
  • +

    max - The maximum size of the table to be created.

    +
  • +
+

pub fn elem_ty(&self) -> RefType

Returns the element type defined in the TableType.

+

pub fn minimum(&self) -> u32

Returns the minimum size defined in the TableType.

+

pub fn maximum(&self) -> Option<u32>

Returns the maximum size defined in the TableType.

+

Trait Implementations§

§

impl Clone for TableType

§

fn clone(&self) -> TableType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for TableType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for TableType

§

fn default() -> TableType

Returns the “default value” for a type. Read more
§

impl From<TableType> for TableType

§

fn from(ty: TableType) -> TableType

Converts to this type from the input type.
§

impl PartialEq for TableType

§

fn eq(&self, other: &TableType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for TableType

§

impl StructuralEq for TableType

§

impl StructuralPartialEq for TableType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.Vm.html b/wasmedge_sdk/struct.Vm.html new file mode 100644 index 000000000..d3fcd3da7 --- /dev/null +++ b/wasmedge_sdk/struct.Vm.html @@ -0,0 +1,359 @@ +Vm in wasmedge_sdk - Rust

Struct wasmedge_sdk::Vm

source ·
pub struct Vm { /* private fields */ }
Expand description

A Vm defines a virtual environment for managing WebAssembly programs.

+

Example

+

The example below presents how to register a module as named module in a Vm instance and run a target wasm function.

+ +
// If the version of rust used is less than v1.63, please uncomment the follow attribute.
+// #![feature(explicit_generic_args_with_impl_trait)]
+#[cfg(not(feature = "async"))]
+use wasmedge_sdk::{params, VmBuilder, WasmVal, wat2wasm, ValType, NeverType};
+
+#[cfg_attr(test, test)]
+fn main() -> Result<(), Box<dyn std::error::Error>> {
+    #[cfg(not(feature = "async"))]
+    {
+        // create a Vm context
+        let vm = VmBuilder::new().build()?;
+
+        // register a wasm module from the given in-memory wasm bytes
+        let wasm_bytes = wat2wasm(
+          br#"(module
+              (type (;0;) (func (param i32) (result i32)))
+              (type (;1;) (func))
+              (func (;0;) (type 0) (param i32) (result i32)
+                (local i32 i32 i32)
+                i32.const 1
+                local.set 1
+                block  ;; label = @1
+                  local.get 0
+                  i32.const 2
+                  i32.lt_s
+                  br_if 0 (;@1;)
+                  local.get 0
+                  i32.const -1
+                  i32.add
+                  local.tee 1
+                  i32.const 7
+                  i32.and
+                  local.set 2
+                  block  ;; label = @2
+                    block  ;; label = @3
+                      local.get 0
+                      i32.const -2
+                      i32.add
+                      i32.const 7
+                      i32.ge_u
+                      br_if 0 (;@3;)
+                      i32.const 1
+                      local.set 0
+                      i32.const 1
+                      local.set 1
+                      br 1 (;@2;)
+                    end
+                    local.get 1
+                    i32.const -8
+                    i32.and
+                    local.set 3
+                    i32.const 1
+                    local.set 0
+                    i32.const 1
+                    local.set 1
+                    loop  ;; label = @3
+                      local.get 1
+                      local.get 0
+                      i32.add
+                      local.tee 0
+                      local.get 1
+                      i32.add
+                      local.tee 1
+                      local.get 0
+                      i32.add
+                      local.tee 0
+                      local.get 1
+                      i32.add
+                      local.tee 1
+                      local.get 0
+                      i32.add
+                      local.tee 0
+                      local.get 1
+                      i32.add
+                      local.tee 1
+                      local.get 0
+                      i32.add
+                      local.tee 0
+                      local.get 1
+                      i32.add
+                      local.set 1
+                      local.get 3
+                      i32.const -8
+                      i32.add
+                      local.tee 3
+                      br_if 0 (;@3;)
+                    end
+                  end
+                  local.get 2
+                  i32.eqz
+                  br_if 0 (;@1;)
+                  local.get 1
+                  local.set 3
+                  loop  ;; label = @2
+                    local.get 3
+                    local.get 0
+                    i32.add
+                    local.set 1
+                    local.get 3
+                    local.set 0
+                    local.get 1
+                    local.set 3
+                    local.get 2
+                    i32.const -1
+                    i32.add
+                    local.tee 2
+                    br_if 0 (;@2;)
+                  end
+                end
+                local.get 1)
+              (func (;1;) (type 1))
+              (func (;2;) (type 1)
+                call 1
+                call 1)
+              (func (;3;) (type 0) (param i32) (result i32)
+                local.get 0
+                call 0
+                call 2)
+              (table (;0;) 1 1 funcref)
+              (memory (;0;) 16)
+              (global (;0;) (mut i32) (i32.const 1048576))
+              (export "memory" (memory 0))
+              (export "fib" (func 3)))
+          "#,
+        )?;
+        let mut vm = vm.register_module_from_bytes("extern", wasm_bytes)?;
+
+        // run `fib` function in the named module instance
+        let returns = vm.run_func(Some("extern"), "fib", params!(10))?;
+        assert_eq!(returns.len(), 1);
+        assert_eq!(returns[0].to_i32(), 89);
+    }
+
+    Ok(())
+}
+

Implementations§

source§

impl Vm

source

pub fn register_module( + self, + mod_name: Option<&str>, + module: Module +) -> WasmEdgeResult<Self>

Registers a wasm module into this vm as a named or active module instance.

+
Arguments
+
    +
  • +

    mod_name - The exported name for the registered module. If None, then the module is registered as an active instance.

    +
  • +
  • +

    module - The module to be registered.

    +
  • +
+
Error
+

If fail to register the given module, then an error is returned.

+
source

pub fn register_module_from_file( + self, + mod_name: impl AsRef<str>, + file: impl AsRef<Path> +) -> WasmEdgeResult<Self>

Registers a wasm module into the vm from a wasm file.

+
Arguments
+
    +
  • +

    mod_name - The exported name for the registered module.

    +
  • +
  • +

    file - A wasm file or an AOT wasm file.

    +
  • +
+
Error
+

If fail to register, then an error is returned.

+
source

pub fn register_module_from_bytes( + self, + mod_name: impl AsRef<str>, + bytes: impl AsRef<[u8]> +) -> WasmEdgeResult<Self>

Registers a wasm module from the given in-memory wasm bytes into this vm.

+
Arguments
+
    +
  • +

    mod_name - The exported name for the registered module.

    +
  • +
  • +

    bytes - The in-memory wasm bytes.

    +
  • +
+
Error
+

If fail to register, then an error is returned.

+
source

pub fn register_import_module<T>( + &mut self, + import: &ImportObject<T> +) -> WasmEdgeResult<()>where + T: ?Sized + Send + Sync + Clone,

Registers an import object into this vm.

+
Arguments
+
    +
  • import - The import object to be registered.
  • +
+
Error
+

If fail to register, then an error is returned.

+
source

pub fn auto_detect_plugins(self) -> WasmEdgeResult<Self>

Auto detect all plugins in WASMEDGE_PLUGIN_PATH

+
Error
+

If fail to register plugin instance, then an error is returned.

+
source

pub fn run_func( + &self, + mod_name: Option<&str>, + func_name: impl AsRef<str>, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs an exported wasm function in a (named or active) module instance.

+
Arguments
+
    +
  • +

    mod_name - The exported name of the module instance, which holds the target function. If None, then the active module is used.

    +
  • +
  • +

    func_name - The exported name of the target wasm function.

    +
  • +
  • +

    args - The arguments to be passed to the target wasm function.

    +
  • +
+
Error
+

If fail to run the wasm function, then an error is returned.

+
source

pub fn run_func_with_timeout( + &self, + mod_name: Option<&str>, + func_name: impl AsRef<str>, + args: impl IntoIterator<Item = WasmValue>, + timeout: Duration +) -> WasmEdgeResult<Vec<WasmValue>>

Runs an exported wasm function in a (named or active) module instance with a timeout setting

+
Arguments
+
    +
  • +

    mod_name - The exported name of the module instance, which holds the target function. If None, then the active module is used.

    +
  • +
  • +

    func_name - The exported name of the target wasm function.

    +
  • +
  • +

    args - The arguments to be passed to the target wasm function.

    +
  • +
  • +

    timeout - The maximum execution time of the function to be run.

    +
  • +
+
Error
+

If fail to run the wasm function, then an error is returned.

+
source

pub fn run_func_from_module( + &mut self, + module: Module, + func_name: impl AsRef<str>, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs an exported wasm function from the given wasm module.

+

This method is a shortcut of calling register_module and run_func in sequence.

+
Arguments
+
    +
  • +

    module - A wasm module.

    +
  • +
  • +

    func_name - The exported name of the target wasm function.

    +
  • +
  • +

    args - The arguments to be passed to the target wasm function.

    +
  • +
+
Error
+

If fail to run, then an error is returned.

+
source

pub fn run_func_from_file( + &mut self, + file: impl AsRef<Path>, + func_name: impl AsRef<str>, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs an exported wasm function from the given wasm file.

+
Arguments
+
    +
  • +

    file - A wasm file or an AOT wasm file.

    +
  • +
  • +

    func_name - The exported name of the target wasm function.

    +
  • +
  • +

    args - The arguments to be passed to the target wasm function.

    +
  • +
+
Error
+

If fail to run, then an error is returned.

+
source

pub fn run_func_from_bytes( + &mut self, + bytes: &[u8], + func_name: impl AsRef<str>, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs an exported wasm function from the given in-memory wasm bytes.

+
Arguments
+
    +
  • +

    bytes - The in-memory wasm bytes.

    +
  • +
  • +

    func_name - The exported name of the target wasm function.

    +
  • +
  • +

    args - The arguments to be passed to the target wasm function.

    +
  • +
+
Error
+

If fail to run, then an error is returned.

+
source

pub fn statistics(&self) -> Option<&Statistics>

Returns a reference to the internal statistics from this vm.

+
source

pub fn statistics_mut(&mut self) -> Option<&mut Statistics>

Returns a mutable reference to the internal statistics from this vm.

+
source

pub fn executor(&self) -> &Executor

Returns a reference to the internal executor from this vm.

+
source

pub fn executor_mut(&mut self) -> &mut Executor

Returns a mutable reference to the internal executor from this vm.

+
source

pub fn store(&self) -> &Store

Returns a reference to the internal store from this vm.

+
source

pub fn store_mut(&mut self) -> &mut Store

Returns a mutable reference to the internal store from this vm.

+
source

pub fn wasi_module(&self) -> Option<&WasiInstance>

Returns a reference to the [wasi module instance] from this vm.

+

To retrieve the [wasi module instance], a config with the enabled wasi option should be given when create this vm.

+
source

pub fn wasi_module_mut(&mut self) -> Option<&mut WasiInstance>

Returns a mutable reference to the [wasi module instance] from this vm.

+

To retrieve the [wasi module instance], a config with the enabled wasi option should be given when create this vm.

+
source

pub fn named_module(&self, name: impl AsRef<str>) -> WasmEdgeResult<&Instance>

Returns a reference to the named module instance with the given name from this vm.

+
Argument
+
    +
  • name - The exported name of the target module instance.
  • +
+
Error
+

If fail to get the reference to the target module instance, then an error is returned.

+
source

pub fn named_module_mut( + &mut self, + name: impl AsRef<str> +) -> WasmEdgeResult<&mut Instance>

Returns a mutable reference to the named module instance with the given name.

+
Argument
+
    +
  • name - The exported name of the target module instance.
  • +
+
Error
+

If fail to get the mutable reference to the target module instance, then an error is returned.

+
source

pub fn active_module(&self) -> WasmEdgeResult<&Instance>

Returns a reference to the active module instance from this vm.

+
Error
+

If fail to get the reference to the active module instance, then an error is returned.

+
source

pub fn active_module_mut(&mut self) -> WasmEdgeResult<&mut Instance>

Returns a mutable reference to the active module instance from this vm.

+
Error
+

If fail to get the mutable reference to the active module instance, then an error is returned.

+
source

pub fn contains_module(&self, mod_name: impl AsRef<str>) -> bool

Checks if the vm contains a named module instance.

+
Argument
+
    +
  • mod_name - The exported name of the target module instance.
  • +
+
source

pub fn named_instance_count(&self) -> u32

Returns the count of the named module instances this vm holds.

+
source

pub fn instance_names(&self) -> Vec<String>

Returns the names of all named module instances this vm holds.

+

Trait Implementations§

source§

impl Clone for Vm

source§

fn clone(&self) -> Vm

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Vm

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Vm

§

impl Send for Vm

§

impl Sync for Vm

§

impl Unpin for Vm

§

impl !UnwindSafe for Vm

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/struct.VmBuilder.html b/wasmedge_sdk/struct.VmBuilder.html new file mode 100644 index 000000000..0e460171d --- /dev/null +++ b/wasmedge_sdk/struct.VmBuilder.html @@ -0,0 +1,50 @@ +VmBuilder in wasmedge_sdk - Rust

Struct wasmedge_sdk::VmBuilder

source ·
pub struct VmBuilder { /* private fields */ }
Expand description

Constructs a Vm instance.

+

Implementations§

source§

impl VmBuilder

source

pub fn new() -> Self

Creates a new VmBuilder.

+
source

pub fn with_config(self, config: Config) -> Self

Sets the Config for the Vm to build.

+
Argument
+
    +
  • config - The Config to set.
  • +
+
source

pub fn with_statistics(self, stat: Statistics) -> Self

Sets the Statistics for the Vm to build.

+
Argument
+ +
source

pub fn with_store(self, store: Store) -> Self

Sets the Store for the Vm to build.

+
Argument
+
    +
  • store - The Store to set.
  • +
+
source

pub fn with_plugin_wasi_nn(self) -> Self

Sets the wasi_nn plugin for the Vm to build. The wasi_nn plugin should be deployed with WasmEdge library.

+
source

pub fn with_plugin_wasi_crypto(self) -> Self

Sets the wasi_crypto plugin for the Vm to build. The wasi_crypto plugin should be deployed with WasmEdge library.

+
source

pub fn with_plugin_wasmedge_process(self) -> Self

Sets the wasmedge_process plugin for the Vm to build. The wasmedge_process plugin should be deployed with WasmEdge library.

+
source

pub fn with_plugin_rustls(self) -> Self

Sets the rustls plugin for the Vm to build. The rustls plugin should be deployed with WasmEdge library.

+
source

pub fn with_plugin( + self, + pname: impl AsRef<str>, + mnames: Option<Vec<&str>> +) -> Self

Set the third-party plugin for the Vm to build.

+
Arguments
+
    +
  • +

    pname - The name of the plugin.

    +
  • +
  • +

    mnames - The names of the plugin modules to be registered. If None, then all modules in the plugin are registered.

    +
  • +
+
source

pub fn build(self) -> WasmEdgeResult<Vm>

Creates a new Vm.

+
Error
+

If fail to create, then an error is returned.

+

Trait Implementations§

source§

impl Debug for VmBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for VmBuilder

source§

fn default() -> VmBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/trait.AsInstance.html b/wasmedge_sdk/trait.AsInstance.html new file mode 100644 index 000000000..960656bda --- /dev/null +++ b/wasmedge_sdk/trait.AsInstance.html @@ -0,0 +1,46 @@ +AsInstance in wasmedge_sdk - Rust
pub trait AsInstance {
+
Show 13 methods // Required methods + fn name(&self) -> &str; + fn func_count(&self) -> usize; + fn func_names(&self) -> Option<Vec<String>>; + fn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func>; + fn global_count(&self) -> usize; + fn global_names(&self) -> Option<Vec<String>>; + fn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>; + fn memory_count(&self) -> usize; + fn memory_names(&self) -> Option<Vec<String>>; + fn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>; + fn table_count(&self) -> usize; + fn table_names(&self) -> Option<Vec<String>>; + fn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>; +
}
Expand description

The object used as an module instance is required to implement this trait.

+

Required Methods§

source

fn name(&self) -> &str

Returns the name of this exported module instance.

+
source

fn func_count(&self) -> usize

Returns the count of the exported function instances in this module instance.

+
source

fn func_names(&self) -> Option<Vec<String>>

Returns the names of the exported function instances in this module instance.

+
source

fn func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Func>

Returns the exported function instance in this module instance.

+
Argument
+ +
source

fn global_count(&self) -> usize

Returns the count of the exported global instances.

+
source

fn global_names(&self) -> Option<Vec<String>>

Returns the names of the exported global instances in this module instance.

+
source

fn global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>

Returns the exported global instance in this module instance.

+
Argument
+ +
source

fn memory_count(&self) -> usize

Returns the count of the exported memory instances in this module instance.

+
source

fn memory_names(&self) -> Option<Vec<String>>

Returns the names of the exported memory instances in this module instance.

+
source

fn memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>

Returns the exported memory instance in this module instance.

+
Argument
+ +
source

fn table_count(&self) -> usize

Returns the count of the exported table instances in this module instance.

+
source

fn table_names(&self) -> Option<Vec<String>>

Returns the names of the exported table instances in this module instance.

+
source

fn table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>

Returns the exported table instance in this module instance by the given table name.

+
Argument
+ +

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/wasmedge_sdk/trait.Engine.html b/wasmedge_sdk/trait.Engine.html new file mode 100644 index 000000000..5c85a9a93 --- /dev/null +++ b/wasmedge_sdk/trait.Engine.html @@ -0,0 +1,46 @@ +Engine in wasmedge_sdk - Rust

Trait wasmedge_sdk::Engine

source ·
pub trait Engine {
+    // Required methods
+    fn run_func(
+        &self,
+        func: &Func,
+        params: impl IntoIterator<Item = WasmValue>
+    ) -> WasmEdgeResult<Vec<WasmValue>>;
+    fn run_func_ref(
+        &self,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue>
+    ) -> WasmEdgeResult<Vec<WasmValue>>;
+}
Expand description

The object that is used to perform a host function is required to implement this trait.

+

Required Methods§

source

fn run_func( + &self, + func: &Func, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance and returns the results.

+
Arguments
+
    +
  • +

    func - The function instance to run.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
+
Errors
+

If fail to run the host function, then an error is returned.

+
source

fn run_func_ref( + &self, + func_ref: &FuncRef, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance by calling its reference and returns the results.

+
Arguments
+
    +
  • +

    func_ref - A reference to the target host function instance.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
+
Errors
+

If fail to run the host function, then an error is returned.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/wasmedge_sdk/trait.WasmVal.html b/wasmedge_sdk/trait.WasmVal.html new file mode 100644 index 000000000..7452e4d44 --- /dev/null +++ b/wasmedge_sdk/trait.WasmVal.html @@ -0,0 +1,5 @@ +WasmVal in wasmedge_sdk - Rust

Trait wasmedge_sdk::WasmVal

source ·
pub trait WasmVal {
+    // Required method
+    fn to_wasm_value(self) -> WasmValue;
+}
Expand description

Defines the function converting a value of Rust type to the one of Wasm type.

+

Required Methods§

Implementations on Foreign Types§

source§

impl WasmVal for f32

source§

impl WasmVal for f64

source§

impl WasmVal for i8

source§

impl WasmVal for i16

source§

impl WasmVal for i32

source§

impl WasmVal for i64

source§

impl WasmVal for i128

source§

impl WasmVal for u8

source§

impl WasmVal for u16

source§

impl WasmVal for u32

Implementors§

\ No newline at end of file diff --git a/wasmedge_sdk/trait.WasmValType.html b/wasmedge_sdk/trait.WasmValType.html new file mode 100644 index 000000000..22dcc66ca --- /dev/null +++ b/wasmedge_sdk/trait.WasmValType.html @@ -0,0 +1,9 @@ +WasmValType in wasmedge_sdk - Rust
pub trait WasmValType {
+    const WASM_TYPE: ValType;
+}
Expand description

Describes the mapping of Rust type to Wasm type.

+ +
use wasmedge_sdk::{WasmValType, ValType};
+
+assert_eq!(i32::WASM_TYPE, ValType::I32);
+

Required Associated Constants§

source

const WASM_TYPE: ValType

The Wasm type.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl WasmValType for f32

source§

const WASM_TYPE: ValType = ValType::F32

source§

impl WasmValType for f64

source§

const WASM_TYPE: ValType = ValType::F64

source§

impl WasmValType for i8

source§

const WASM_TYPE: ValType = ValType::I32

source§

impl WasmValType for i16

source§

const WASM_TYPE: ValType = ValType::I32

source§

impl WasmValType for i32

source§

const WASM_TYPE: ValType = ValType::I32

source§

impl WasmValType for i64

source§

const WASM_TYPE: ValType = ValType::I64

source§

impl WasmValType for i128

source§

const WASM_TYPE: ValType = ValType::V128

source§

impl WasmValType for u8

source§

const WASM_TYPE: ValType = ValType::I32

source§

impl WasmValType for u16

source§

const WASM_TYPE: ValType = ValType::I32

source§

impl WasmValType for u32

source§

const WASM_TYPE: ValType = ValType::I64

Implementors§

source§

impl WasmValType for FuncRef

source§

const WASM_TYPE: ValType = ValType::FuncRef

source§

impl WasmValType for ExternRef

source§

const WASM_TYPE: ValType = ValType::ExternRef

\ No newline at end of file diff --git a/wasmedge_sdk/trait.WasmValTypeList.html b/wasmedge_sdk/trait.WasmValTypeList.html new file mode 100644 index 000000000..6f05d800c --- /dev/null +++ b/wasmedge_sdk/trait.WasmValTypeList.html @@ -0,0 +1,547 @@ +WasmValTypeList in wasmedge_sdk - Rust
pub trait WasmValTypeListwhere
+    Self: Sized,{
+    type Array: AsMut<[i128]>;
+
+    // Required method
+    fn wasm_types() -> &'static [ValType];
+}
Expand description

Describes the mapping of a tuple of Rust types to Wasm types.

+ +
use wasmedge_sdk::{FuncRef, types::ExternRef, ValType, WasmValTypeList};
+
+assert_eq!(
+     <(i32, i64, f32, f64, FuncRef, ExternRef)>::wasm_types(),
+     [ValType::I32, ValType::I64, ValType::F32, ValType::F64, ValType::FuncRef, ValType::ExternRef]
+);
+

Required Associated Types§

source

type Array: AsMut<[i128]>

The array type that can hold all the represented values.

+

Note that all values are stored in their binary form.

+

Required Methods§

source

fn wasm_types() -> &'static [ValType]

Get the Wasm types for the tuple (list) of currently +represented values.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl WasmValTypeList for ()

§

type Array = [i128; 0]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2> WasmValTypeList for (A1, A2)where + A1: WasmValType, + A2: WasmValType,

§

type Array = [i128; 2]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3> WasmValTypeList for (A1, A2, A3)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType,

§

type Array = [i128; 3]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4> WasmValTypeList for (A1, A2, A3, A4)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType,

§

type Array = [i128; 4]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5> WasmValTypeList for (A1, A2, A3, A4, A5)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType,

§

type Array = [i128; 5]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6> WasmValTypeList for (A1, A2, A3, A4, A5, A6)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType,

§

type Array = [i128; 6]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType,

§

type Array = [i128; 7]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType,

§

type Array = [i128; 8]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType,

§

type Array = [i128; 9]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType,

§

type Array = [i128; 10]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType,

§

type Array = [i128; 11]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType,

§

type Array = [i128; 12]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType,

§

type Array = [i128; 13]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType,

§

type Array = [i128; 14]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType,

§

type Array = [i128; 15]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType,

§

type Array = [i128; 16]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType,

§

type Array = [i128; 17]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType,

§

type Array = [i128; 18]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType,

§

type Array = [i128; 19]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType,

§

type Array = [i128; 20]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType,

§

type Array = [i128; 21]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType,

§

type Array = [i128; 22]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType,

§

type Array = [i128; 23]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType,

§

type Array = [i128; 24]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType, + A25: WasmValType,

§

type Array = [i128; 25]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType, + A25: WasmValType, + A26: WasmValType,

§

type Array = [i128; 26]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType, + A25: WasmValType, + A26: WasmValType, + A27: WasmValType,

§

type Array = [i128; 27]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType, + A25: WasmValType, + A26: WasmValType, + A27: WasmValType, + A28: WasmValType,

§

type Array = [i128; 28]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType, + A25: WasmValType, + A26: WasmValType, + A27: WasmValType, + A28: WasmValType, + A29: WasmValType,

§

type Array = [i128; 29]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType, + A25: WasmValType, + A26: WasmValType, + A27: WasmValType, + A28: WasmValType, + A29: WasmValType, + A30: WasmValType,

§

type Array = [i128; 30]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType, + A25: WasmValType, + A26: WasmValType, + A27: WasmValType, + A28: WasmValType, + A29: WasmValType, + A30: WasmValType, + A31: WasmValType,

§

type Array = [i128; 31]

source§

fn wasm_types() -> &'static [ValType]

source§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31, A32> WasmValTypeList for (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31, A32)where + A1: WasmValType, + A2: WasmValType, + A3: WasmValType, + A4: WasmValType, + A5: WasmValType, + A6: WasmValType, + A7: WasmValType, + A8: WasmValType, + A9: WasmValType, + A10: WasmValType, + A11: WasmValType, + A12: WasmValType, + A13: WasmValType, + A14: WasmValType, + A15: WasmValType, + A16: WasmValType, + A17: WasmValType, + A18: WasmValType, + A19: WasmValType, + A20: WasmValType, + A21: WasmValType, + A22: WasmValType, + A23: WasmValType, + A24: WasmValType, + A25: WasmValType, + A26: WasmValType, + A27: WasmValType, + A28: WasmValType, + A29: WasmValType, + A30: WasmValType, + A31: WasmValType, + A32: WasmValType,

§

type Array = [i128; 32]

source§

fn wasm_types() -> &'static [ValType]

Implementors§

source§

impl<A1> WasmValTypeList for A1where + A1: WasmValType,

§

type Array = [i128; 1]

\ No newline at end of file diff --git a/wasmedge_sdk/type.NeverType.html b/wasmedge_sdk/type.NeverType.html new file mode 100644 index 000000000..0b591b9ea --- /dev/null +++ b/wasmedge_sdk/type.NeverType.html @@ -0,0 +1,2 @@ +NeverType in wasmedge_sdk - Rust

Type Alias wasmedge_sdk::NeverType

source ·
pub type NeverType = NeverType;
Expand description

This is a workaround solution to the never type in Rust. It will be replaced by ! once it is stable.

+

Aliased Type§

enum NeverType {}

Variants§

\ No newline at end of file diff --git a/wasmedge_sdk/type.WasmEdgeResult.html b/wasmedge_sdk/type.WasmEdgeResult.html new file mode 100644 index 000000000..e3b331a27 --- /dev/null +++ b/wasmedge_sdk/type.WasmEdgeResult.html @@ -0,0 +1,7 @@ +WasmEdgeResult in wasmedge_sdk - Rust

Type Alias wasmedge_sdk::WasmEdgeResult

pub type WasmEdgeResult<T> = Result<T, Box<WasmEdgeError>>;
Expand description

The WasmEdge result type.

+

Aliased Type§

enum WasmEdgeResult<T> {
+    Ok(T),
+    Err(Box<WasmEdgeError>),
+}

Variants§

§1.0.0

Ok(T)

Contains the success value

+
§1.0.0

Err(Box<WasmEdgeError>)

Contains the error value

+
\ No newline at end of file diff --git a/wasmedge_sdk/type.WasmValue.html b/wasmedge_sdk/type.WasmValue.html new file mode 100644 index 000000000..199fd0228 --- /dev/null +++ b/wasmedge_sdk/type.WasmValue.html @@ -0,0 +1,2 @@ +WasmValue in wasmedge_sdk - Rust

Type Alias wasmedge_sdk::WasmValue

source ·
pub type WasmValue = WasmValue;
Expand description

WebAssembly value type.

+

Aliased Type§

struct WasmValue { /* private fields */ }
\ No newline at end of file diff --git a/wasmedge_sdk/types/enum.Val.html b/wasmedge_sdk/types/enum.Val.html new file mode 100644 index 000000000..167bd7a14 --- /dev/null +++ b/wasmedge_sdk/types/enum.Val.html @@ -0,0 +1,35 @@ +Val in wasmedge_sdk::types - Rust

Enum wasmedge_sdk::types::Val

source ·
pub enum Val {
+    I32(i32),
+    I64(i64),
+    F32(f32),
+    F64(f64),
+    V128(i128),
+    FuncRef(Option<FuncRef>),
+    ExternRef(Option<ExternRef>),
+}
Expand description

Defines runtime values that a WebAssembly module can either consume or produce.

+

Variants§

§

I32(i32)

32-bit integer.

+

Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.

+
§

I64(i64)

64-bit integer.

+

Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.

+
§

F32(f32)

32-bit floating-point data as defined by the IEEE 754-2019.

+
§

F64(f64)

64-bit floating-point data as defined by the IEEE 754-2019.

+
§

V128(i128)

128-bit vector of packed integer or floating-point data.

+

The packed data can be interpreted as signed or unsigned integers, single or double precision floating-point +values, or a single 128 bit type. The interpretation is determined by individual operations.

+
§

FuncRef(Option<FuncRef>)

A reference to a host function.

+

FuncRef(None) is the null function reference, created by ref.null func in Wasm.

+
§

ExternRef(Option<ExternRef>)

A reference to opaque data in the wasm instance.

+

ExternRef(None) is the null external reference, created by ref.null extern in Wasm.

+

Trait Implementations§

source§

impl Clone for Val

source§

fn clone(&self) -> Val

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Val

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Val> for WasmValue

source§

fn from(val: Val) -> Self

Converts to this type from the input type.
source§

impl From<WasmValue> for Val

source§

fn from(value: WasmValue) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Val

§

impl Send for Val

§

impl Sync for Val

§

impl Unpin for Val

§

impl UnwindSafe for Val

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/types/index.html b/wasmedge_sdk/types/index.html new file mode 100644 index 000000000..380015da4 --- /dev/null +++ b/wasmedge_sdk/types/index.html @@ -0,0 +1,2 @@ +wasmedge_sdk::types - Rust

Module wasmedge_sdk::types

source ·
Expand description

Defines the general types.

+

Structs

  • A reference to opaque data in the wasm instance.

Enums

  • Defines runtime values that a WebAssembly module can either consume or produce.
\ No newline at end of file diff --git a/wasmedge_sdk/types/sidebar-items.js b/wasmedge_sdk/types/sidebar-items.js new file mode 100644 index 000000000..f3bc8c6d5 --- /dev/null +++ b/wasmedge_sdk/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Val"],"struct":["ExternRef"]}; \ No newline at end of file diff --git a/wasmedge_sdk/types/struct.ExternRef.html b/wasmedge_sdk/types/struct.ExternRef.html new file mode 100644 index 000000000..5ac4fe1a2 --- /dev/null +++ b/wasmedge_sdk/types/struct.ExternRef.html @@ -0,0 +1,18 @@ +ExternRef in wasmedge_sdk::types - Rust
pub struct ExternRef { /* private fields */ }
Expand description

A reference to opaque data in the wasm instance.

+

Implementations§

source§

impl ExternRef

source

pub fn new<T>(extern_obj: &mut T) -> Selfwhere + T: 'static + Send + Sync,

Creates a new instance of ExternRef wrapping the given value.

+

Trait Implementations§

source§

impl Clone for ExternRef

source§

fn clone(&self) -> ExternRef

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExternRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl WasmVal for ExternRef

source§

impl WasmValType for ExternRef

source§

const WASM_TYPE: ValType = ValType::ExternRef

The Wasm type.
source§

impl Copy for ExternRef

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<A1> WasmValTypeList for A1where + A1: WasmValType,

§

type Array = [i128; 1]

The array type that can hold all the represented values. Read more
source§

fn wasm_types() -> &'static [ValType]

Get the Wasm types for the tuple (list) of currently +represented values.
\ No newline at end of file diff --git a/wasmedge_sdk/utils/index.html b/wasmedge_sdk/utils/index.html new file mode 100644 index 000000000..6f46ce7fe --- /dev/null +++ b/wasmedge_sdk/utils/index.html @@ -0,0 +1,2 @@ +wasmedge_sdk::utils - Rust

Module wasmedge_sdk::utils

source ·
Expand description

Defines WasmEdge Driver and CoreVersion types

+

Structs

\ No newline at end of file diff --git a/wasmedge_sdk/utils/sidebar-items.js b/wasmedge_sdk/utils/sidebar-items.js new file mode 100644 index 000000000..007d3d237 --- /dev/null +++ b/wasmedge_sdk/utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["CoreVersion","Driver"]}; \ No newline at end of file diff --git a/wasmedge_sdk/utils/struct.CoreVersion.html b/wasmedge_sdk/utils/struct.CoreVersion.html new file mode 100644 index 000000000..367579331 --- /dev/null +++ b/wasmedge_sdk/utils/struct.CoreVersion.html @@ -0,0 +1,17 @@ +CoreVersion in wasmedge_sdk::utils - Rust
pub struct CoreVersion {}
Expand description

The version info of WasmEdge core

+

Implementations§

source§

impl CoreVersion

source

pub fn major() -> u32

Returns the major version value of WasmEdge core.

+
source

pub fn minor() -> u32

Returns the minor version value of WasmEdge core.

+
source

pub fn patch() -> u32

Returns the patch version value of WasmEdge core.

+
source

pub fn version_string() -> String

Returns the version string of WasmEdge core.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/utils/struct.Driver.html b/wasmedge_sdk/utils/struct.Driver.html new file mode 100644 index 000000000..2b7c5c3e9 --- /dev/null +++ b/wasmedge_sdk/utils/struct.Driver.html @@ -0,0 +1,22 @@ +Driver in wasmedge_sdk::utils - Rust

Struct wasmedge_sdk::utils::Driver

source ·
pub struct Driver {}
Expand description

Defines WasmEdge Driver functions

+

Implementations§

source§

impl Driver

source

pub fn aot_compiler<I, V>(args: I) -> i32where + I: IntoIterator<Item = V>, + V: AsRef<str>,

Triggers the WasmEdge AOT compiler tool

+
source

pub fn runtime_tool<I, V>(args: I) -> i32where + I: IntoIterator<Item = V>, + V: AsRef<str>,

Triggers the WasmEdge runtime tool

+
source

pub fn unified_tool<I, V>(args: I) -> i32where + I: IntoIterator<Item = V>, + V: AsRef<str>,

Triggers the WasmEdge unified tool

+

Trait Implementations§

source§

impl Debug for Driver

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sdk/vm/struct.Vm.html b/wasmedge_sdk/vm/struct.Vm.html new file mode 100644 index 000000000..5feed5116 --- /dev/null +++ b/wasmedge_sdk/vm/struct.Vm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.Vm.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/vm/struct.VmBuilder.html b/wasmedge_sdk/vm/struct.VmBuilder.html new file mode 100644 index 000000000..debea329f --- /dev/null +++ b/wasmedge_sdk/vm/struct.VmBuilder.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sdk/struct.VmBuilder.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sdk/wasi/index.html b/wasmedge_sdk/wasi/index.html new file mode 100644 index 000000000..2eeb7c338 --- /dev/null +++ b/wasmedge_sdk/wasi/index.html @@ -0,0 +1,2 @@ +wasmedge_sdk::wasi - Rust

Module wasmedge_sdk::wasi

source ·
Expand description

Defines wasi module instance.

+

Structs

\ No newline at end of file diff --git a/wasmedge_sdk/wasi/sidebar-items.js b/wasmedge_sdk/wasi/sidebar-items.js new file mode 100644 index 000000000..50cabe684 --- /dev/null +++ b/wasmedge_sdk/wasi/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["WasiInstance"]}; \ No newline at end of file diff --git a/wasmedge_sdk/wasi/struct.WasiInstance.html b/wasmedge_sdk/wasi/struct.WasiInstance.html new file mode 100644 index 000000000..6b6daa4cb --- /dev/null +++ b/wasmedge_sdk/wasi/struct.WasiInstance.html @@ -0,0 +1,43 @@ +WasiInstance in wasmedge_sdk::wasi - Rust
pub struct WasiInstance { /* private fields */ }
Expand description

Represents a wasi module instance.

+

Implementations§

source§

impl WasiInstance

source

pub fn name(&self) -> &str

Returns the name of this exported module instance.

+

If this module instance is an active instance, return None.

+
source

pub fn initialize( + &mut self, + args: Option<Vec<&str>>, + envs: Option<Vec<&str>>, + preopens: Option<Vec<&str>> +)

Initializes the WASI host module with the given parameters.

+
Arguments
+
    +
  • +

    args - The commandline arguments. The first argument is the program name.

    +
  • +
  • +

    envs - The environment variables in the format ENV_VAR_NAME=VALUE.

    +
  • +
  • +

    preopens - The directories to pre-open. The required format is DIR1:DIR2.

    +
  • +
+
source

pub fn exit_code(&self) -> u32

Returns the WASI exit code.

+

The WASI exit code can be accessed after running the “_start” function of a wasm32-wasi program.

+
source

pub fn native_handler(&self, fd: i32) -> WasmEdgeResult<u64>

Returns the native handler from the mapped FD/Handler.

+
Argument
+
    +
  • fd - The WASI mapped Fd.
  • +
+
Error
+

If fail to get the native handler, then an error is returned.

+

Trait Implementations§

source§

impl Clone for WasiInstance

source§

fn clone(&self) -> WasiInstance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiInstance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/all.html b/wasmedge_sys/all.html new file mode 100644 index 000000000..e6e2dfdd4 --- /dev/null +++ b/wasmedge_sys/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Functions

Type Aliases

Constants

\ No newline at end of file diff --git a/wasmedge_sys/ast_module/struct.ExportType.html b/wasmedge_sys/ast_module/struct.ExportType.html new file mode 100644 index 000000000..ec5ff89e8 --- /dev/null +++ b/wasmedge_sys/ast_module/struct.ExportType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.ExportType.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/ast_module/struct.ImportType.html b/wasmedge_sys/ast_module/struct.ImportType.html new file mode 100644 index 000000000..321fca31b --- /dev/null +++ b/wasmedge_sys/ast_module/struct.ImportType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.ImportType.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/ast_module/struct.Module.html b/wasmedge_sys/ast_module/struct.Module.html new file mode 100644 index 000000000..66bc92cef --- /dev/null +++ b/wasmedge_sys/ast_module/struct.Module.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.Module.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/compiler/struct.Compiler.html b/wasmedge_sys/compiler/struct.Compiler.html new file mode 100644 index 000000000..a919de076 --- /dev/null +++ b/wasmedge_sys/compiler/struct.Compiler.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.Compiler.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/config/struct.Config.html b/wasmedge_sys/config/struct.Config.html new file mode 100644 index 000000000..d2bbdb7fc --- /dev/null +++ b/wasmedge_sys/config/struct.Config.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.Config.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/enum.WasiInstance.html b/wasmedge_sys/enum.WasiInstance.html new file mode 100644 index 000000000..e14a053df --- /dev/null +++ b/wasmedge_sys/enum.WasiInstance.html @@ -0,0 +1,19 @@ +WasiInstance in wasmedge_sys - Rust
pub enum WasiInstance {
+    Wasi(WasiModule),
+}
Expand description

Defines three types of module instances that can be imported into a WasmEdge Store instance.

+

Variants§

§

Wasi(WasiModule)

Available on non-crate feature async only.

Defines the import module instance of WasiModule type.

+

Implementations§

source§

impl WasiInstance

source

pub fn name(&self) -> &str

Returns the name of the import object.

+
source

pub fn as_raw_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Returns the raw pointer to the inner WasmEdge_ModuleInstanceContext.

+

Trait Implementations§

source§

impl Clone for WasiInstance

source§

fn clone(&self) -> WasiInstance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiInstance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/executor/struct.Executor.html b/wasmedge_sys/executor/struct.Executor.html new file mode 100644 index 000000000..4e5c0b3f3 --- /dev/null +++ b/wasmedge_sys/executor/struct.Executor.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.Executor.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT16_MAX.html b/wasmedge_sys/ffi/constant.INT16_MAX.html new file mode 100644 index 000000000..d4f01e269 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT16_MAX.html @@ -0,0 +1 @@ +INT16_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::INT16_MAX

source ·
pub const INT16_MAX: u32 = 32767;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT16_MIN.html b/wasmedge_sys/ffi/constant.INT16_MIN.html new file mode 100644 index 000000000..ed9c91f7a --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT16_MIN.html @@ -0,0 +1 @@ +INT16_MIN in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::INT16_MIN

source ·
pub const INT16_MIN: i32 = - 32768;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT32_MAX.html b/wasmedge_sys/ffi/constant.INT32_MAX.html new file mode 100644 index 000000000..ed5ff83e1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT32_MAX.html @@ -0,0 +1 @@ +INT32_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::INT32_MAX

source ·
pub const INT32_MAX: u32 = 2147483647;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT32_MIN.html b/wasmedge_sys/ffi/constant.INT32_MIN.html new file mode 100644 index 000000000..1a7180e31 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT32_MIN.html @@ -0,0 +1 @@ +INT32_MIN in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::INT32_MIN

source ·
pub const INT32_MIN: i32 = - 2147483648;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT8_MAX.html b/wasmedge_sys/ffi/constant.INT8_MAX.html new file mode 100644 index 000000000..9359b8525 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT8_MAX.html @@ -0,0 +1 @@ +INT8_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::INT8_MAX

source ·
pub const INT8_MAX: u32 = 127;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT8_MIN.html b/wasmedge_sys/ffi/constant.INT8_MIN.html new file mode 100644 index 000000000..d99d77bd6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT8_MIN.html @@ -0,0 +1 @@ +INT8_MIN in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::INT8_MIN

source ·
pub const INT8_MIN: i32 = - 128;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INTPTR_MAX.html b/wasmedge_sys/ffi/constant.INTPTR_MAX.html new file mode 100644 index 000000000..982d2e9c9 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INTPTR_MAX.html @@ -0,0 +1 @@ +INTPTR_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::INTPTR_MAX

source ·
pub const INTPTR_MAX: u64 = 9223372036854775807;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INTPTR_MIN.html b/wasmedge_sys/ffi/constant.INTPTR_MIN.html new file mode 100644 index 000000000..fd6886955 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INTPTR_MIN.html @@ -0,0 +1 @@ +INTPTR_MIN in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::INTPTR_MIN

source ·
pub const INTPTR_MIN: i64 = - 9223372036854775808;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_FAST16_MAX.html b/wasmedge_sys/ffi/constant.INT_FAST16_MAX.html new file mode 100644 index 000000000..9fce2e73b --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_FAST16_MAX.html @@ -0,0 +1 @@ +INT_FAST16_MAX in wasmedge_sys::ffi - Rust
pub const INT_FAST16_MAX: u64 = 9223372036854775807;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_FAST16_MIN.html b/wasmedge_sys/ffi/constant.INT_FAST16_MIN.html new file mode 100644 index 000000000..eab950b0f --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_FAST16_MIN.html @@ -0,0 +1 @@ +INT_FAST16_MIN in wasmedge_sys::ffi - Rust
pub const INT_FAST16_MIN: i64 = - 9223372036854775808;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_FAST32_MAX.html b/wasmedge_sys/ffi/constant.INT_FAST32_MAX.html new file mode 100644 index 000000000..a04363ce7 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_FAST32_MAX.html @@ -0,0 +1 @@ +INT_FAST32_MAX in wasmedge_sys::ffi - Rust
pub const INT_FAST32_MAX: u64 = 9223372036854775807;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_FAST32_MIN.html b/wasmedge_sys/ffi/constant.INT_FAST32_MIN.html new file mode 100644 index 000000000..870c56604 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_FAST32_MIN.html @@ -0,0 +1 @@ +INT_FAST32_MIN in wasmedge_sys::ffi - Rust
pub const INT_FAST32_MIN: i64 = - 9223372036854775808;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_FAST8_MAX.html b/wasmedge_sys/ffi/constant.INT_FAST8_MAX.html new file mode 100644 index 000000000..15c51957d --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_FAST8_MAX.html @@ -0,0 +1 @@ +INT_FAST8_MAX in wasmedge_sys::ffi - Rust
pub const INT_FAST8_MAX: u32 = 127;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_FAST8_MIN.html b/wasmedge_sys/ffi/constant.INT_FAST8_MIN.html new file mode 100644 index 000000000..b7c90ec01 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_FAST8_MIN.html @@ -0,0 +1 @@ +INT_FAST8_MIN in wasmedge_sys::ffi - Rust
pub const INT_FAST8_MIN: i32 = - 128;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_LEAST16_MAX.html b/wasmedge_sys/ffi/constant.INT_LEAST16_MAX.html new file mode 100644 index 000000000..b43ae56e1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_LEAST16_MAX.html @@ -0,0 +1 @@ +INT_LEAST16_MAX in wasmedge_sys::ffi - Rust
pub const INT_LEAST16_MAX: u32 = 32767;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_LEAST16_MIN.html b/wasmedge_sys/ffi/constant.INT_LEAST16_MIN.html new file mode 100644 index 000000000..01dc99e6a --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_LEAST16_MIN.html @@ -0,0 +1 @@ +INT_LEAST16_MIN in wasmedge_sys::ffi - Rust
pub const INT_LEAST16_MIN: i32 = - 32768;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_LEAST32_MAX.html b/wasmedge_sys/ffi/constant.INT_LEAST32_MAX.html new file mode 100644 index 000000000..a88047e6c --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_LEAST32_MAX.html @@ -0,0 +1 @@ +INT_LEAST32_MAX in wasmedge_sys::ffi - Rust
pub const INT_LEAST32_MAX: u32 = 2147483647;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_LEAST32_MIN.html b/wasmedge_sys/ffi/constant.INT_LEAST32_MIN.html new file mode 100644 index 000000000..120d19e49 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_LEAST32_MIN.html @@ -0,0 +1 @@ +INT_LEAST32_MIN in wasmedge_sys::ffi - Rust
pub const INT_LEAST32_MIN: i32 = - 2147483648;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_LEAST8_MAX.html b/wasmedge_sys/ffi/constant.INT_LEAST8_MAX.html new file mode 100644 index 000000000..1fb33266d --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_LEAST8_MAX.html @@ -0,0 +1 @@ +INT_LEAST8_MAX in wasmedge_sys::ffi - Rust
pub const INT_LEAST8_MAX: u32 = 127;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.INT_LEAST8_MIN.html b/wasmedge_sys/ffi/constant.INT_LEAST8_MIN.html new file mode 100644 index 000000000..36a65fcb6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.INT_LEAST8_MIN.html @@ -0,0 +1 @@ +INT_LEAST8_MIN in wasmedge_sys::ffi - Rust
pub const INT_LEAST8_MIN: i32 = - 128;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.PTRDIFF_MAX.html b/wasmedge_sys/ffi/constant.PTRDIFF_MAX.html new file mode 100644 index 000000000..2824ce7b0 --- /dev/null +++ b/wasmedge_sys/ffi/constant.PTRDIFF_MAX.html @@ -0,0 +1 @@ +PTRDIFF_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::PTRDIFF_MAX

source ·
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.PTRDIFF_MIN.html b/wasmedge_sys/ffi/constant.PTRDIFF_MIN.html new file mode 100644 index 000000000..fb4929cdb --- /dev/null +++ b/wasmedge_sys/ffi/constant.PTRDIFF_MIN.html @@ -0,0 +1 @@ +PTRDIFF_MIN in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::PTRDIFF_MIN

source ·
pub const PTRDIFF_MIN: i64 = - 9223372036854775808;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.SIG_ATOMIC_MAX.html b/wasmedge_sys/ffi/constant.SIG_ATOMIC_MAX.html new file mode 100644 index 000000000..2e29123dc --- /dev/null +++ b/wasmedge_sys/ffi/constant.SIG_ATOMIC_MAX.html @@ -0,0 +1 @@ +SIG_ATOMIC_MAX in wasmedge_sys::ffi - Rust
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.SIG_ATOMIC_MIN.html b/wasmedge_sys/ffi/constant.SIG_ATOMIC_MIN.html new file mode 100644 index 000000000..94eb8212b --- /dev/null +++ b/wasmedge_sys/ffi/constant.SIG_ATOMIC_MIN.html @@ -0,0 +1 @@ +SIG_ATOMIC_MIN in wasmedge_sys::ffi - Rust
pub const SIG_ATOMIC_MIN: i32 = - 2147483648;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.SIZE_MAX.html b/wasmedge_sys/ffi/constant.SIZE_MAX.html new file mode 100644 index 000000000..d03c2d2f9 --- /dev/null +++ b/wasmedge_sys/ffi/constant.SIZE_MAX.html @@ -0,0 +1 @@ +SIZE_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::SIZE_MAX

source ·
pub const SIZE_MAX: i32 = - 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT16_MAX.html b/wasmedge_sys/ffi/constant.UINT16_MAX.html new file mode 100644 index 000000000..150eb2509 --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT16_MAX.html @@ -0,0 +1 @@ +UINT16_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::UINT16_MAX

source ·
pub const UINT16_MAX: u32 = 65535;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT32_MAX.html b/wasmedge_sys/ffi/constant.UINT32_MAX.html new file mode 100644 index 000000000..d2aa0d4aa --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT32_MAX.html @@ -0,0 +1 @@ +UINT32_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::UINT32_MAX

source ·
pub const UINT32_MAX: u32 = 4294967295;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT8_MAX.html b/wasmedge_sys/ffi/constant.UINT8_MAX.html new file mode 100644 index 000000000..dc604ddb6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT8_MAX.html @@ -0,0 +1 @@ +UINT8_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::UINT8_MAX

source ·
pub const UINT8_MAX: u32 = 255;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINTPTR_MAX.html b/wasmedge_sys/ffi/constant.UINTPTR_MAX.html new file mode 100644 index 000000000..9e56fcdc6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINTPTR_MAX.html @@ -0,0 +1 @@ +UINTPTR_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::UINTPTR_MAX

source ·
pub const UINTPTR_MAX: i32 = - 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT_FAST16_MAX.html b/wasmedge_sys/ffi/constant.UINT_FAST16_MAX.html new file mode 100644 index 000000000..5fb8e7aba --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT_FAST16_MAX.html @@ -0,0 +1 @@ +UINT_FAST16_MAX in wasmedge_sys::ffi - Rust
pub const UINT_FAST16_MAX: i32 = - 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT_FAST32_MAX.html b/wasmedge_sys/ffi/constant.UINT_FAST32_MAX.html new file mode 100644 index 000000000..0c90e7247 --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT_FAST32_MAX.html @@ -0,0 +1 @@ +UINT_FAST32_MAX in wasmedge_sys::ffi - Rust
pub const UINT_FAST32_MAX: i32 = - 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT_FAST8_MAX.html b/wasmedge_sys/ffi/constant.UINT_FAST8_MAX.html new file mode 100644 index 000000000..96f6ede02 --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT_FAST8_MAX.html @@ -0,0 +1 @@ +UINT_FAST8_MAX in wasmedge_sys::ffi - Rust
pub const UINT_FAST8_MAX: u32 = 255;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT_LEAST16_MAX.html b/wasmedge_sys/ffi/constant.UINT_LEAST16_MAX.html new file mode 100644 index 000000000..e56bd23bf --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT_LEAST16_MAX.html @@ -0,0 +1 @@ +UINT_LEAST16_MAX in wasmedge_sys::ffi - Rust
pub const UINT_LEAST16_MAX: u32 = 65535;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT_LEAST32_MAX.html b/wasmedge_sys/ffi/constant.UINT_LEAST32_MAX.html new file mode 100644 index 000000000..2e68204ab --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT_LEAST32_MAX.html @@ -0,0 +1 @@ +UINT_LEAST32_MAX in wasmedge_sys::ffi - Rust
pub const UINT_LEAST32_MAX: u32 = 4294967295;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.UINT_LEAST8_MAX.html b/wasmedge_sys/ffi/constant.UINT_LEAST8_MAX.html new file mode 100644 index 000000000..5b144506f --- /dev/null +++ b/wasmedge_sys/ffi/constant.UINT_LEAST8_MAX.html @@ -0,0 +1 @@ +UINT_LEAST8_MAX in wasmedge_sys::ffi - Rust
pub const UINT_LEAST8_MAX: u32 = 255;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WASMEDGE_VERSION.html b/wasmedge_sys/ffi/constant.WASMEDGE_VERSION.html new file mode 100644 index 000000000..179d11025 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WASMEDGE_VERSION.html @@ -0,0 +1 @@ +WASMEDGE_VERSION in wasmedge_sys::ffi - Rust
pub const WASMEDGE_VERSION: &[u8; 7] = b"0.13.5\0";
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_MAJOR.html b/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_MAJOR.html new file mode 100644 index 000000000..98c003160 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_MAJOR.html @@ -0,0 +1 @@ +WASMEDGE_VERSION_MAJOR in wasmedge_sys::ffi - Rust
pub const WASMEDGE_VERSION_MAJOR: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_MINOR.html b/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_MINOR.html new file mode 100644 index 000000000..aa6d4cc6d --- /dev/null +++ b/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_MINOR.html @@ -0,0 +1 @@ +WASMEDGE_VERSION_MINOR in wasmedge_sys::ffi - Rust
pub const WASMEDGE_VERSION_MINOR: u32 = 13;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_PATCH.html b/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_PATCH.html new file mode 100644 index 000000000..82628a10e --- /dev/null +++ b/wasmedge_sys/ffi/constant.WASMEDGE_VERSION_PATCH.html @@ -0,0 +1 @@ +WASMEDGE_VERSION_PATCH in wasmedge_sys::ffi - Rust
pub const WASMEDGE_VERSION_PATCH: u32 = 5;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WINT_MAX.html b/wasmedge_sys/ffi/constant.WINT_MAX.html new file mode 100644 index 000000000..cd00aec0a --- /dev/null +++ b/wasmedge_sys/ffi/constant.WINT_MAX.html @@ -0,0 +1 @@ +WINT_MAX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::WINT_MAX

source ·
pub const WINT_MAX: u32 = 4294967295;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WINT_MIN.html b/wasmedge_sys/ffi/constant.WINT_MIN.html new file mode 100644 index 000000000..361fb8156 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WINT_MIN.html @@ -0,0 +1 @@ +WINT_MIN in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::WINT_MIN

source ·
pub const WINT_MIN: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O0.html b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O0.html new file mode 100644 index 000000000..642a46dae --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O0.html @@ -0,0 +1 @@ +WasmEdge_CompilerOptimizationLevel_O0 in wasmedge_sys::ffi - Rust
pub const WasmEdge_CompilerOptimizationLevel_O0: WasmEdge_CompilerOptimizationLevel = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O1.html b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O1.html new file mode 100644 index 000000000..aec8110f8 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O1.html @@ -0,0 +1 @@ +WasmEdge_CompilerOptimizationLevel_O1 in wasmedge_sys::ffi - Rust
pub const WasmEdge_CompilerOptimizationLevel_O1: WasmEdge_CompilerOptimizationLevel = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O2.html b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O2.html new file mode 100644 index 000000000..8985b54d7 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O2.html @@ -0,0 +1 @@ +WasmEdge_CompilerOptimizationLevel_O2 in wasmedge_sys::ffi - Rust
pub const WasmEdge_CompilerOptimizationLevel_O2: WasmEdge_CompilerOptimizationLevel = 2;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O3.html b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O3.html new file mode 100644 index 000000000..51f678645 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_O3.html @@ -0,0 +1 @@ +WasmEdge_CompilerOptimizationLevel_O3 in wasmedge_sys::ffi - Rust
pub const WasmEdge_CompilerOptimizationLevel_O3: WasmEdge_CompilerOptimizationLevel = 3;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_Os.html b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_Os.html new file mode 100644 index 000000000..40bcff1fb --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_Os.html @@ -0,0 +1 @@ +WasmEdge_CompilerOptimizationLevel_Os in wasmedge_sys::ffi - Rust
pub const WasmEdge_CompilerOptimizationLevel_Os: WasmEdge_CompilerOptimizationLevel = 4;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_Oz.html b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_Oz.html new file mode 100644 index 000000000..edf85cf07 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOptimizationLevel_Oz.html @@ -0,0 +1 @@ +WasmEdge_CompilerOptimizationLevel_Oz in wasmedge_sys::ffi - Rust
pub const WasmEdge_CompilerOptimizationLevel_Oz: WasmEdge_CompilerOptimizationLevel = 5;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_CompilerOutputFormat_Native.html b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOutputFormat_Native.html new file mode 100644 index 000000000..7b2fcb195 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOutputFormat_Native.html @@ -0,0 +1 @@ +WasmEdge_CompilerOutputFormat_Native in wasmedge_sys::ffi - Rust
pub const WasmEdge_CompilerOutputFormat_Native: WasmEdge_CompilerOutputFormat = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_CompilerOutputFormat_Wasm.html b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOutputFormat_Wasm.html new file mode 100644 index 000000000..490ea9387 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_CompilerOutputFormat_Wasm.html @@ -0,0 +1 @@ +WasmEdge_CompilerOutputFormat_Wasm in wasmedge_sys::ffi - Rust
pub const WasmEdge_CompilerOutputFormat_Wasm: WasmEdge_CompilerOutputFormat = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCategory_UserLevelError.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCategory_UserLevelError.html new file mode 100644 index 000000000..dead81d88 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCategory_UserLevelError.html @@ -0,0 +1 @@ +WasmEdge_ErrCategory_UserLevelError in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCategory_UserLevelError: WasmEdge_ErrCategory = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCategory_WASM.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCategory_WASM.html new file mode 100644 index 000000000..ab36d4aee --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCategory_WASM.html @@ -0,0 +1 @@ +WasmEdge_ErrCategory_WASM in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCategory_WASM: WasmEdge_ErrCategory = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_AOTDisabled.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_AOTDisabled.html new file mode 100644 index 000000000..a8c559c77 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_AOTDisabled.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_AOTDisabled in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_AOTDisabled: WasmEdge_ErrCode = 6;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ConstExprRequired.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ConstExprRequired.html new file mode 100644 index 000000000..6c9e1c9ea --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ConstExprRequired.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_ConstExprRequired in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_ConstExprRequired: WasmEdge_ErrCode = 76;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_CostLimitExceeded.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_CostLimitExceeded.html new file mode 100644 index 000000000..ac5a2af89 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_CostLimitExceeded.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_CostLimitExceeded in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_CostLimitExceeded: WasmEdge_ErrCode = 3;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DataCountRequired.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DataCountRequired.html new file mode 100644 index 000000000..c2a2fe825 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DataCountRequired.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_DataCountRequired in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_DataCountRequired: WasmEdge_ErrCode = 43;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DataSegDoesNotFit.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DataSegDoesNotFit.html new file mode 100644 index 000000000..43432c115 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DataSegDoesNotFit.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_DataSegDoesNotFit in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_DataSegDoesNotFit: WasmEdge_ErrCode = 99;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DivideByZero.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DivideByZero.html new file mode 100644 index 000000000..1d138d69a --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DivideByZero.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_DivideByZero in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_DivideByZero: WasmEdge_ErrCode = 132;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DupExportName.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DupExportName.html new file mode 100644 index 000000000..c000cec33 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_DupExportName.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_DupExportName in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_DupExportName: WasmEdge_ErrCode = 77;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ENDCodeExpected.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ENDCodeExpected.html new file mode 100644 index 000000000..a9c8364f4 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ENDCodeExpected.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_ENDCodeExpected in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_ENDCodeExpected: WasmEdge_ErrCode = 56;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ElemSegDoesNotFit.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ElemSegDoesNotFit.html new file mode 100644 index 000000000..65cc4e2fd --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ElemSegDoesNotFit.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_ElemSegDoesNotFit in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_ElemSegDoesNotFit: WasmEdge_ErrCode = 100;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ExpectSharedMemory.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ExpectSharedMemory.html new file mode 100644 index 000000000..c62ff0873 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ExpectSharedMemory.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_ExpectSharedMemory in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_ExpectSharedMemory: WasmEdge_ErrCode = 144;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ExpectedZeroByte.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ExpectedZeroByte.html new file mode 100644 index 000000000..160af969a --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ExpectedZeroByte.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_ExpectedZeroByte in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_ExpectedZeroByte: WasmEdge_ErrCode = 46;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_FuncNotFound.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_FuncNotFound.html new file mode 100644 index 000000000..0cc45546e --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_FuncNotFound.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_FuncNotFound in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_FuncNotFound: WasmEdge_ErrCode = 5;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_FuncSigMismatch.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_FuncSigMismatch.html new file mode 100644 index 000000000..7b7877049 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_FuncSigMismatch.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_FuncSigMismatch in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_FuncSigMismatch: WasmEdge_ErrCode = 131;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_HostFuncError.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_HostFuncError.html new file mode 100644 index 000000000..04b3129a6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_HostFuncError.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_HostFuncError in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_HostFuncError: WasmEdge_ErrCode = 141;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalGrammar.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalGrammar.html new file mode 100644 index 000000000..1bcc9810f --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalGrammar.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IllegalGrammar in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IllegalGrammar: WasmEdge_ErrCode = 57;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalOpCode.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalOpCode.html new file mode 100644 index 000000000..2653a42e6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalOpCode.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IllegalOpCode in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IllegalOpCode: WasmEdge_ErrCode = 55;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalPath.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalPath.html new file mode 100644 index 000000000..21ff9ce3b --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IllegalPath.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IllegalPath in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IllegalPath: WasmEdge_ErrCode = 32;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ImmutableGlobal.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ImmutableGlobal.html new file mode 100644 index 000000000..09d468cdd --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ImmutableGlobal.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_ImmutableGlobal in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_ImmutableGlobal: WasmEdge_ErrCode = 78;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleDataCount.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleDataCount.html new file mode 100644 index 000000000..480c0a3f3 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleDataCount.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IncompatibleDataCount in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IncompatibleDataCount: WasmEdge_ErrCode = 42;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleFuncCode.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleFuncCode.html new file mode 100644 index 000000000..475a51ba8 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleFuncCode.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IncompatibleFuncCode in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IncompatibleFuncCode: WasmEdge_ErrCode = 41;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleImportType.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleImportType.html new file mode 100644 index 000000000..84ea25fd6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IncompatibleImportType.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IncompatibleImportType in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IncompatibleImportType: WasmEdge_ErrCode = 97;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IndirectCallTypeMismatch.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IndirectCallTypeMismatch.html new file mode 100644 index 000000000..5e0e02ef4 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IndirectCallTypeMismatch.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IndirectCallTypeMismatch in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IndirectCallTypeMismatch: WasmEdge_ErrCode = 140;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InstrTypeMismatch.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InstrTypeMismatch.html new file mode 100644 index 000000000..618fc8d3f --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InstrTypeMismatch.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InstrTypeMismatch in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InstrTypeMismatch: WasmEdge_ErrCode = 130;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerOverflow.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerOverflow.html new file mode 100644 index 000000000..d25a9691b --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerOverflow.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IntegerOverflow in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IntegerOverflow: WasmEdge_ErrCode = 133;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerTooLarge.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerTooLarge.html new file mode 100644 index 000000000..7f047d8fa --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerTooLarge.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IntegerTooLarge in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IntegerTooLarge: WasmEdge_ErrCode = 53;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerTooLong.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerTooLong.html new file mode 100644 index 000000000..b2df1d425 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntegerTooLong.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IntegerTooLong in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IntegerTooLong: WasmEdge_ErrCode = 54;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Interrupted.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Interrupted.html new file mode 100644 index 000000000..855f5ba62 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Interrupted.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_Interrupted in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_Interrupted: WasmEdge_ErrCode = 7;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntrinsicsTableNotFound.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntrinsicsTableNotFound.html new file mode 100644 index 000000000..e30b8040c --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_IntrinsicsTableNotFound.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_IntrinsicsTableNotFound in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_IntrinsicsTableNotFound: WasmEdge_ErrCode = 59;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidAlignment.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidAlignment.html new file mode 100644 index 000000000..915aaca69 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidAlignment.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidAlignment in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidAlignment: WasmEdge_ErrCode = 64;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidConvToInt.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidConvToInt.html new file mode 100644 index 000000000..8a9f95ca7 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidConvToInt.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidConvToInt in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidConvToInt: WasmEdge_ErrCode = 134;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidDataIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidDataIdx.html new file mode 100644 index 000000000..8ef8a8924 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidDataIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidDataIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidDataIdx: WasmEdge_ErrCode = 74;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidElemIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidElemIdx.html new file mode 100644 index 000000000..41905e38d --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidElemIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidElemIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidElemIdx: WasmEdge_ErrCode = 73;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidFuncIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidFuncIdx.html new file mode 100644 index 000000000..bd9bf53a8 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidFuncIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidFuncIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidFuncIdx: WasmEdge_ErrCode = 69;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidFuncTypeIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidFuncTypeIdx.html new file mode 100644 index 000000000..7d0d8f5db --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidFuncTypeIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidFuncTypeIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidFuncTypeIdx: WasmEdge_ErrCode = 68;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidGlobalIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidGlobalIdx.html new file mode 100644 index 000000000..fef478ed1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidGlobalIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidGlobalIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidGlobalIdx: WasmEdge_ErrCode = 72;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLabelIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLabelIdx.html new file mode 100644 index 000000000..2209248a9 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLabelIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidLabelIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidLabelIdx: WasmEdge_ErrCode = 66;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLaneIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLaneIdx.html new file mode 100644 index 000000000..c0b967a52 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLaneIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidLaneIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidLaneIdx: WasmEdge_ErrCode = 85;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLimit.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLimit.html new file mode 100644 index 000000000..fe2177ec4 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLimit.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidLimit in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidLimit: WasmEdge_ErrCode = 82;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLocalIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLocalIdx.html new file mode 100644 index 000000000..19bb49436 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidLocalIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidLocalIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidLocalIdx: WasmEdge_ErrCode = 67;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMemPages.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMemPages.html new file mode 100644 index 000000000..bd1117c47 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMemPages.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidMemPages in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidMemPages: WasmEdge_ErrCode = 83;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMemoryIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMemoryIdx.html new file mode 100644 index 000000000..7dfd30e44 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMemoryIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidMemoryIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidMemoryIdx: WasmEdge_ErrCode = 71;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMut.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMut.html new file mode 100644 index 000000000..b490d7ece --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidMut.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidMut in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidMut: WasmEdge_ErrCode = 47;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidRefIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidRefIdx.html new file mode 100644 index 000000000..65781cb41 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidRefIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidRefIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidRefIdx: WasmEdge_ErrCode = 75;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidResultArity.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidResultArity.html new file mode 100644 index 000000000..6068cb829 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidResultArity.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidResultArity in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidResultArity: WasmEdge_ErrCode = 79;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidStartFunc.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidStartFunc.html new file mode 100644 index 000000000..e40c74aba --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidStartFunc.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidStartFunc in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidStartFunc: WasmEdge_ErrCode = 84;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidTableIdx.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidTableIdx.html new file mode 100644 index 000000000..2acca3059 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_InvalidTableIdx.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_InvalidTableIdx in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_InvalidTableIdx: WasmEdge_ErrCode = 70;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_JunkSection.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_JunkSection.html new file mode 100644 index 000000000..5ac5da85f --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_JunkSection.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_JunkSection in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_JunkSection: WasmEdge_ErrCode = 40;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_LengthOutOfBounds.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_LengthOutOfBounds.html new file mode 100644 index 000000000..54b637bc2 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_LengthOutOfBounds.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_LengthOutOfBounds in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_LengthOutOfBounds: WasmEdge_ErrCode = 39;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedElemType.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedElemType.html new file mode 100644 index 000000000..261c5ba72 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedElemType.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedElemType in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedElemType: WasmEdge_ErrCode = 50;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedExportKind.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedExportKind.html new file mode 100644 index 000000000..c68068d80 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedExportKind.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedExportKind in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedExportKind: WasmEdge_ErrCode = 45;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedImportKind.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedImportKind.html new file mode 100644 index 000000000..508338d49 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedImportKind.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedImportKind in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedImportKind: WasmEdge_ErrCode = 44;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedMagic.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedMagic.html new file mode 100644 index 000000000..22d24e60f --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedMagic.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedMagic in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedMagic: WasmEdge_ErrCode = 35;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedRefType.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedRefType.html new file mode 100644 index 000000000..46662079d --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedRefType.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedRefType in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedRefType: WasmEdge_ErrCode = 51;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedSection.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedSection.html new file mode 100644 index 000000000..83535db7b --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedSection.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedSection in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedSection: WasmEdge_ErrCode = 37;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedUTF8.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedUTF8.html new file mode 100644 index 000000000..c2ced2936 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedUTF8.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedUTF8 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedUTF8: WasmEdge_ErrCode = 52;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedValType.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedValType.html new file mode 100644 index 000000000..16271c763 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedValType.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedValType in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedValType: WasmEdge_ErrCode = 49;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedVersion.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedVersion.html new file mode 100644 index 000000000..917d5fe42 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MalformedVersion.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MalformedVersion in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MalformedVersion: WasmEdge_ErrCode = 36;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MemoryOutOfBounds.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MemoryOutOfBounds.html new file mode 100644 index 000000000..31e123bc9 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MemoryOutOfBounds.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MemoryOutOfBounds in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MemoryOutOfBounds: WasmEdge_ErrCode = 136;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ModuleNameConflict.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ModuleNameConflict.html new file mode 100644 index 000000000..77a8c4992 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ModuleNameConflict.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_ModuleNameConflict in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_ModuleNameConflict: WasmEdge_ErrCode = 96;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MultiMemories.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MultiMemories.html new file mode 100644 index 000000000..9da886cfe --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MultiMemories.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MultiMemories in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MultiMemories: WasmEdge_ErrCode = 81;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MultiTables.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MultiTables.html new file mode 100644 index 000000000..29c08b9a1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_MultiTables.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_MultiTables in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_MultiTables: WasmEdge_ErrCode = 80;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_NotValidated.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_NotValidated.html new file mode 100644 index 000000000..a0441e6e2 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_NotValidated.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_NotValidated in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_NotValidated: WasmEdge_ErrCode = 8;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ReadError.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ReadError.html new file mode 100644 index 000000000..d61de5adb --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_ReadError.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_ReadError in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_ReadError: WasmEdge_ErrCode = 33;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_RefTypeMismatch.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_RefTypeMismatch.html new file mode 100644 index 000000000..d699d1472 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_RefTypeMismatch.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_RefTypeMismatch in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_RefTypeMismatch: WasmEdge_ErrCode = 142;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_RuntimeError.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_RuntimeError.html new file mode 100644 index 000000000..5c48c7f02 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_RuntimeError.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_RuntimeError in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_RuntimeError: WasmEdge_ErrCode = 2;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_SectionSizeMismatch.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_SectionSizeMismatch.html new file mode 100644 index 000000000..a8dd2dd24 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_SectionSizeMismatch.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_SectionSizeMismatch in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_SectionSizeMismatch: WasmEdge_ErrCode = 38;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_SharedMemoryNoMax.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_SharedMemoryNoMax.html new file mode 100644 index 000000000..eb637286b --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_SharedMemoryNoMax.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_SharedMemoryNoMax in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_SharedMemoryNoMax: WasmEdge_ErrCode = 58;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Success.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Success.html new file mode 100644 index 000000000..53448a11f --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Success.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_Success in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_Success: WasmEdge_ErrCode = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TableOutOfBounds.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TableOutOfBounds.html new file mode 100644 index 000000000..cd3645979 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TableOutOfBounds.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_TableOutOfBounds in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_TableOutOfBounds: WasmEdge_ErrCode = 135;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Terminated.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Terminated.html new file mode 100644 index 000000000..45a490588 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Terminated.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_Terminated in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_Terminated: WasmEdge_ErrCode = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TooManyLocals.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TooManyLocals.html new file mode 100644 index 000000000..60a8a61a4 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TooManyLocals.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_TooManyLocals in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_TooManyLocals: WasmEdge_ErrCode = 48;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TypeCheckFailed.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TypeCheckFailed.html new file mode 100644 index 000000000..6923a34d2 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_TypeCheckFailed.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_TypeCheckFailed in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_TypeCheckFailed: WasmEdge_ErrCode = 65;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnalignedAtomicAccess.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnalignedAtomicAccess.html new file mode 100644 index 000000000..934d8f6e8 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnalignedAtomicAccess.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_UnalignedAtomicAccess in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_UnalignedAtomicAccess: WasmEdge_ErrCode = 143;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UndefinedElement.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UndefinedElement.html new file mode 100644 index 000000000..4726cb307 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UndefinedElement.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_UndefinedElement in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_UndefinedElement: WasmEdge_ErrCode = 139;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnexpectedEnd.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnexpectedEnd.html new file mode 100644 index 000000000..c9267f5ec --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnexpectedEnd.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_UnexpectedEnd in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_UnexpectedEnd: WasmEdge_ErrCode = 34;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UninitializedElement.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UninitializedElement.html new file mode 100644 index 000000000..d36d7dbb7 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UninitializedElement.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_UninitializedElement in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_UninitializedElement: WasmEdge_ErrCode = 138;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnknownImport.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnknownImport.html new file mode 100644 index 000000000..56bff4433 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UnknownImport.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_UnknownImport in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_UnknownImport: WasmEdge_ErrCode = 98;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Unreachable.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Unreachable.html new file mode 100644 index 000000000..35f9483ff --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_Unreachable.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_Unreachable in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_Unreachable: WasmEdge_ErrCode = 137;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UserDefError.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UserDefError.html new file mode 100644 index 000000000..ab2c33a17 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_UserDefError.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_UserDefError in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_UserDefError: WasmEdge_ErrCode = 9;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongInstanceAddress.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongInstanceAddress.html new file mode 100644 index 000000000..fdca0f33a --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongInstanceAddress.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_WrongInstanceAddress in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_WrongInstanceAddress: WasmEdge_ErrCode = 128;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongInstanceIndex.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongInstanceIndex.html new file mode 100644 index 000000000..f04ee8827 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongInstanceIndex.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_WrongInstanceIndex in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_WrongInstanceIndex: WasmEdge_ErrCode = 129;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongVMWorkflow.html b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongVMWorkflow.html new file mode 100644 index 000000000..4cfa05717 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ErrCode_WrongVMWorkflow.html @@ -0,0 +1 @@ +WasmEdge_ErrCode_WrongVMWorkflow in wasmedge_sys::ffi - Rust
pub const WasmEdge_ErrCode_WrongVMWorkflow: WasmEdge_ErrCode = 4;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Function.html b/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Function.html new file mode 100644 index 000000000..ad7761014 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Function.html @@ -0,0 +1 @@ +WasmEdge_ExternalType_Function in wasmedge_sys::ffi - Rust
pub const WasmEdge_ExternalType_Function: WasmEdge_ExternalType = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Global.html b/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Global.html new file mode 100644 index 000000000..1bdfd989e --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Global.html @@ -0,0 +1 @@ +WasmEdge_ExternalType_Global in wasmedge_sys::ffi - Rust
pub const WasmEdge_ExternalType_Global: WasmEdge_ExternalType = 3;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Memory.html b/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Memory.html new file mode 100644 index 000000000..98a7bab0c --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Memory.html @@ -0,0 +1 @@ +WasmEdge_ExternalType_Memory in wasmedge_sys::ffi - Rust
pub const WasmEdge_ExternalType_Memory: WasmEdge_ExternalType = 2;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Table.html b/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Table.html new file mode 100644 index 000000000..bb5ef3244 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ExternalType_Table.html @@ -0,0 +1 @@ +WasmEdge_ExternalType_Table in wasmedge_sys::ffi - Rust
pub const WasmEdge_ExternalType_Table: WasmEdge_ExternalType = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_HostRegistration_Wasi.html b/wasmedge_sys/ffi/constant.WasmEdge_HostRegistration_Wasi.html new file mode 100644 index 000000000..0b63c4067 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_HostRegistration_Wasi.html @@ -0,0 +1 @@ +WasmEdge_HostRegistration_Wasi in wasmedge_sys::ffi - Rust
pub const WasmEdge_HostRegistration_Wasi: WasmEdge_HostRegistration = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Mutability_Const.html b/wasmedge_sys/ffi/constant.WasmEdge_Mutability_Const.html new file mode 100644 index 000000000..70bf450fd --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Mutability_Const.html @@ -0,0 +1 @@ +WasmEdge_Mutability_Const in wasmedge_sys::ffi - Rust
pub const WasmEdge_Mutability_Const: WasmEdge_Mutability = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Mutability_Var.html b/wasmedge_sys/ffi/constant.WasmEdge_Mutability_Var.html new file mode 100644 index 000000000..4b8cde62e --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Mutability_Var.html @@ -0,0 +1 @@ +WasmEdge_Mutability_Var in wasmedge_sys::ffi - Rust
pub const WasmEdge_Mutability_Var: WasmEdge_Mutability = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_NumType_F32.html b/wasmedge_sys/ffi/constant.WasmEdge_NumType_F32.html new file mode 100644 index 000000000..8230edf18 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_NumType_F32.html @@ -0,0 +1 @@ +WasmEdge_NumType_F32 in wasmedge_sys::ffi - Rust
pub const WasmEdge_NumType_F32: WasmEdge_NumType = 125;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_NumType_F64.html b/wasmedge_sys/ffi/constant.WasmEdge_NumType_F64.html new file mode 100644 index 000000000..b76cedfc1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_NumType_F64.html @@ -0,0 +1 @@ +WasmEdge_NumType_F64 in wasmedge_sys::ffi - Rust
pub const WasmEdge_NumType_F64: WasmEdge_NumType = 124;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_NumType_I32.html b/wasmedge_sys/ffi/constant.WasmEdge_NumType_I32.html new file mode 100644 index 000000000..ec6f6797c --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_NumType_I32.html @@ -0,0 +1 @@ +WasmEdge_NumType_I32 in wasmedge_sys::ffi - Rust
pub const WasmEdge_NumType_I32: WasmEdge_NumType = 127;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_NumType_I64.html b/wasmedge_sys/ffi/constant.WasmEdge_NumType_I64.html new file mode 100644 index 000000000..d604b0db3 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_NumType_I64.html @@ -0,0 +1 @@ +WasmEdge_NumType_I64 in wasmedge_sys::ffi - Rust
pub const WasmEdge_NumType_I64: WasmEdge_NumType = 126;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_NumType_V128.html b/wasmedge_sys/ffi/constant.WasmEdge_NumType_V128.html new file mode 100644 index 000000000..b261b37d3 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_NumType_V128.html @@ -0,0 +1 @@ +WasmEdge_NumType_V128 in wasmedge_sys::ffi - Rust
pub const WasmEdge_NumType_V128: WasmEdge_NumType = 123;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Plugin_CurrentAPIVersion.html b/wasmedge_sys/ffi/constant.WasmEdge_Plugin_CurrentAPIVersion.html new file mode 100644 index 000000000..29bf5c88b --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Plugin_CurrentAPIVersion.html @@ -0,0 +1 @@ +WasmEdge_Plugin_CurrentAPIVersion in wasmedge_sys::ffi - Rust
pub const WasmEdge_Plugin_CurrentAPIVersion: u32 = 2;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Double.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Double.html new file mode 100644 index 000000000..1a5ad7fd7 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Double.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_Double in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_Double: WasmEdge_ProgramOptionType = 11;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Float.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Float.html new file mode 100644 index 000000000..3ab22c90b --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Float.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_Float in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_Float: WasmEdge_ProgramOptionType = 10;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int16.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int16.html new file mode 100644 index 000000000..48c18e1ce --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int16.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_Int16 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_Int16: WasmEdge_ProgramOptionType = 3;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int32.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int32.html new file mode 100644 index 000000000..380f9d855 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int32.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_Int32 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_Int32: WasmEdge_ProgramOptionType = 4;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int64.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int64.html new file mode 100644 index 000000000..87d2250db --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int64.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_Int64 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_Int64: WasmEdge_ProgramOptionType = 5;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int8.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int8.html new file mode 100644 index 000000000..7318657e6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Int8.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_Int8 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_Int8: WasmEdge_ProgramOptionType = 2;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_None.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_None.html new file mode 100644 index 000000000..1f78fdcd5 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_None.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_None in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_None: WasmEdge_ProgramOptionType = 0;
Expand description

No option value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_String.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_String.html new file mode 100644 index 000000000..8f20c8486 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_String.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_String in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_String: WasmEdge_ProgramOptionType = 12;
Expand description

WasmEdge_String.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Toggle.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Toggle.html new file mode 100644 index 000000000..a1d75dd35 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_Toggle.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_Toggle in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_Toggle: WasmEdge_ProgramOptionType = 1;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt16.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt16.html new file mode 100644 index 000000000..326bb8c54 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt16.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_UInt16 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_UInt16: WasmEdge_ProgramOptionType = 7;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt32.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt32.html new file mode 100644 index 000000000..3352c869c --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt32.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_UInt32 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_UInt32: WasmEdge_ProgramOptionType = 8;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt64.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt64.html new file mode 100644 index 000000000..d53eafa24 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt64.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_UInt64 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_UInt64: WasmEdge_ProgramOptionType = 9;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt8.html b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt8.html new file mode 100644 index 000000000..505e87120 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ProgramOptionType_UInt8.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType_UInt8 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ProgramOptionType_UInt8: WasmEdge_ProgramOptionType = 6;
Expand description

Boolean value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Annotations.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Annotations.html new file mode 100644 index 000000000..2ff7937ed --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Annotations.html @@ -0,0 +1 @@ +WasmEdge_Proposal_Annotations in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_Annotations: WasmEdge_Proposal = 9;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_BulkMemoryOperations.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_BulkMemoryOperations.html new file mode 100644 index 000000000..07c6e9a27 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_BulkMemoryOperations.html @@ -0,0 +1 @@ +WasmEdge_Proposal_BulkMemoryOperations in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_BulkMemoryOperations: WasmEdge_Proposal = 4;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ExceptionHandling.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ExceptionHandling.html new file mode 100644 index 000000000..2a040cc13 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ExceptionHandling.html @@ -0,0 +1 @@ +WasmEdge_Proposal_ExceptionHandling in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_ExceptionHandling: WasmEdge_Proposal = 11;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ExtendedConst.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ExtendedConst.html new file mode 100644 index 000000000..b67207eb9 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ExtendedConst.html @@ -0,0 +1 @@ +WasmEdge_Proposal_ExtendedConst in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_ExtendedConst: WasmEdge_Proposal = 12;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_FunctionReferences.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_FunctionReferences.html new file mode 100644 index 000000000..cabefbe1a --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_FunctionReferences.html @@ -0,0 +1 @@ +WasmEdge_Proposal_FunctionReferences in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_FunctionReferences: WasmEdge_Proposal = 14;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ImportExportMutGlobals.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ImportExportMutGlobals.html new file mode 100644 index 000000000..a920e0631 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ImportExportMutGlobals.html @@ -0,0 +1 @@ +WasmEdge_Proposal_ImportExportMutGlobals in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_ImportExportMutGlobals: WasmEdge_Proposal = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Memory64.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Memory64.html new file mode 100644 index 000000000..15abf78a7 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Memory64.html @@ -0,0 +1 @@ +WasmEdge_Proposal_Memory64 in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_Memory64: WasmEdge_Proposal = 10;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_MultiMemories.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_MultiMemories.html new file mode 100644 index 000000000..098186f27 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_MultiMemories.html @@ -0,0 +1 @@ +WasmEdge_Proposal_MultiMemories in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_MultiMemories: WasmEdge_Proposal = 8;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_MultiValue.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_MultiValue.html new file mode 100644 index 000000000..1337d0a38 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_MultiValue.html @@ -0,0 +1 @@ +WasmEdge_Proposal_MultiValue in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_MultiValue: WasmEdge_Proposal = 3;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_NonTrapFloatToIntConversions.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_NonTrapFloatToIntConversions.html new file mode 100644 index 000000000..c8941a727 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_NonTrapFloatToIntConversions.html @@ -0,0 +1 @@ +WasmEdge_Proposal_NonTrapFloatToIntConversions in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_NonTrapFloatToIntConversions: WasmEdge_Proposal = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ReferenceTypes.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ReferenceTypes.html new file mode 100644 index 000000000..499cea5dc --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_ReferenceTypes.html @@ -0,0 +1 @@ +WasmEdge_Proposal_ReferenceTypes in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_ReferenceTypes: WasmEdge_Proposal = 5;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_SIMD.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_SIMD.html new file mode 100644 index 000000000..d447261d1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_SIMD.html @@ -0,0 +1 @@ +WasmEdge_Proposal_SIMD in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_SIMD: WasmEdge_Proposal = 6;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_SignExtensionOperators.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_SignExtensionOperators.html new file mode 100644 index 000000000..e34d4291c --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_SignExtensionOperators.html @@ -0,0 +1 @@ +WasmEdge_Proposal_SignExtensionOperators in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_SignExtensionOperators: WasmEdge_Proposal = 2;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_TailCall.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_TailCall.html new file mode 100644 index 000000000..2ba809b05 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_TailCall.html @@ -0,0 +1 @@ +WasmEdge_Proposal_TailCall in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_TailCall: WasmEdge_Proposal = 7;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Threads.html b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Threads.html new file mode 100644 index 000000000..da1611046 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_Proposal_Threads.html @@ -0,0 +1 @@ +WasmEdge_Proposal_Threads in wasmedge_sys::ffi - Rust
pub const WasmEdge_Proposal_Threads: WasmEdge_Proposal = 13;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_RefType_ExternRef.html b/wasmedge_sys/ffi/constant.WasmEdge_RefType_ExternRef.html new file mode 100644 index 000000000..33238294a --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_RefType_ExternRef.html @@ -0,0 +1 @@ +WasmEdge_RefType_ExternRef in wasmedge_sys::ffi - Rust
pub const WasmEdge_RefType_ExternRef: WasmEdge_RefType = 111;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_RefType_FuncRef.html b/wasmedge_sys/ffi/constant.WasmEdge_RefType_FuncRef.html new file mode 100644 index 000000000..57e0ec088 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_RefType_FuncRef.html @@ -0,0 +1 @@ +WasmEdge_RefType_FuncRef in wasmedge_sys::ffi - Rust
pub const WasmEdge_RefType_FuncRef: WasmEdge_RefType = 112;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ValType_ExternRef.html b/wasmedge_sys/ffi/constant.WasmEdge_ValType_ExternRef.html new file mode 100644 index 000000000..f3f1162a4 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ValType_ExternRef.html @@ -0,0 +1 @@ +WasmEdge_ValType_ExternRef in wasmedge_sys::ffi - Rust
pub const WasmEdge_ValType_ExternRef: WasmEdge_ValType = 111;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ValType_F32.html b/wasmedge_sys/ffi/constant.WasmEdge_ValType_F32.html new file mode 100644 index 000000000..a570fd3dd --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ValType_F32.html @@ -0,0 +1 @@ +WasmEdge_ValType_F32 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ValType_F32: WasmEdge_ValType = 125;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ValType_F64.html b/wasmedge_sys/ffi/constant.WasmEdge_ValType_F64.html new file mode 100644 index 000000000..e5dd81d55 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ValType_F64.html @@ -0,0 +1 @@ +WasmEdge_ValType_F64 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ValType_F64: WasmEdge_ValType = 124;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ValType_FuncRef.html b/wasmedge_sys/ffi/constant.WasmEdge_ValType_FuncRef.html new file mode 100644 index 000000000..63f753629 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ValType_FuncRef.html @@ -0,0 +1 @@ +WasmEdge_ValType_FuncRef in wasmedge_sys::ffi - Rust
pub const WasmEdge_ValType_FuncRef: WasmEdge_ValType = 112;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ValType_I32.html b/wasmedge_sys/ffi/constant.WasmEdge_ValType_I32.html new file mode 100644 index 000000000..cc827eb91 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ValType_I32.html @@ -0,0 +1 @@ +WasmEdge_ValType_I32 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ValType_I32: WasmEdge_ValType = 127;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ValType_I64.html b/wasmedge_sys/ffi/constant.WasmEdge_ValType_I64.html new file mode 100644 index 000000000..348893204 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ValType_I64.html @@ -0,0 +1 @@ +WasmEdge_ValType_I64 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ValType_I64: WasmEdge_ValType = 126;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.WasmEdge_ValType_V128.html b/wasmedge_sys/ffi/constant.WasmEdge_ValType_V128.html new file mode 100644 index 000000000..0ac893217 --- /dev/null +++ b/wasmedge_sys/ffi/constant.WasmEdge_ValType_V128.html @@ -0,0 +1 @@ +WasmEdge_ValType_V128 in wasmedge_sys::ffi - Rust
pub const WasmEdge_ValType_V128: WasmEdge_ValType = 123;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._ATFILE_SOURCE.html b/wasmedge_sys/ffi/constant._ATFILE_SOURCE.html new file mode 100644 index 000000000..53ca7f64b --- /dev/null +++ b/wasmedge_sys/ffi/constant._ATFILE_SOURCE.html @@ -0,0 +1 @@ +_ATFILE_SOURCE in wasmedge_sys::ffi - Rust
pub const _ATFILE_SOURCE: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._BITS_STDINT_INTN_H.html b/wasmedge_sys/ffi/constant._BITS_STDINT_INTN_H.html new file mode 100644 index 000000000..e0f3c9004 --- /dev/null +++ b/wasmedge_sys/ffi/constant._BITS_STDINT_INTN_H.html @@ -0,0 +1 @@ +_BITS_STDINT_INTN_H in wasmedge_sys::ffi - Rust
pub const _BITS_STDINT_INTN_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._BITS_STDINT_UINTN_H.html b/wasmedge_sys/ffi/constant._BITS_STDINT_UINTN_H.html new file mode 100644 index 000000000..222838193 --- /dev/null +++ b/wasmedge_sys/ffi/constant._BITS_STDINT_UINTN_H.html @@ -0,0 +1 @@ +_BITS_STDINT_UINTN_H in wasmedge_sys::ffi - Rust
pub const _BITS_STDINT_UINTN_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._BITS_TIME64_H.html b/wasmedge_sys/ffi/constant._BITS_TIME64_H.html new file mode 100644 index 000000000..b72ea0734 --- /dev/null +++ b/wasmedge_sys/ffi/constant._BITS_TIME64_H.html @@ -0,0 +1 @@ +_BITS_TIME64_H in wasmedge_sys::ffi - Rust
pub const _BITS_TIME64_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._BITS_TYPESIZES_H.html b/wasmedge_sys/ffi/constant._BITS_TYPESIZES_H.html new file mode 100644 index 000000000..d1e9f439f --- /dev/null +++ b/wasmedge_sys/ffi/constant._BITS_TYPESIZES_H.html @@ -0,0 +1 @@ +_BITS_TYPESIZES_H in wasmedge_sys::ffi - Rust
pub const _BITS_TYPESIZES_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._BITS_TYPES_H.html b/wasmedge_sys/ffi/constant._BITS_TYPES_H.html new file mode 100644 index 000000000..0bfcce09c --- /dev/null +++ b/wasmedge_sys/ffi/constant._BITS_TYPES_H.html @@ -0,0 +1 @@ +_BITS_TYPES_H in wasmedge_sys::ffi - Rust
pub const _BITS_TYPES_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._BITS_WCHAR_H.html b/wasmedge_sys/ffi/constant._BITS_WCHAR_H.html new file mode 100644 index 000000000..4a8a49e98 --- /dev/null +++ b/wasmedge_sys/ffi/constant._BITS_WCHAR_H.html @@ -0,0 +1 @@ +_BITS_WCHAR_H in wasmedge_sys::ffi - Rust
pub const _BITS_WCHAR_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._DEFAULT_SOURCE.html b/wasmedge_sys/ffi/constant._DEFAULT_SOURCE.html new file mode 100644 index 000000000..b6b78032d --- /dev/null +++ b/wasmedge_sys/ffi/constant._DEFAULT_SOURCE.html @@ -0,0 +1 @@ +_DEFAULT_SOURCE in wasmedge_sys::ffi - Rust
pub const _DEFAULT_SOURCE: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._FEATURES_H.html b/wasmedge_sys/ffi/constant._FEATURES_H.html new file mode 100644 index 000000000..fe32779c1 --- /dev/null +++ b/wasmedge_sys/ffi/constant._FEATURES_H.html @@ -0,0 +1 @@ +_FEATURES_H in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::_FEATURES_H

source ·
pub const _FEATURES_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._POSIX_C_SOURCE.html b/wasmedge_sys/ffi/constant._POSIX_C_SOURCE.html new file mode 100644 index 000000000..d6ebf5960 --- /dev/null +++ b/wasmedge_sys/ffi/constant._POSIX_C_SOURCE.html @@ -0,0 +1 @@ +_POSIX_C_SOURCE in wasmedge_sys::ffi - Rust
pub const _POSIX_C_SOURCE: u32 = 200809;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._POSIX_SOURCE.html b/wasmedge_sys/ffi/constant._POSIX_SOURCE.html new file mode 100644 index 000000000..05d75367c --- /dev/null +++ b/wasmedge_sys/ffi/constant._POSIX_SOURCE.html @@ -0,0 +1 @@ +_POSIX_SOURCE in wasmedge_sys::ffi - Rust
pub const _POSIX_SOURCE: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._STDC_PREDEF_H.html b/wasmedge_sys/ffi/constant._STDC_PREDEF_H.html new file mode 100644 index 000000000..414ab0bec --- /dev/null +++ b/wasmedge_sys/ffi/constant._STDC_PREDEF_H.html @@ -0,0 +1 @@ +_STDC_PREDEF_H in wasmedge_sys::ffi - Rust
pub const _STDC_PREDEF_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._STDINT_H.html b/wasmedge_sys/ffi/constant._STDINT_H.html new file mode 100644 index 000000000..1c9aaa406 --- /dev/null +++ b/wasmedge_sys/ffi/constant._STDINT_H.html @@ -0,0 +1 @@ +_STDINT_H in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::_STDINT_H

source ·
pub const _STDINT_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant._SYS_CDEFS_H.html b/wasmedge_sys/ffi/constant._SYS_CDEFS_H.html new file mode 100644 index 000000000..ec0cc28f9 --- /dev/null +++ b/wasmedge_sys/ffi/constant._SYS_CDEFS_H.html @@ -0,0 +1 @@ +_SYS_CDEFS_H in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::_SYS_CDEFS_H

source ·
pub const _SYS_CDEFS_H: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__FD_SETSIZE.html b/wasmedge_sys/ffi/constant.__FD_SETSIZE.html new file mode 100644 index 000000000..bf42da3b6 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__FD_SETSIZE.html @@ -0,0 +1 @@ +__FD_SETSIZE in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__FD_SETSIZE

source ·
pub const __FD_SETSIZE: u32 = 1024;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_MINOR__.html b/wasmedge_sys/ffi/constant.__GLIBC_MINOR__.html new file mode 100644 index 000000000..46b821ef0 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_MINOR__.html @@ -0,0 +1 @@ +__GLIBC_MINOR__ in wasmedge_sys::ffi - Rust
pub const __GLIBC_MINOR__: u32 = 35;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_DEPRECATED_GETS.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_DEPRECATED_GETS.html new file mode 100644 index 000000000..60adea090 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_DEPRECATED_GETS.html @@ -0,0 +1 @@ +__GLIBC_USE_DEPRECATED_GETS in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_DEPRECATED_SCANF.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_DEPRECATED_SCANF.html new file mode 100644 index 000000000..bac2f9be2 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_DEPRECATED_SCANF.html @@ -0,0 +1 @@ +__GLIBC_USE_DEPRECATED_SCANF in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_BFP_EXT.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_BFP_EXT.html new file mode 100644 index 000000000..4523ee810 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_BFP_EXT.html @@ -0,0 +1 @@ +__GLIBC_USE_IEC_60559_BFP_EXT in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_BFP_EXT_C2X.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_BFP_EXT_C2X.html new file mode 100644 index 000000000..9114a301e --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_BFP_EXT_C2X.html @@ -0,0 +1 @@ +__GLIBC_USE_IEC_60559_BFP_EXT_C2X in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_EXT.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_EXT.html new file mode 100644 index 000000000..611aae52f --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_EXT.html @@ -0,0 +1 @@ +__GLIBC_USE_IEC_60559_EXT in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_FUNCS_EXT.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_FUNCS_EXT.html new file mode 100644 index 000000000..d60a5a4f0 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_FUNCS_EXT.html @@ -0,0 +1 @@ +__GLIBC_USE_IEC_60559_FUNCS_EXT in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X.html new file mode 100644 index 000000000..29513b4c9 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X.html @@ -0,0 +1 @@ +__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_TYPES_EXT.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_TYPES_EXT.html new file mode 100644 index 000000000..4c1188235 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_IEC_60559_TYPES_EXT.html @@ -0,0 +1 @@ +__GLIBC_USE_IEC_60559_TYPES_EXT in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_ISOC2X.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_ISOC2X.html new file mode 100644 index 000000000..9e953bac1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_ISOC2X.html @@ -0,0 +1 @@ +__GLIBC_USE_ISOC2X in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_ISOC2X: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC_USE_LIB_EXT2.html b/wasmedge_sys/ffi/constant.__GLIBC_USE_LIB_EXT2.html new file mode 100644 index 000000000..fcd1d13d5 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC_USE_LIB_EXT2.html @@ -0,0 +1 @@ +__GLIBC_USE_LIB_EXT2 in wasmedge_sys::ffi - Rust
pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GLIBC__.html b/wasmedge_sys/ffi/constant.__GLIBC__.html new file mode 100644 index 000000000..1acb1d058 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GLIBC__.html @@ -0,0 +1 @@ +__GLIBC__ in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__GLIBC__

source ·
pub const __GLIBC__: u32 = 2;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__GNU_LIBRARY__.html b/wasmedge_sys/ffi/constant.__GNU_LIBRARY__.html new file mode 100644 index 000000000..848515b20 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__GNU_LIBRARY__.html @@ -0,0 +1 @@ +__GNU_LIBRARY__ in wasmedge_sys::ffi - Rust
pub const __GNU_LIBRARY__: u32 = 6;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__HAVE_GENERIC_SELECTION.html b/wasmedge_sys/ffi/constant.__HAVE_GENERIC_SELECTION.html new file mode 100644 index 000000000..8fd61faf3 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__HAVE_GENERIC_SELECTION.html @@ -0,0 +1 @@ +__HAVE_GENERIC_SELECTION in wasmedge_sys::ffi - Rust
pub const __HAVE_GENERIC_SELECTION: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__INO_T_MATCHES_INO64_T.html b/wasmedge_sys/ffi/constant.__INO_T_MATCHES_INO64_T.html new file mode 100644 index 000000000..488fc205d --- /dev/null +++ b/wasmedge_sys/ffi/constant.__INO_T_MATCHES_INO64_T.html @@ -0,0 +1 @@ +__INO_T_MATCHES_INO64_T in wasmedge_sys::ffi - Rust
pub const __INO_T_MATCHES_INO64_T: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64.html b/wasmedge_sys/ffi/constant.__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64.html new file mode 100644 index 000000000..5e1dba5c7 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64.html @@ -0,0 +1 @@ +__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 in wasmedge_sys::ffi - Rust
pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI.html b/wasmedge_sys/ffi/constant.__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI.html new file mode 100644 index 000000000..31b6a46ef --- /dev/null +++ b/wasmedge_sys/ffi/constant.__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI.html @@ -0,0 +1 @@ +__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI in wasmedge_sys::ffi - Rust
pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__OFF_T_MATCHES_OFF64_T.html b/wasmedge_sys/ffi/constant.__OFF_T_MATCHES_OFF64_T.html new file mode 100644 index 000000000..e318abf65 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__OFF_T_MATCHES_OFF64_T.html @@ -0,0 +1 @@ +__OFF_T_MATCHES_OFF64_T in wasmedge_sys::ffi - Rust
pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__RLIM_T_MATCHES_RLIM64_T.html b/wasmedge_sys/ffi/constant.__RLIM_T_MATCHES_RLIM64_T.html new file mode 100644 index 000000000..2c97f7c8b --- /dev/null +++ b/wasmedge_sys/ffi/constant.__RLIM_T_MATCHES_RLIM64_T.html @@ -0,0 +1 @@ +__RLIM_T_MATCHES_RLIM64_T in wasmedge_sys::ffi - Rust
pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__STATFS_MATCHES_STATFS64.html b/wasmedge_sys/ffi/constant.__STATFS_MATCHES_STATFS64.html new file mode 100644 index 000000000..73192db78 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__STATFS_MATCHES_STATFS64.html @@ -0,0 +1 @@ +__STATFS_MATCHES_STATFS64 in wasmedge_sys::ffi - Rust
pub const __STATFS_MATCHES_STATFS64: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__STDC_IEC_559_COMPLEX__.html b/wasmedge_sys/ffi/constant.__STDC_IEC_559_COMPLEX__.html new file mode 100644 index 000000000..44a27c3a9 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__STDC_IEC_559_COMPLEX__.html @@ -0,0 +1 @@ +__STDC_IEC_559_COMPLEX__ in wasmedge_sys::ffi - Rust
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__STDC_IEC_559__.html b/wasmedge_sys/ffi/constant.__STDC_IEC_559__.html new file mode 100644 index 000000000..74e936f88 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__STDC_IEC_559__.html @@ -0,0 +1 @@ +__STDC_IEC_559__ in wasmedge_sys::ffi - Rust
pub const __STDC_IEC_559__: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__STDC_IEC_60559_BFP__.html b/wasmedge_sys/ffi/constant.__STDC_IEC_60559_BFP__.html new file mode 100644 index 000000000..57d85e907 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__STDC_IEC_60559_BFP__.html @@ -0,0 +1 @@ +__STDC_IEC_60559_BFP__ in wasmedge_sys::ffi - Rust
pub const __STDC_IEC_60559_BFP__: u32 = 201404;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__STDC_IEC_60559_COMPLEX__.html b/wasmedge_sys/ffi/constant.__STDC_IEC_60559_COMPLEX__.html new file mode 100644 index 000000000..ced18686d --- /dev/null +++ b/wasmedge_sys/ffi/constant.__STDC_IEC_60559_COMPLEX__.html @@ -0,0 +1 @@ +__STDC_IEC_60559_COMPLEX__ in wasmedge_sys::ffi - Rust
pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__STDC_ISO_10646__.html b/wasmedge_sys/ffi/constant.__STDC_ISO_10646__.html new file mode 100644 index 000000000..0257ff53d --- /dev/null +++ b/wasmedge_sys/ffi/constant.__STDC_ISO_10646__.html @@ -0,0 +1 @@ +__STDC_ISO_10646__ in wasmedge_sys::ffi - Rust
pub const __STDC_ISO_10646__: u32 = 201706;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__SYSCALL_WORDSIZE.html b/wasmedge_sys/ffi/constant.__SYSCALL_WORDSIZE.html new file mode 100644 index 000000000..a3f63384a --- /dev/null +++ b/wasmedge_sys/ffi/constant.__SYSCALL_WORDSIZE.html @@ -0,0 +1 @@ +__SYSCALL_WORDSIZE in wasmedge_sys::ffi - Rust
pub const __SYSCALL_WORDSIZE: u32 = 64;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__TIMESIZE.html b/wasmedge_sys/ffi/constant.__TIMESIZE.html new file mode 100644 index 000000000..452f936e1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__TIMESIZE.html @@ -0,0 +1 @@ +__TIMESIZE in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__TIMESIZE

source ·
pub const __TIMESIZE: u32 = 64;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_ATFILE.html b/wasmedge_sys/ffi/constant.__USE_ATFILE.html new file mode 100644 index 000000000..442827f6b --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_ATFILE.html @@ -0,0 +1 @@ +__USE_ATFILE in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__USE_ATFILE

source ·
pub const __USE_ATFILE: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_FORTIFY_LEVEL.html b/wasmedge_sys/ffi/constant.__USE_FORTIFY_LEVEL.html new file mode 100644 index 000000000..d1ea17bdb --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_FORTIFY_LEVEL.html @@ -0,0 +1 @@ +__USE_FORTIFY_LEVEL in wasmedge_sys::ffi - Rust
pub const __USE_FORTIFY_LEVEL: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_ISOC11.html b/wasmedge_sys/ffi/constant.__USE_ISOC11.html new file mode 100644 index 000000000..53cbfbabd --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_ISOC11.html @@ -0,0 +1 @@ +__USE_ISOC11 in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__USE_ISOC11

source ·
pub const __USE_ISOC11: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_ISOC95.html b/wasmedge_sys/ffi/constant.__USE_ISOC95.html new file mode 100644 index 000000000..af9249347 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_ISOC95.html @@ -0,0 +1 @@ +__USE_ISOC95 in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__USE_ISOC95

source ·
pub const __USE_ISOC95: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_ISOC99.html b/wasmedge_sys/ffi/constant.__USE_ISOC99.html new file mode 100644 index 000000000..975f38fe8 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_ISOC99.html @@ -0,0 +1 @@ +__USE_ISOC99 in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__USE_ISOC99

source ·
pub const __USE_ISOC99: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_MISC.html b/wasmedge_sys/ffi/constant.__USE_MISC.html new file mode 100644 index 000000000..30560eedd --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_MISC.html @@ -0,0 +1 @@ +__USE_MISC in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__USE_MISC

source ·
pub const __USE_MISC: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_POSIX.html b/wasmedge_sys/ffi/constant.__USE_POSIX.html new file mode 100644 index 000000000..2013de051 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_POSIX.html @@ -0,0 +1 @@ +__USE_POSIX in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__USE_POSIX

source ·
pub const __USE_POSIX: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_POSIX199309.html b/wasmedge_sys/ffi/constant.__USE_POSIX199309.html new file mode 100644 index 000000000..af15b3b74 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_POSIX199309.html @@ -0,0 +1 @@ +__USE_POSIX199309 in wasmedge_sys::ffi - Rust
pub const __USE_POSIX199309: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_POSIX199506.html b/wasmedge_sys/ffi/constant.__USE_POSIX199506.html new file mode 100644 index 000000000..d361ec7aa --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_POSIX199506.html @@ -0,0 +1 @@ +__USE_POSIX199506 in wasmedge_sys::ffi - Rust
pub const __USE_POSIX199506: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_POSIX2.html b/wasmedge_sys/ffi/constant.__USE_POSIX2.html new file mode 100644 index 000000000..60d5c92a5 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_POSIX2.html @@ -0,0 +1 @@ +__USE_POSIX2 in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__USE_POSIX2

source ·
pub const __USE_POSIX2: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_POSIX_IMPLICITLY.html b/wasmedge_sys/ffi/constant.__USE_POSIX_IMPLICITLY.html new file mode 100644 index 000000000..a5153267d --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_POSIX_IMPLICITLY.html @@ -0,0 +1 @@ +__USE_POSIX_IMPLICITLY in wasmedge_sys::ffi - Rust
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_XOPEN2K.html b/wasmedge_sys/ffi/constant.__USE_XOPEN2K.html new file mode 100644 index 000000000..d62a2b8d4 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_XOPEN2K.html @@ -0,0 +1 @@ +__USE_XOPEN2K in wasmedge_sys::ffi - Rust
pub const __USE_XOPEN2K: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__USE_XOPEN2K8.html b/wasmedge_sys/ffi/constant.__USE_XOPEN2K8.html new file mode 100644 index 000000000..2839c6fe1 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__USE_XOPEN2K8.html @@ -0,0 +1 @@ +__USE_XOPEN2K8 in wasmedge_sys::ffi - Rust
pub const __USE_XOPEN2K8: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__WORDSIZE.html b/wasmedge_sys/ffi/constant.__WORDSIZE.html new file mode 100644 index 000000000..e561783f3 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__WORDSIZE.html @@ -0,0 +1 @@ +__WORDSIZE in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::__WORDSIZE

source ·
pub const __WORDSIZE: u32 = 64;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__WORDSIZE_TIME64_COMPAT32.html b/wasmedge_sys/ffi/constant.__WORDSIZE_TIME64_COMPAT32.html new file mode 100644 index 000000000..6a8dbfa03 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__WORDSIZE_TIME64_COMPAT32.html @@ -0,0 +1 @@ +__WORDSIZE_TIME64_COMPAT32 in wasmedge_sys::ffi - Rust
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__bool_true_false_are_defined.html b/wasmedge_sys/ffi/constant.__bool_true_false_are_defined.html new file mode 100644 index 000000000..539033384 --- /dev/null +++ b/wasmedge_sys/ffi/constant.__bool_true_false_are_defined.html @@ -0,0 +1 @@ +__bool_true_false_are_defined in wasmedge_sys::ffi - Rust
pub const __bool_true_false_are_defined: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.__glibc_c99_flexarr_available.html b/wasmedge_sys/ffi/constant.__glibc_c99_flexarr_available.html new file mode 100644 index 000000000..35adf870d --- /dev/null +++ b/wasmedge_sys/ffi/constant.__glibc_c99_flexarr_available.html @@ -0,0 +1 @@ +__glibc_c99_flexarr_available in wasmedge_sys::ffi - Rust
pub const __glibc_c99_flexarr_available: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.false_.html b/wasmedge_sys/ffi/constant.false_.html new file mode 100644 index 000000000..d7cf886bb --- /dev/null +++ b/wasmedge_sys/ffi/constant.false_.html @@ -0,0 +1 @@ +false_ in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::false_

source ·
pub const false_: u32 = 0;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/constant.true_.html b/wasmedge_sys/ffi/constant.true_.html new file mode 100644 index 000000000..2f15fa500 --- /dev/null +++ b/wasmedge_sys/ffi/constant.true_.html @@ -0,0 +1 @@ +true_ in wasmedge_sys::ffi - Rust

Constant wasmedge_sys::ffi::true_

source ·
pub const true_: u32 = 1;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleDelete.html new file mode 100644 index 000000000..b84dbc48e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleDelete.html @@ -0,0 +1,7 @@ +WasmEdge_ASTModuleDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ASTModuleDelete(
+    Cxt: *mut WasmEdge_ASTModuleContext
+)
Expand description

Deletion of the WasmEdge_ASTModuleContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_ASTModuleContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListExports.html b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListExports.html new file mode 100644 index 000000000..ff5779385 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListExports.html @@ -0,0 +1,13 @@ +WasmEdge_ASTModuleListExports in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ASTModuleListExports(
+    Cxt: *const WasmEdge_ASTModuleContext,
+    Exports: *mut *const WasmEdge_ExportTypeContext,
+    Len: u32
+) -> u32
Expand description

List the exports of the AST module.

+

If the Exports buffer length is smaller than the result of the exports +list size, the overflowed return values will be discarded.

+

\param Cxt the WasmEdge_ASTModuleContext. +\param [out] Exports the export type contexts buffer. Can be NULL if export +types are not needed. +\param Len the buffer length.

+

\returns actual exported function list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListExportsLength.html b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListExportsLength.html new file mode 100644 index 000000000..7717ccb95 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListExportsLength.html @@ -0,0 +1,6 @@ +WasmEdge_ASTModuleListExportsLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ASTModuleListExportsLength(
+    Cxt: *const WasmEdge_ASTModuleContext
+) -> u32
Expand description

Get the length of exports list of the AST module.

+

\param Cxt the WasmEdge_ASTModuleContext.

+

\returns length of the exports list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListImports.html b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListImports.html new file mode 100644 index 000000000..06a72fa80 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListImports.html @@ -0,0 +1,13 @@ +WasmEdge_ASTModuleListImports in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ASTModuleListImports(
+    Cxt: *const WasmEdge_ASTModuleContext,
+    Imports: *mut *const WasmEdge_ImportTypeContext,
+    Len: u32
+) -> u32
Expand description

List the imports of the AST module.

+

If the Imports buffer length is smaller than the result of the imports +list size, the overflowed return values will be discarded.

+

\param Cxt the WasmEdge_ASTModuleContext. +\param [out] Imports the import type contexts buffer. Can be NULL if import +types are not needed. +\param Len the buffer length.

+

\returns actual exported function list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListImportsLength.html b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListImportsLength.html new file mode 100644 index 000000000..ebcb8ebb4 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ASTModuleListImportsLength.html @@ -0,0 +1,6 @@ +WasmEdge_ASTModuleListImportsLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ASTModuleListImportsLength(
+    Cxt: *const WasmEdge_ASTModuleContext
+) -> u32
Expand description

Get the length of imports list of the AST module.

+

\param Cxt the WasmEdge_ASTModuleContext.

+

\returns length of the imports list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_AsyncCancel.html b/wasmedge_sys/ffi/fn.WasmEdge_AsyncCancel.html new file mode 100644 index 000000000..1cbba25b0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_AsyncCancel.html @@ -0,0 +1,5 @@ +WasmEdge_AsyncCancel in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_AsyncCancel(
+    Cxt: *mut WasmEdge_Async
+)
Expand description

Cancel a WasmEdge_Async execution.

+

\param Cxt the WasmEdge_ASync.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_AsyncDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_AsyncDelete.html new file mode 100644 index 000000000..78b15cbcb --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_AsyncDelete.html @@ -0,0 +1,7 @@ +WasmEdge_AsyncDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_AsyncDelete(
+    Cxt: *mut WasmEdge_Async
+)
Expand description

Deletion of the WasmEdge_Async.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_ASync to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_AsyncGet.html b/wasmedge_sys/ffi/fn.WasmEdge_AsyncGet.html new file mode 100644 index 000000000..b4aabcff6 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_AsyncGet.html @@ -0,0 +1,15 @@ +WasmEdge_AsyncGet in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_AsyncGet(
+    Cxt: *const WasmEdge_Async,
+    Returns: *mut WasmEdge_Value,
+    ReturnLen: u32
+) -> WasmEdge_Result
Expand description

Wait and get the result of WasmEdge_Async execution.

+

This function will wait until the execution finished and return the +execution status and the return values. +If the Returns buffer length is smaller than the arity of the function, +the overflowed return values will be discarded.

+

\param Cxt the WasmEdge_ASync. +\param [out] Returns the WasmEdge_Value buffer to fill the return values. +\param ReturnLen the return buffer length.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_AsyncGetReturnsLength.html b/wasmedge_sys/ffi/fn.WasmEdge_AsyncGetReturnsLength.html new file mode 100644 index 000000000..a9cdef1f8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_AsyncGetReturnsLength.html @@ -0,0 +1,11 @@ +WasmEdge_AsyncGetReturnsLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_AsyncGetReturnsLength(
+    Cxt: *const WasmEdge_Async
+) -> u32
Expand description

Wait and get the return list length of the WasmEdge_Async execution.

+

This function will wait until the execution finished and return the return +value list length of the executed function. This function will return 0 if +the Cxt is NULL, the execution was failed, or the execution was canceled. +Developers can call the WasmEdge_AsyncGet to get the execution status and +the return values.

+

\param Cxt the WasmEdge_ASync.

+

\returns the return list length of the executed function.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_AsyncWait.html b/wasmedge_sys/ffi/fn.WasmEdge_AsyncWait.html new file mode 100644 index 000000000..ae7d77edd --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_AsyncWait.html @@ -0,0 +1,5 @@ +WasmEdge_AsyncWait in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_AsyncWait(
+    Cxt: *const WasmEdge_Async
+)
Expand description

Wait a WasmEdge_Async execution.

+

\param Cxt the WasmEdge_ASync.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_AsyncWaitFor.html b/wasmedge_sys/ffi/fn.WasmEdge_AsyncWaitFor.html new file mode 100644 index 000000000..36b2c02dc --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_AsyncWaitFor.html @@ -0,0 +1,9 @@ +WasmEdge_AsyncWaitFor in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_AsyncWaitFor(
+    Cxt: *const WasmEdge_Async,
+    Milliseconds: u64
+) -> bool
Expand description

Wait a WasmEdge_Async execution with timeout.

+

\param Cxt the WasmEdge_ASync. +\param Milliseconds times to wait.

+

\returns Result of waiting, true for execution ended, false for timeout +occurred.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetExecutor.html b/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetExecutor.html new file mode 100644 index 000000000..1a96d63a0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetExecutor.html @@ -0,0 +1,6 @@ +WasmEdge_CallingFrameGetExecutor in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_CallingFrameGetExecutor(
+    Cxt: *const WasmEdge_CallingFrameContext
+) -> *mut WasmEdge_ExecutorContext
Expand description

Get the executor context from the current calling frame.

+

\param Cxt the WasmEdge_CallingFrameContext.

+

\returns the executor context, NULL if the Cxt is NULL.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetMemoryInstance.html b/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetMemoryInstance.html new file mode 100644 index 000000000..4a50c5b35 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetMemoryInstance.html @@ -0,0 +1,17 @@ +WasmEdge_CallingFrameGetMemoryInstance in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_CallingFrameGetMemoryInstance(
+    Cxt: *const WasmEdge_CallingFrameContext,
+    Idx: u32
+) -> *mut WasmEdge_MemoryInstanceContext
Expand description

Get the memory instance by index from the module instance of the current +calling frame.

+

By default, a WASM module only have one memory instance after instantiation. +Therefore, developers can use: +WasmEdge_CallingFrameGetMemoryInstance(Cxt, 0) +to get the memory instance in host function body. +This extension is for the WASM multiple memories proposal. After enabling +the proposal, there may be greater than 1 memory instances in a WASM module. +So developers can use this function to access the memory instances which are +not in 0 index.

+

\param Cxt the WasmEdge_CallingFrameContext. +\param Idx the index of memory instance in the module instance.

+

\returns the memory instance, NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetModuleInstance.html b/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetModuleInstance.html new file mode 100644 index 000000000..b941cbaf1 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_CallingFrameGetModuleInstance.html @@ -0,0 +1,13 @@ +WasmEdge_CallingFrameGetModuleInstance in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_CallingFrameGetModuleInstance(
+    Cxt: *const WasmEdge_CallingFrameContext
+) -> *const WasmEdge_ModuleInstanceContext
Expand description

Get the module instance of the current calling frame.

+

When a WASM function is executing and start to call a host function, a frame +with the module instance which the WASM function belongs to will be pushed +onto the stack. And therefore the calling frame context will record that +module instance. +So in one case that the module instance will be NULL: developers execute +the function instance which is a host function and not added into a module +instance.

+

\param Cxt the WasmEdge_CallingFrameContext.

+

\returns the module instance of the current calling frame.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_CompilerCompile.html b/wasmedge_sys/ffi/fn.WasmEdge_CompilerCompile.html new file mode 100644 index 000000000..ceff0bdb0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_CompilerCompile.html @@ -0,0 +1,13 @@ +WasmEdge_CompilerCompile in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_CompilerCompile(
+    Cxt: *mut WasmEdge_CompilerContext,
+    InPath: *const c_char,
+    OutPath: *const c_char
+) -> WasmEdge_Result
Expand description

Compile the input WASM from the file path.

+

The compiler compiles the WASM from file path for the ahead-of-time mode and +store the result to the output file path.

+

\param Cxt the WasmEdge_CompilerContext. +\param InPath the input WASM file path. +\param OutPath the output WASM file path.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_CompilerCompileFromBuffer.html b/wasmedge_sys/ffi/fn.WasmEdge_CompilerCompileFromBuffer.html new file mode 100644 index 000000000..666ce3bd8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_CompilerCompileFromBuffer.html @@ -0,0 +1,15 @@ +WasmEdge_CompilerCompileFromBuffer in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_CompilerCompileFromBuffer(
+    Cxt: *mut WasmEdge_CompilerContext,
+    InBuffer: *const u8,
+    InBufferLen: u64,
+    OutPath: *const c_char
+) -> WasmEdge_Result
Expand description

Compile the input WASM from the given buffer.

+

The compiler compiles the WASM from the given buffer for the +ahead-of-time mode and store the result to the output file path.

+

\param Cxt the WasmEdge_CompilerContext. +\param InBuffer the input WASM binary buffer. +\param InBufferLen the length of the input WASM binary buffer. +\param OutPath the output WASM file path.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_CompilerCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_CompilerCreate.html new file mode 100644 index 000000000..e2ff87486 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_CompilerCreate.html @@ -0,0 +1,7 @@ +WasmEdge_CompilerCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_CompilerCreate(
+    ConfCxt: *const WasmEdge_ConfigureContext
+) -> *mut WasmEdge_CompilerContext
Expand description

Creation of the WasmEdge_CompilerContext.

+

The caller owns the object and should call WasmEdge_CompilerDelete to +delete it.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_CompilerDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_CompilerDelete.html new file mode 100644 index 000000000..d3ec80221 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_CompilerDelete.html @@ -0,0 +1,7 @@ +WasmEdge_CompilerDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_CompilerDelete(
+    Cxt: *mut WasmEdge_CompilerContext
+)
Expand description

Deletion of the WasmEdge_CompilerContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_CompilerContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureAddHostRegistration.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureAddHostRegistration.html new file mode 100644 index 000000000..c6d949043 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureAddHostRegistration.html @@ -0,0 +1,15 @@ +WasmEdge_ConfigureAddHostRegistration in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureAddHostRegistration(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    Host: WasmEdge_HostRegistration
+)
Expand description

Add a built-in host registration setting into WasmEdge_ConfigureContext.

+

For turning on the Wasi support in WasmEdge_VMContext, you can set the +built-in host registration value into the WasmEdge_ConfigureContext and +create VM with this context.

+
WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();
+WasmEdge_ConfigureAddHostRegistration(Conf, WasmEdge_HostRegistration_Wasi);
+WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);
+
+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to add built-in host registration. +\param Host the built-in host registration value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureAddProposal.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureAddProposal.html new file mode 100644 index 000000000..e8bee2cf8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureAddProposal.html @@ -0,0 +1,17 @@ +WasmEdge_ConfigureAddProposal in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureAddProposal(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    Prop: WasmEdge_Proposal
+)
Expand description

Add a proposal setting into the WasmEdge_ConfigureContext.

+

For turning on a specific WASM proposal in VM, loader, or compiler contexts, +etc., you can set the proposal value into the WasmEdge_ConfigureContext and +create the VM, loader, or compiler contexts, etc. with this context.

+
WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();
+WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_BulkMemoryOperations);
+WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_ReferenceTypes);
+WasmEdge_ConfigureAddProposal(Conf, WasmEdge_Proposal_SIMD);
+WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);
+
+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to add the proposal value. +\param Prop the proposal value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerGetOptimizationLevel.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerGetOptimizationLevel.html new file mode 100644 index 000000000..25a6bccd0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerGetOptimizationLevel.html @@ -0,0 +1,7 @@ +WasmEdge_ConfigureCompilerGetOptimizationLevel in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerGetOptimizationLevel(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> WasmEdge_CompilerOptimizationLevel
Expand description

Get the optimization level of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the optimization level.

+

\returns the AOT compiler optimization level.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerGetOutputFormat.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerGetOutputFormat.html new file mode 100644 index 000000000..657cc1c74 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerGetOutputFormat.html @@ -0,0 +1,7 @@ +WasmEdge_ConfigureCompilerGetOutputFormat in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerGetOutputFormat(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> WasmEdge_CompilerOutputFormat
Expand description

Get the output binary format of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the output binary format.

+

\returns the AOT compiler output binary format.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsDumpIR.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsDumpIR.html new file mode 100644 index 000000000..d4cffe5fb --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsDumpIR.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureCompilerIsDumpIR in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerIsDumpIR(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> bool
Expand description

Get the dump IR option of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the boolean value.

+

\returns the boolean value to determine to dump IR or not when compilation +in AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsGenericBinary.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsGenericBinary.html new file mode 100644 index 000000000..4c037e1a9 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsGenericBinary.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureCompilerIsGenericBinary in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerIsGenericBinary(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> bool
Expand description

Get the generic binary option of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the boolean value.

+

\returns the boolean value to determine to generate the generic binary or +not when compilation in AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsInterruptible.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsInterruptible.html new file mode 100644 index 000000000..72718f8df --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerIsInterruptible.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureCompilerIsInterruptible in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerIsInterruptible(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> bool
Expand description

Get the interruptible option of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the boolean value.

+

\returns the boolean value to determine to generate interruptible binary or +not when compilation in AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetDumpIR.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetDumpIR.html new file mode 100644 index 000000000..7282b7383 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetDumpIR.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureCompilerSetDumpIR in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerSetDumpIR(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    IsDump: bool
+)
Expand description

Set the dump IR option of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the boolean value. +\param IsDump the boolean value to determine to dump IR or not when +compilation in AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetGenericBinary.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetGenericBinary.html new file mode 100644 index 000000000..60d64ee75 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetGenericBinary.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureCompilerSetGenericBinary in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerSetGenericBinary(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    IsGeneric: bool
+)
Expand description

Set the generic binary option of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the boolean value. +\param IsGeneric the boolean value to determine to generate the generic +binary or not when compilation in AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetInterruptible.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetInterruptible.html new file mode 100644 index 000000000..e256f8299 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetInterruptible.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureCompilerSetInterruptible in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerSetInterruptible(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    IsInterruptible: bool
+)
Expand description

Set the interruptible option of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the boolean value. +\param IsInterruptible the boolean value to determine to generate +interruptible binary or not when compilation in AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetOptimizationLevel.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetOptimizationLevel.html new file mode 100644 index 000000000..b4943a057 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetOptimizationLevel.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureCompilerSetOptimizationLevel in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerSetOptimizationLevel(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    Level: WasmEdge_CompilerOptimizationLevel
+)
Expand description

Set the optimization level of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the optimization level. +\param Level the AOT compiler optimization level.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetOutputFormat.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetOutputFormat.html new file mode 100644 index 000000000..9760ccae6 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCompilerSetOutputFormat.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureCompilerSetOutputFormat in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCompilerSetOutputFormat(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    Format: WasmEdge_CompilerOutputFormat
+)
Expand description

Set the output binary format of the AOT compiler.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the output binary format. +\param Format the AOT compiler output binary format.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCreate.html new file mode 100644 index 000000000..41af52f92 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureCreate.html @@ -0,0 +1,6 @@ +WasmEdge_ConfigureCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureCreate(
+) -> *mut WasmEdge_ConfigureContext
Expand description

Creation of the WasmEdge_ConfigureContext.

+

The caller owns the object and should call WasmEdge_ConfigureDelete to +destroy it.

+

\returns pointer to the context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureDelete.html new file mode 100644 index 000000000..624dc8765 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureDelete.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureDelete(
+    Cxt: *mut WasmEdge_ConfigureContext
+)
Expand description

Deletion of the WasmEdge_ConfigureContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureGetMaxMemoryPage.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureGetMaxMemoryPage.html new file mode 100644 index 000000000..f8c37ed30 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureGetMaxMemoryPage.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureGetMaxMemoryPage in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureGetMaxMemoryPage(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> u32
Expand description

Get the setting of the page limit of memory instances.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the maximum page count +setting.

+

\returns the page count limitation value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureHasHostRegistration.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureHasHostRegistration.html new file mode 100644 index 000000000..7c3eeb1a4 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureHasHostRegistration.html @@ -0,0 +1,11 @@ +WasmEdge_ConfigureHasHostRegistration in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureHasHostRegistration(
+    Cxt: *const WasmEdge_ConfigureContext,
+    Host: WasmEdge_HostRegistration
+) -> bool
Expand description

Check if a built-in host registration setting exists in the +WasmEdge_ConfigureContext or not.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to check the host pre-registration. +\param Host the built-in host registration value.

+

\returns true if the built-in host registration setting exists, false if +not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureHasProposal.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureHasProposal.html new file mode 100644 index 000000000..5fb38dbcd --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureHasProposal.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureHasProposal in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureHasProposal(
+    Cxt: *const WasmEdge_ConfigureContext,
+    Prop: WasmEdge_Proposal
+) -> bool
Expand description

Check if a proposal setting exists in the WasmEdge_ConfigureContext or not.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to check the proposal value. +\param Prop the proposal value.

+

\returns true if the proposal setting exists, false if not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureIsAllowAFUNIX.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureIsAllowAFUNIX.html new file mode 100644 index 000000000..2b994f512 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureIsAllowAFUNIX.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureIsAllowAFUNIX in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureIsAllowAFUNIX(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> bool
Expand description

Get the AllowAFUNIX option.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the boolean value.

+

\returns the boolean value to determine to enable AF_UNIX support in the +WASI socket or not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureIsForceInterpreter.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureIsForceInterpreter.html new file mode 100644 index 000000000..ca9debe82 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureIsForceInterpreter.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureIsForceInterpreter in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureIsForceInterpreter(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> bool
Expand description

Get the force interpreter mode execution option.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the boolean value.

+

\returns the boolean value to determine to forcibly run WASM in interpreter +mode or not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureRemoveHostRegistration.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureRemoveHostRegistration.html new file mode 100644 index 000000000..54d5f5a3e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureRemoveHostRegistration.html @@ -0,0 +1,10 @@ +WasmEdge_ConfigureRemoveHostRegistration in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureRemoveHostRegistration(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    Host: WasmEdge_HostRegistration
+)
Expand description

Remove a built-in host registration setting in the +WasmEdge_ConfigureContext.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to remove the host +pre-registration. +\param Host the built-in host registration value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureRemoveProposal.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureRemoveProposal.html new file mode 100644 index 000000000..fa3f3c595 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureRemoveProposal.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureRemoveProposal in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureRemoveProposal(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    Prop: WasmEdge_Proposal
+)
Expand description

Remove a proposal setting in the WasmEdge_ConfigureContext.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to remove the proposal. +\param Prop the proposal value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetAllowAFUNIX.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetAllowAFUNIX.html new file mode 100644 index 000000000..7694441d2 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetAllowAFUNIX.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureSetAllowAFUNIX in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureSetAllowAFUNIX(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    EnableAFUNIX: bool
+)
Expand description

Set the option of enabling/disabling AF_UNIX support in the WASI socket.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the boolean value. +\param EnableAFUNIX the boolean value to determine to enable +the AF_UNIX support in the WASI socket or not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetForceInterpreter.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetForceInterpreter.html new file mode 100644 index 000000000..d9555c333 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetForceInterpreter.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureSetForceInterpreter in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureSetForceInterpreter(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    IsForceInterpreter: bool
+)
Expand description

Set the force interpreter mode execution option.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the boolean value. +\param IsForceInterpreter the boolean value to determine to forcibly run +WASM in interpreter mode or not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetMaxMemoryPage.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetMaxMemoryPage.html new file mode 100644 index 000000000..02b7fbc17 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureSetMaxMemoryPage.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureSetMaxMemoryPage in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureSetMaxMemoryPage(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    Page: u32
+)
Expand description

Set the page limit of memory instances.

+

Limit the page count (64KiB per page) in memory instances.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the maximum page count. +\param Page the maximum page count.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsCostMeasuring.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsCostMeasuring.html new file mode 100644 index 000000000..d7e79a0e2 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsCostMeasuring.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureStatisticsIsCostMeasuring in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureStatisticsIsCostMeasuring(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> bool
Expand description

Get the cost measuring option for the statistics.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the boolean value.

+

\returns the boolean value to determine to support cost measuring when +execution or not after compilation by the AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsInstructionCounting.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsInstructionCounting.html new file mode 100644 index 000000000..a817a0a43 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsInstructionCounting.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureStatisticsIsInstructionCounting in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureStatisticsIsInstructionCounting(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> bool
Expand description

Get the instruction counting option for the statistics.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the boolean value.

+

\returns the boolean value to determine to support instruction counting when +execution or not after compilation by the AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsTimeMeasuring.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsTimeMeasuring.html new file mode 100644 index 000000000..7e8f6b9ab --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsIsTimeMeasuring.html @@ -0,0 +1,8 @@ +WasmEdge_ConfigureStatisticsIsTimeMeasuring in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureStatisticsIsTimeMeasuring(
+    Cxt: *const WasmEdge_ConfigureContext
+) -> bool
Expand description

Get the time measuring option for the statistics.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to get the boolean value.

+

\returns the boolean value to determine to support time measuring when +execution or not after compilation by the AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetCostMeasuring.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetCostMeasuring.html new file mode 100644 index 000000000..b27ee12fa --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetCostMeasuring.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureStatisticsSetCostMeasuring in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureStatisticsSetCostMeasuring(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    IsMeasure: bool
+)
Expand description

Set the cost measuring option for the statistics.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the boolean value. +\param IsMeasure the boolean value to determine to support cost measuring +when execution or not after compilation by the AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetInstructionCounting.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetInstructionCounting.html new file mode 100644 index 000000000..6100421e3 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetInstructionCounting.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureStatisticsSetInstructionCounting in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureStatisticsSetInstructionCounting(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    IsCount: bool
+)
Expand description

Set the instruction counting option for the statistics.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the boolean value. +\param IsCount the boolean value to determine to support instruction +counting when execution or not after compilation by the AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetTimeMeasuring.html b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetTimeMeasuring.html new file mode 100644 index 000000000..5d5365b31 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ConfigureStatisticsSetTimeMeasuring.html @@ -0,0 +1,9 @@ +WasmEdge_ConfigureStatisticsSetTimeMeasuring in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ConfigureStatisticsSetTimeMeasuring(
+    Cxt: *mut WasmEdge_ConfigureContext,
+    IsMeasure: bool
+)
Expand description

Set the time measuring option for the statistics.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ConfigureContext to set the boolean value. +\param IsMeasure the boolean value to determine to support time when +execution or not after compilation by the AOT compiler.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_Driver_Compiler.html b/wasmedge_sys/ffi/fn.WasmEdge_Driver_Compiler.html new file mode 100644 index 000000000..64d904cf7 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_Driver_Compiler.html @@ -0,0 +1,10 @@ +WasmEdge_Driver_Compiler in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_Driver_Compiler(
+    Argc: c_int,
+    Argv: *mut *const c_char
+) -> c_int
Expand description

Entrypoint for the compiler tool.

+

This function provides an entrypoint to the WasmEdge AOT compiler tool with +the command line arguments.

+

\param Argc the argument count. +\param Argv the argument vector.

+

\returns the execution status.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_Driver_Tool.html b/wasmedge_sys/ffi/fn.WasmEdge_Driver_Tool.html new file mode 100644 index 000000000..cb6e948e7 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_Driver_Tool.html @@ -0,0 +1,10 @@ +WasmEdge_Driver_Tool in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_Driver_Tool(
+    Argc: c_int,
+    Argv: *mut *const c_char
+) -> c_int
Expand description

Entrypoint for the runtime tool.

+

This function provides an entrypoint to the WasmEdge runtime tool with the +command line arguments.

+

\param Argc the argument count. +\param Argv the argument vector.

+

\returns the execution status.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_Driver_UniTool.html b/wasmedge_sys/ffi/fn.WasmEdge_Driver_UniTool.html new file mode 100644 index 000000000..4fc2c0daa --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_Driver_UniTool.html @@ -0,0 +1,10 @@ +WasmEdge_Driver_UniTool in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_Driver_UniTool(
+    Argc: c_int,
+    Argv: *mut *const c_char
+) -> c_int
Expand description

Entrypoint for the unified tool.

+

This function provides an entrypoint to the WasmEdge unified tool with the +command line arguments.

+

\param Argc the argument count. +\param Argv the argument vector.

+

\returns the execution status.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorAsyncInvoke.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorAsyncInvoke.html new file mode 100644 index 000000000..66d6661ac --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorAsyncInvoke.html @@ -0,0 +1,16 @@ +WasmEdge_ExecutorAsyncInvoke in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorAsyncInvoke(
+    Cxt: *mut WasmEdge_ExecutorContext,
+    FuncCxt: *const WasmEdge_FunctionInstanceContext,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32
+) -> *mut WasmEdge_Async
Expand description

Asynchronous invoke a WASM function by the function instance.

+

After instantiating a WASM module, developers can get the function instance +context from the module instance. Then developers can invoke the function +asynchronously through this API.

+

\param Cxt the WasmEdge_ExecutorContext. +\param FuncCxt the function instance context to invoke. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length.

+

\returns WasmEdge_Async. Call WasmEdge_AsyncGet for the result, and call +WasmEdge_AsyncDelete to destroy this object.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorCreate.html new file mode 100644 index 000000000..46a9af9eb --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorCreate.html @@ -0,0 +1,14 @@ +WasmEdge_ExecutorCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorCreate(
+    ConfCxt: *const WasmEdge_ConfigureContext,
+    StatCxt: *mut WasmEdge_StatisticsContext
+) -> *mut WasmEdge_ExecutorContext
Expand description

Creation of the WasmEdge_ExecutorContext.

+

The caller owns the object and should call WasmEdge_ExecutorDelete to +delete it.

+

\param ConfCxt the WasmEdge_ConfigureContext as the configuration of +Executor. NULL for the default configuration. +\param StatCxt the WasmEdge_StatisticsContext as the statistics object set +into Executor. The statistics will refer to this context, and the life cycle +should be guaranteed until the executor context is deleted. NULL for not +doing the statistics.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorDelete.html new file mode 100644 index 000000000..1840e0c08 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorDelete.html @@ -0,0 +1,7 @@ +WasmEdge_ExecutorDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorDelete(
+    Cxt: *mut WasmEdge_ExecutorContext
+)
Expand description

Deletion of the WasmEdge_ExecutorContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_ExecutorContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorExperimentalRegisterPostHostFunction.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorExperimentalRegisterPostHostFunction.html new file mode 100644 index 000000000..3dee02092 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorExperimentalRegisterPostHostFunction.html @@ -0,0 +1,16 @@ +WasmEdge_ExecutorExperimentalRegisterPostHostFunction in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorExperimentalRegisterPostHostFunction(
+    Cxt: *mut WasmEdge_ExecutorContext,
+    Data: *mut c_void,
+    Func: Option<unsafe extern "C" fn(arg1: *mut c_void)>
+)
Expand description

Register a host function that will be invoked after executing any host +functions.

+

There is only one post-host-function. After calling this function, the +previous registered host function will be replaced. This is a experimental +feature. Use it at your own risk.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param Data the host data to set into the given host function. When calling +the Func, this pointer will be the argument of the Func function. +\param Func the function to be invoked after executing any other host +functions.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorExperimentalRegisterPreHostFunction.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorExperimentalRegisterPreHostFunction.html new file mode 100644 index 000000000..894c6cfdd --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorExperimentalRegisterPreHostFunction.html @@ -0,0 +1,16 @@ +WasmEdge_ExecutorExperimentalRegisterPreHostFunction in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorExperimentalRegisterPreHostFunction(
+    Cxt: *mut WasmEdge_ExecutorContext,
+    Data: *mut c_void,
+    Func: Option<unsafe extern "C" fn(arg1: *mut c_void)>
+)
Expand description

Register a host function that will be invoked before executing any host +functions.

+

There is only one pre-host-function. After calling this function, the +previous registered host function will be replaced. This is a experimental +feature. Use it at your own risk.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ExecutorContext. +\param Data the host data to set into the given host function. When calling +the Func, this pointer will be the argument of the Func function. +\param Func the function to be invoked before executing any other host +functions.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorInstantiate.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorInstantiate.html new file mode 100644 index 000000000..08a699f3b --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorInstantiate.html @@ -0,0 +1,21 @@ +WasmEdge_ExecutorInstantiate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorInstantiate(
+    Cxt: *mut WasmEdge_ExecutorContext,
+    ModuleCxt: *mut *mut WasmEdge_ModuleInstanceContext,
+    StoreCxt: *mut WasmEdge_StoreContext,
+    ASTCxt: *const WasmEdge_ASTModuleContext
+) -> WasmEdge_Result
Expand description

Instantiate an AST Module into a module instance.

+

Instantiate an AST Module, and return an instantiated module instance +context as the result. The caller owns the object and should call +WasmEdge_ModuleInstanceDelete to destroy it. Developers can use the +WasmEdge_ModuleInstanceListFunction, +WasmEdge_ModuleInstanceFindFunction, etc. APIs to retrieve the exported +instances from the result module instance.

+

\param Cxt the WasmEdge_ExecutorContext to instantiate the module. +\param [out] ModuleCxt the output WasmEdge_ModuleInstanceContext if +succeeded. +\param StoreCxt the WasmEdge_StoreContext to link the imports. +\param ASTCxt the WasmEdge AST Module context generated by loader or +compiler.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorInvoke.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorInvoke.html new file mode 100644 index 000000000..32ba18e6d --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorInvoke.html @@ -0,0 +1,20 @@ +WasmEdge_ExecutorInvoke in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorInvoke(
+    Cxt: *mut WasmEdge_ExecutorContext,
+    FuncCxt: *const WasmEdge_FunctionInstanceContext,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32,
+    Returns: *mut WasmEdge_Value,
+    ReturnLen: u32
+) -> WasmEdge_Result
Expand description

Invoke a WASM function by the function instance.

+

After instantiating a WASM module, developers can get the function instance +context from the module instance. Then developers can invoke the function +through this API.

+

\param Cxt the WasmEdge_ExecutorContext. +\param FuncCxt the function instance context to invoke. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length. +\param [out] Returns the WasmEdge_Value buffer to fill the return values. +\param ReturnLen the return buffer length.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorRegister.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorRegister.html new file mode 100644 index 000000000..99312ef06 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorRegister.html @@ -0,0 +1,34 @@ +WasmEdge_ExecutorRegister in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorRegister(
+    Cxt: *mut WasmEdge_ExecutorContext,
+    ModuleCxt: *mut *mut WasmEdge_ModuleInstanceContext,
+    StoreCxt: *mut WasmEdge_StoreContext,
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    ModuleName: WasmEdge_String
+) -> WasmEdge_Result
Expand description

Instantiate an AST Module into a named module instance and link into store.

+

Instantiate an AST Module with the module name, return the instantiated +module instance context as the result, and also register the module instance +to the store. The caller owns the object and should call +WasmEdge_ModuleInstanceDelete to destroy it. +Developers can use the WasmEdge_ModuleInstanceListFunction, +WasmEdge_ModuleInstanceFindFunction, etc. APIs to retrieve the exported +instances from the result module instance. +After calling this function, the output module instance will also be +registered into the store, and the other modules can import the exported +instances for linking when instantiation. Developers SHOULD guarantee the +life cycle of this output module instance, or the error will occur when in +execution after the module instance being destroyed if it has been imported +by other modules. That is, developers have the responsibility to delete the +output module instance even though the store being destroyed. When the +module instance is deleted, it will be unregistered to the store +automatically.

+

\param Cxt the WasmEdge_ExecutorContext to instantiate the module. +\param [out] ModuleCxt the output WasmEdge_ModuleInstanceContext if +succeeded. +\param StoreCxt the WasmEdge_StoreContext to link the imports. +\param ASTCxt the WasmEdge AST Module context generated by loader or +compiler. +\param ModuleName the module name WasmEdge_String for all exported +instances.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExecutorRegisterImport.html b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorRegisterImport.html new file mode 100644 index 000000000..762a6c2ba --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExecutorRegisterImport.html @@ -0,0 +1,19 @@ +WasmEdge_ExecutorRegisterImport in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExecutorRegisterImport(
+    Cxt: *mut WasmEdge_ExecutorContext,
+    StoreCxt: *mut WasmEdge_StoreContext,
+    ImportCxt: *const WasmEdge_ModuleInstanceContext
+) -> WasmEdge_Result
Expand description

Register a module instance into a store with exporting its module name.

+

Register an existing module into the store with its module name. +After calling this function, the existing module instance will be registered +into the store, and the other modules can import the exported instances for +linking when instantiation. Developers SHOULD guarantee the life cycle of +this existing module instance, or the error will occur when in execution +after the module instance being destroyed if it has been imported by other +modules. When the module instance is deleted, it will be unregistered to the +store automatically.

+

\param Cxt the WasmEdge_ExecutorContext to instantiate the module. +\param StoreCxt the WasmEdge_StoreContext to store the instantiated module. +\param ImportCxt the WasmEdge_ModuleInstanceContext to register.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetExternalName.html b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetExternalName.html new file mode 100644 index 000000000..1fa1ad73b --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetExternalName.html @@ -0,0 +1,8 @@ +WasmEdge_ExportTypeGetExternalName in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExportTypeGetExternalName(
+    Cxt: *const WasmEdge_ExportTypeContext
+) -> WasmEdge_String
Expand description

Get the external name from an export type.

+

The returned string object is linked to the external name of the export +type, and the caller should NOT call the WasmEdge_StringDelete.

+

\param Cxt the WasmEdge_ExportTypeContext.

+

\returns string object. Length will be 0 and Buf will be NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetExternalType.html b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetExternalType.html new file mode 100644 index 000000000..68d072889 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetExternalType.html @@ -0,0 +1,6 @@ +WasmEdge_ExportTypeGetExternalType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExportTypeGetExternalType(
+    Cxt: *const WasmEdge_ExportTypeContext
+) -> WasmEdge_ExternalType
Expand description

Get the external type from an export type.

+

\param Cxt the WasmEdge_ExportTypeContext.

+

\returns the external type of the export type.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetFunctionType.html b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetFunctionType.html new file mode 100644 index 000000000..6728974d7 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetFunctionType.html @@ -0,0 +1,14 @@ +WasmEdge_ExportTypeGetFunctionType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExportTypeGetFunctionType(
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    Cxt: *const WasmEdge_ExportTypeContext
+) -> *const WasmEdge_FunctionTypeContext
Expand description

Get the external value (which is function type) from an export type.

+

The export type context should be the one queried from the AST module +context, or this function will cause unexpected error. +The function type context links to the function type in the export type +context and the AST module context. The caller should NOT call the +WasmEdge_FunctionTypeDelete.

+

\param ASTCxt the WasmEdge_ASTModuleContext. +\param Cxt the WasmEdge_ExportTypeContext which queried from the ASTCxt.

+

\returns the function type. NULL if failed or the external type of the +export type is not WasmEdge_ExternalType_Function.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetGlobalType.html b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetGlobalType.html new file mode 100644 index 000000000..6f1031914 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetGlobalType.html @@ -0,0 +1,14 @@ +WasmEdge_ExportTypeGetGlobalType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExportTypeGetGlobalType(
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    Cxt: *const WasmEdge_ExportTypeContext
+) -> *const WasmEdge_GlobalTypeContext
Expand description

Get the external value (which is global type) from an export type.

+

The export type context should be the one queried from the AST module +context, or this function will cause unexpected error. +The global type context links to the global type in the export type context +and the AST module context. The caller should NOT call the +WasmEdge_GlobalTypeDelete.

+

\param ASTCxt the WasmEdge_ASTModuleContext. +\param Cxt the WasmEdge_ExportTypeContext which queried from the ASTCxt.

+

\returns the global type. NULL if failed or the external type of the export +type is not WasmEdge_ExternalType_Global.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetMemoryType.html b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetMemoryType.html new file mode 100644 index 000000000..69fedc9ab --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetMemoryType.html @@ -0,0 +1,14 @@ +WasmEdge_ExportTypeGetMemoryType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExportTypeGetMemoryType(
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    Cxt: *const WasmEdge_ExportTypeContext
+) -> *const WasmEdge_MemoryTypeContext
Expand description

Get the external value (which is memory type) from an export type.

+

The export type context should be the one queried from the AST module +context, or this function will cause unexpected error. +The memory type context links to the memory type in the export type context +and the AST module context. The caller should NOT call the +WasmEdge_MemoryTypeDelete.

+

\param ASTCxt the WasmEdge_ASTModuleContext. +\param Cxt the WasmEdge_ExportTypeContext which queried from the ASTCxt.

+

\returns the memory type. NULL if failed or the external type of the export +type is not WasmEdge_ExternalType_Memory.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetTableType.html b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetTableType.html new file mode 100644 index 000000000..7b4dbf298 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ExportTypeGetTableType.html @@ -0,0 +1,14 @@ +WasmEdge_ExportTypeGetTableType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ExportTypeGetTableType(
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    Cxt: *const WasmEdge_ExportTypeContext
+) -> *const WasmEdge_TableTypeContext
Expand description

Get the external value (which is table type) from an export type.

+

The export type context should be the one queried from the AST module +context, or this function will cause unexpected error. +The table type context links to the table type in the export type context +and the AST module context. The caller should NOT call the +WasmEdge_TableTypeDelete.

+

\param ASTCxt the WasmEdge_ASTModuleContext. +\param Cxt the WasmEdge_ExportTypeContext which queried from the ASTCxt.

+

\returns the table type. NULL if failed or the external type of the export +type is not WasmEdge_ExternalType_Table.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceCreate.html new file mode 100644 index 000000000..b66e621f4 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceCreate.html @@ -0,0 +1,52 @@ +WasmEdge_FunctionInstanceCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionInstanceCreate(
+    Type: *const WasmEdge_FunctionTypeContext,
+    HostFunc: WasmEdge_HostFunc_t,
+    Data: *mut c_void,
+    Cost: u64
+) -> *mut WasmEdge_FunctionInstanceContext
Expand description

Creation of the WasmEdge_FunctionInstanceContext for host functions.

+

The caller owns the object and should call WasmEdge_FunctionInstanceDelete +to destroy it if the returned object is not added into a +WasmEdge_ModuleInstanceContext. The following is an example to create a +host function context.

+
WasmEdge_Result FuncAdd(void *Data,
+                        const WasmEdge_CallingFrameContext *CallFrameCxt,
+                        const WasmEdge_Value *In, WasmEdge_Value *Out) {
+  // Function to return A + B.
+  int32_t A = WasmEdge_ValueGetI32(In[0]);
+  int32_t B = WasmEdge_ValueGetI32(In[1]);
+  Out[0] = WasmEdge_ValueGenI32(A + B);
+  // Return execution status
+  return WasmEdge_Result_Success;
+}
+
+enum WasmEdge_ValType Params[2] = {WasmEdge_ValType_I32,
+                                   WasmEdge_ValType_I32};
+enum WasmEdge_ValType Returns[1] = {WasmEdge_ValType_I32};
+WasmEdge_FunctionTypeContext *FuncType =
+    WasmEdge_FunctionTypeCreate(Params, 2, Returns, 1);
+WasmEdge_FunctionInstanceContext *HostFunc =
+    WasmEdge_FunctionInstanceCreate(FuncType, FuncAdd, NULL, 0);
+WasmEdge_FunctionTypeDelete(FuncType);
+...
+
+

\param Type the function type context to describe the host function +signature. +\param HostFunc the host function pointer. The host function signature must +be as following:

+
typedef WasmEdge_Result (*WasmEdge_HostFunc_t)(
+    void *Data,
+    const WasmEdge_CallingFrameContext *CallFrameCxt,
+    const WasmEdge_Value *Params,
+    WasmEdge_Value *Returns);
+
+

The Params is the input parameters array with length guaranteed to be the +same as the parameter types in the Type. The Returns is the output +results array with length guaranteed to be the same as the result types in +the Type. The return value is WasmEdge_Result for the execution status. +\param Data the additional object, such as the pointer to a data structure, +to set to this host function context. The caller should guarantee the life +cycle of the object. NULL if the additional data object is not needed. +\param Cost the function cost in statistics. Pass 0 if the calculation is +not needed.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceCreateBinding.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceCreateBinding.html new file mode 100644 index 000000000..51aabf11c --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceCreateBinding.html @@ -0,0 +1,76 @@ +WasmEdge_FunctionInstanceCreateBinding in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionInstanceCreateBinding(
+    Type: *const WasmEdge_FunctionTypeContext,
+    WrapFunc: WasmEdge_WrapFunc_t,
+    Binding: *mut c_void,
+    Data: *mut c_void,
+    Cost: u64
+) -> *mut WasmEdge_FunctionInstanceContext
Expand description

Creation of the WasmEdge_FunctionInstanceContext for host functions.

+

This function is for the languages which cannot pass the function pointer of +the host function into this shared library directly. The caller owns the +object and should call WasmEdge_FunctionInstanceDelete to destroy it if +the returned object is not added into a WasmEdge_ModuleInstanceContext. +The following is an example to create a host function context for other +languages.

+
// `RealFunc` is the pointer to the function in other languages.
+
+WasmEdge_Result FuncAddWrap(
+    void *This, void *Data,
+    const WasmEdge_CallingFrameContext *CallFrameCxt,
+    const WasmEdge_Value *In, const uint32_t InLen, WasmEdge_Value *Out,
+    const uint32_t OutLen) {
+  // Wrapper function of host function to return A + B.
+
+  // `This` is the same as `RealFunc`.
+  int32_t A = WasmEdge_ValueGetI32(In[0]);
+  int32_t B = WasmEdge_ValueGetI32(In[1]);
+
+  // Call the function of `This` in the host language ...
+  int32_t Result = ...;
+
+  Out[0] = Result;
+  // Return the execution status.
+  return WasmEdge_Result_Success;
+}
+
+enum WasmEdge_ValType Params[2] = {WasmEdge_ValType_I32,
+                                   WasmEdge_ValType_I32};
+enum WasmEdge_ValType Returns[1] = {WasmEdge_ValType_I32};
+WasmEdge_FunctionTypeContext *FuncType =
+    WasmEdge_FunctionTypeCreate(Params, 2, Returns, 1);
+WasmEdge_FunctionInstanceContext *HostFunc =
+    WasmEdge_FunctionInstanceCreateBinding(
+        FuncType, FuncAddWrap, RealFunc, NULL, 0);
+WasmEdge_FunctionTypeDelete(FuncType);
+...
+
+

\param Type the function type context to describe the host function +signature. +\param WrapFunc the wrapper function pointer. The wrapper function signature +must be as following:

+
typedef WasmEdge_Result (*WasmEdge_WrapFunc_t)(
+    void *This,
+    void *Data,
+    WasmEdge_CallingFrameContext *FrameCxt,
+    const WasmEdge_Value *Params,
+    const uint32_t ParamLen,
+    WasmEdge_Value *Returns,
+    const uint32_t ReturnLen);
+
+

The This is the pointer the same as the Binding parameter of this +function. The Params is the input parameters array with length guaranteed +to be the same as the parameter types in the Type, and the ParamLen is +the length of the array. The Returns is the output results array with +length guaranteed to be the same as the result types in the Type, and the +ReturnLen is the length of the array. The return value is +WasmEdge_Result for the execution status. +\param Binding the this pointer of the host function target or the +function indexing maintained by the caller which can specify the host +function. When invoking the host function, this pointer will be the first +argument of the wrapper function. +\param Data the additional object, such as the pointer to a data structure, +to set to this host function context. The caller should guarantee the life +cycle of the object. NULL if the additional data object is not needed. +\param Cost the function cost in statistics. Pass 0 if the calculation is +not needed.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceDelete.html new file mode 100644 index 000000000..b9c172ecf --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceDelete.html @@ -0,0 +1,7 @@ +WasmEdge_FunctionInstanceDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionInstanceDelete(
+    Cxt: *mut WasmEdge_FunctionInstanceContext
+)
Expand description

Deletion of the WasmEdge_FunctionInstanceContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_FunctionInstanceContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceGetData.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceGetData.html new file mode 100644 index 000000000..c6ba5126b --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceGetData.html @@ -0,0 +1,7 @@ +WasmEdge_FunctionInstanceGetData in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionInstanceGetData(
+    Cxt: *const WasmEdge_FunctionInstanceContext
+) -> *const c_void
Expand description

Get the function data field of the function instance.

+

The function data is passed when creating the FunctionInstance.

+

\param Cxt the WasmEdge_FunctionInstanceContext.

+

\returns pointer to Data, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceGetFunctionType.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceGetFunctionType.html new file mode 100644 index 000000000..d5ee611f5 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionInstanceGetFunctionType.html @@ -0,0 +1,9 @@ +WasmEdge_FunctionInstanceGetFunctionType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionInstanceGetFunctionType(
+    Cxt: *const WasmEdge_FunctionInstanceContext
+) -> *const WasmEdge_FunctionTypeContext
Expand description

Get the function type context of the function instance.

+

The function type context links to the function type in the function +instance context and owned by the context. The caller should NOT call +the WasmEdge_FunctionTypeDelete.

+

\param Cxt the WasmEdge_FunctionInstanceContext.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeCreate.html new file mode 100644 index 000000000..7c53867f5 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeCreate.html @@ -0,0 +1,15 @@ +WasmEdge_FunctionTypeCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionTypeCreate(
+    ParamList: *const WasmEdge_ValType,
+    ParamLen: u32,
+    ReturnList: *const WasmEdge_ValType,
+    ReturnLen: u32
+) -> *mut WasmEdge_FunctionTypeContext
Expand description

Creation of the WasmEdge_FunctionTypeContext.

+

The caller owns the object and should call WasmEdge_FunctionTypeDelete to +destroy it.

+

\param ParamList the value types list of parameters. NULL if the length is +0. +\param ParamLen the ParamList buffer length. +\param ReturnList the value types list of returns. NULL if the length is 0. +\param ReturnLen the ReturnList buffer length.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeDelete.html new file mode 100644 index 000000000..86986b03e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeDelete.html @@ -0,0 +1,7 @@ +WasmEdge_FunctionTypeDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionTypeDelete(
+    Cxt: *mut WasmEdge_FunctionTypeContext
+)
Expand description

Deletion of the WasmEdge_FunctionTypeContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_FunctionTypeContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetParameters.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetParameters.html new file mode 100644 index 000000000..37b144c07 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetParameters.html @@ -0,0 +1,13 @@ +WasmEdge_FunctionTypeGetParameters in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionTypeGetParameters(
+    Cxt: *const WasmEdge_FunctionTypeContext,
+    List: *mut WasmEdge_ValType,
+    Len: u32
+) -> u32
Expand description

Get the parameter types list from the WasmEdge_FunctionTypeContext.

+

If the List buffer length is smaller than the length of the parameter type +list, the overflowed values will be discarded.

+

\param Cxt the WasmEdge_FunctionTypeContext. +\param [out] List the WasmEdge_ValType buffer to fill the parameter value +types. +\param Len the value type buffer length.

+

\returns the actual parameter types list length.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetParametersLength.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetParametersLength.html new file mode 100644 index 000000000..c1474f97c --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetParametersLength.html @@ -0,0 +1,6 @@ +WasmEdge_FunctionTypeGetParametersLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionTypeGetParametersLength(
+    Cxt: *const WasmEdge_FunctionTypeContext
+) -> u32
Expand description

Get the parameter types list length from the WasmEdge_FunctionTypeContext.

+

\param Cxt the WasmEdge_FunctionTypeContext.

+

\returns the parameter types list length.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetReturns.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetReturns.html new file mode 100644 index 000000000..6503f4637 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetReturns.html @@ -0,0 +1,13 @@ +WasmEdge_FunctionTypeGetReturns in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionTypeGetReturns(
+    Cxt: *const WasmEdge_FunctionTypeContext,
+    List: *mut WasmEdge_ValType,
+    Len: u32
+) -> u32
Expand description

Get the return types list from the WasmEdge_FunctionTypeContext.

+

If the List buffer length is smaller than the length of the return type +list, the overflowed values will be discarded.

+

\param Cxt the WasmEdge_FunctionTypeContext. +\param [out] List the WasmEdge_ValType buffer to fill the return value +types. +\param Len the value type buffer length.

+

\returns the actual return types list length.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetReturnsLength.html b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetReturnsLength.html new file mode 100644 index 000000000..39a479687 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_FunctionTypeGetReturnsLength.html @@ -0,0 +1,6 @@ +WasmEdge_FunctionTypeGetReturnsLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_FunctionTypeGetReturnsLength(
+    Cxt: *const WasmEdge_FunctionTypeContext
+) -> u32
Expand description

Get the return types list length from the WasmEdge_FunctionTypeContext.

+

\param Cxt the WasmEdge_FunctionTypeContext.

+

\returns the return types list length.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceCreate.html new file mode 100644 index 000000000..e0aaa2a62 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceCreate.html @@ -0,0 +1,14 @@ +WasmEdge_GlobalInstanceCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalInstanceCreate(
+    GlobType: *const WasmEdge_GlobalTypeContext,
+    Value: WasmEdge_Value
+) -> *mut WasmEdge_GlobalInstanceContext
Expand description

Creation of the WasmEdge_GlobalInstanceContext.

+

The caller owns the object and should call WasmEdge_GlobalInstanceDelete +to destroy it if the returned object is not added into a +WasmEdge_ModuleInstanceContext.

+

\param GlobType the global type context to initialize the global instance +context. +\param Value the initial value with its value type of the global instance. +This function will fail if the value type of GlobType and Value are not +the same.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceDelete.html new file mode 100644 index 000000000..05557004b --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceDelete.html @@ -0,0 +1,7 @@ +WasmEdge_GlobalInstanceDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalInstanceDelete(
+    Cxt: *mut WasmEdge_GlobalInstanceContext
+)
Expand description

Deletion of the WasmEdge_GlobalInstanceContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_GlobalInstanceContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceGetGlobalType.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceGetGlobalType.html new file mode 100644 index 000000000..84a03b44d --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceGetGlobalType.html @@ -0,0 +1,9 @@ +WasmEdge_GlobalInstanceGetGlobalType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalInstanceGetGlobalType(
+    Cxt: *const WasmEdge_GlobalInstanceContext
+) -> *const WasmEdge_GlobalTypeContext
Expand description

Get the global type context from a global instance.

+

The global type context links to the global type in the global instance +context and owned by the context. The caller should NOT call the +WasmEdge_GlobalTypeDelete.

+

\param Cxt the WasmEdge_GlobalInstanceContext.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceGetValue.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceGetValue.html new file mode 100644 index 000000000..c73c6d2d5 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceGetValue.html @@ -0,0 +1,6 @@ +WasmEdge_GlobalInstanceGetValue in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalInstanceGetValue(
+    Cxt: *const WasmEdge_GlobalInstanceContext
+) -> WasmEdge_Value
Expand description

Get the value from a global instance.

+

\param Cxt the WasmEdge_GlobalInstanceContext.

+

\returns the current value of the global instance.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceSetValue.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceSetValue.html new file mode 100644 index 000000000..170488fe7 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalInstanceSetValue.html @@ -0,0 +1,9 @@ +WasmEdge_GlobalInstanceSetValue in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalInstanceSetValue(
+    Cxt: *mut WasmEdge_GlobalInstanceContext,
+    Value: WasmEdge_Value
+)
Expand description

Set the value from a global instance.

+

This function will do nothing if the global context is set as the Const +mutation or the value type not matched.

+

\param Cxt the WasmEdge_GlobalInstanceContext. +\param Value the value to set into the global context.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeCreate.html new file mode 100644 index 000000000..8a440b61a --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeCreate.html @@ -0,0 +1,10 @@ +WasmEdge_GlobalTypeCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalTypeCreate(
+    ValType: WasmEdge_ValType,
+    Mut: WasmEdge_Mutability
+) -> *mut WasmEdge_GlobalTypeContext
Expand description

Creation of the WasmEdge_GlobalTypeContext.

+

The caller owns the object and should call WasmEdge_GlobalTypeDelete to +destroy it.

+

\param ValType the value type of the global type. +\param Mut the mutation of the global type.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeDelete.html new file mode 100644 index 000000000..99a1caecd --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeDelete.html @@ -0,0 +1,7 @@ +WasmEdge_GlobalTypeDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalTypeDelete(
+    Cxt: *mut WasmEdge_GlobalTypeContext
+)
Expand description

Deletion of the WasmEdge_GlobalTypeContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_GlobalTypeContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeGetMutability.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeGetMutability.html new file mode 100644 index 000000000..5d5580373 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeGetMutability.html @@ -0,0 +1,6 @@ +WasmEdge_GlobalTypeGetMutability in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalTypeGetMutability(
+    Cxt: *const WasmEdge_GlobalTypeContext
+) -> WasmEdge_Mutability
Expand description

Get the mutability from a global type.

+

\param Cxt the WasmEdge_GlobalTypeContext.

+

\returns the mutability of the global type.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeGetValType.html b/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeGetValType.html new file mode 100644 index 000000000..2a3b828bc --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_GlobalTypeGetValType.html @@ -0,0 +1,6 @@ +WasmEdge_GlobalTypeGetValType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_GlobalTypeGetValType(
+    Cxt: *const WasmEdge_GlobalTypeContext
+) -> WasmEdge_ValType
Expand description

Get the value type from a global type.

+

\param Cxt the WasmEdge_GlobalTypeContext.

+

\returns the value type of the global type.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetExternalName.html b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetExternalName.html new file mode 100644 index 000000000..dbd9405bc --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetExternalName.html @@ -0,0 +1,8 @@ +WasmEdge_ImportTypeGetExternalName in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ImportTypeGetExternalName(
+    Cxt: *const WasmEdge_ImportTypeContext
+) -> WasmEdge_String
Expand description

Get the external name from an import type.

+

The returned string object is linked to the external name of the import +type, and the caller should NOT call the WasmEdge_StringDelete.

+

\param Cxt the WasmEdge_ImportTypeContext.

+

\returns string object. Length will be 0 and Buf will be NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetExternalType.html b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetExternalType.html new file mode 100644 index 000000000..122d27743 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetExternalType.html @@ -0,0 +1,6 @@ +WasmEdge_ImportTypeGetExternalType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ImportTypeGetExternalType(
+    Cxt: *const WasmEdge_ImportTypeContext
+) -> WasmEdge_ExternalType
Expand description

Get the external type from an import type.

+

\param Cxt the WasmEdge_ImportTypeContext.

+

\returns the external type of the import type.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetFunctionType.html b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetFunctionType.html new file mode 100644 index 000000000..5640cef80 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetFunctionType.html @@ -0,0 +1,14 @@ +WasmEdge_ImportTypeGetFunctionType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ImportTypeGetFunctionType(
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    Cxt: *const WasmEdge_ImportTypeContext
+) -> *const WasmEdge_FunctionTypeContext
Expand description

Get the external value (which is function type) from an import type.

+

The import type context should be the one queried from the AST module +context, or this function will cause unexpected error. +The function type context links to the function type in the import type +context and the AST module context. The caller should NOT call the +WasmEdge_FunctionTypeDelete.

+

\param ASTCxt the WasmEdge_ASTModuleContext. +\param Cxt the WasmEdge_ImportTypeContext which queried from the ASTCxt.

+

\returns the function type. NULL if failed or the external type of the +import type is not WasmEdge_ExternalType_Function.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetGlobalType.html b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetGlobalType.html new file mode 100644 index 000000000..64edabcc0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetGlobalType.html @@ -0,0 +1,14 @@ +WasmEdge_ImportTypeGetGlobalType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ImportTypeGetGlobalType(
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    Cxt: *const WasmEdge_ImportTypeContext
+) -> *const WasmEdge_GlobalTypeContext
Expand description

Get the external value (which is global type) from an import type.

+

The import type context should be the one queried from the AST module +context, or this function will cause unexpected error. +The global type context links to the global type in the import type context +and the AST module context. The caller should NOT call the +WasmEdge_GlobalTypeDelete.

+

\param ASTCxt the WasmEdge_ASTModuleContext. +\param Cxt the WasmEdge_ImportTypeContext which queried from the ASTCxt.

+

\returns the global type. NULL if failed or the external type of the import +type is not WasmEdge_ExternalType_Global.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetMemoryType.html b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetMemoryType.html new file mode 100644 index 000000000..52318e871 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetMemoryType.html @@ -0,0 +1,14 @@ +WasmEdge_ImportTypeGetMemoryType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ImportTypeGetMemoryType(
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    Cxt: *const WasmEdge_ImportTypeContext
+) -> *const WasmEdge_MemoryTypeContext
Expand description

Get the external value (which is memory type) from an import type.

+

The import type context should be the one queried from the AST module +context, or this function will cause unexpected error. +The memory type context links to the memory type in the import type context +and the AST module context. The caller should NOT call the +WasmEdge_MemoryTypeDelete.

+

\param ASTCxt the WasmEdge_ASTModuleContext. +\param Cxt the WasmEdge_ImportTypeContext which queried from the ASTCxt.

+

\returns the memory type. NULL if failed or the external type of the import +type is not WasmEdge_ExternalType_Memory.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetModuleName.html b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetModuleName.html new file mode 100644 index 000000000..2a8a632af --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetModuleName.html @@ -0,0 +1,8 @@ +WasmEdge_ImportTypeGetModuleName in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ImportTypeGetModuleName(
+    Cxt: *const WasmEdge_ImportTypeContext
+) -> WasmEdge_String
Expand description

Get the module name from an import type.

+

The returned string object is linked to the module name of the import type, +and the caller should NOT call the WasmEdge_StringDelete.

+

\param Cxt the WasmEdge_ImportTypeContext.

+

\returns string object. Length will be 0 and Buf will be NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetTableType.html b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetTableType.html new file mode 100644 index 000000000..a0768048d --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ImportTypeGetTableType.html @@ -0,0 +1,14 @@ +WasmEdge_ImportTypeGetTableType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ImportTypeGetTableType(
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    Cxt: *const WasmEdge_ImportTypeContext
+) -> *const WasmEdge_TableTypeContext
Expand description

Get the external value (which is table type) from an import type.

+

The import type context should be the one queried from the AST module +context, or this function will cause unexpected error. +The table type context links to the table type in the import type context +and the AST module context. The caller should NOT call the +WasmEdge_TableTypeDelete.

+

\param ASTCxt the WasmEdge_ASTModuleContext. +\param Cxt the WasmEdge_ImportTypeContext which queried from the ASTCxt.

+

\returns the table type. NULL if failed or the external type of the import +type is not WasmEdge_ExternalType_Table.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_LimitIsEqual.html b/wasmedge_sys/ffi/fn.WasmEdge_LimitIsEqual.html new file mode 100644 index 000000000..da852ed66 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_LimitIsEqual.html @@ -0,0 +1,9 @@ +WasmEdge_LimitIsEqual in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_LimitIsEqual(
+    Lim1: WasmEdge_Limit,
+    Lim2: WasmEdge_Limit
+) -> bool
Expand description

Compare the two WasmEdge_Limit objects.

+

\param Lim1 the first WasmEdge_Limit object to compare. +\param Lim2 the second WasmEdge_Limit object to compare.

+

\returns true if the content of two WasmEdge_Limit objects are the same, +false if not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_LoaderCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_LoaderCreate.html new file mode 100644 index 000000000..da928f162 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_LoaderCreate.html @@ -0,0 +1,9 @@ +WasmEdge_LoaderCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_LoaderCreate(
+    ConfCxt: *const WasmEdge_ConfigureContext
+) -> *mut WasmEdge_LoaderContext
Expand description

Creation of the WasmEdge_LoaderContext.

+

The caller owns the object and should call WasmEdge_LoaderDelete to +destroy it.

+

\param ConfCxt the WasmEdge_ConfigureContext as the configuration of Loader. +NULL for the default configuration.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_LoaderDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_LoaderDelete.html new file mode 100644 index 000000000..adde5a07d --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_LoaderDelete.html @@ -0,0 +1,7 @@ +WasmEdge_LoaderDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_LoaderDelete(
+    Cxt: *mut WasmEdge_LoaderContext
+)
Expand description

Deletion of the WasmEdge_LoaderContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_LoaderContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_LoaderParseFromBuffer.html b/wasmedge_sys/ffi/fn.WasmEdge_LoaderParseFromBuffer.html new file mode 100644 index 000000000..77824305d --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_LoaderParseFromBuffer.html @@ -0,0 +1,17 @@ +WasmEdge_LoaderParseFromBuffer in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_LoaderParseFromBuffer(
+    Cxt: *mut WasmEdge_LoaderContext,
+    Module: *mut *mut WasmEdge_ASTModuleContext,
+    Buf: *const u8,
+    BufLen: u32
+) -> WasmEdge_Result
Expand description

Load and parse the WASM module from a buffer into WasmEdge_ASTModuleContext.

+

Load and parse the WASM module from a buffer, and return a +WasmEdge_ASTModuleContext as the result. The caller owns the +WasmEdge_ASTModuleContext object and should call WasmEdge_ASTModuleDelete +to destroy it.

+

\param Cxt the WasmEdge_LoaderContext. +\param [out] Module the output WasmEdge_ASTModuleContext if succeeded. +\param Buf the buffer of WASM binary. +\param BufLen the length of the buffer.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_LoaderParseFromFile.html b/wasmedge_sys/ffi/fn.WasmEdge_LoaderParseFromFile.html new file mode 100644 index 000000000..0c400c215 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_LoaderParseFromFile.html @@ -0,0 +1,16 @@ +WasmEdge_LoaderParseFromFile in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_LoaderParseFromFile(
+    Cxt: *mut WasmEdge_LoaderContext,
+    Module: *mut *mut WasmEdge_ASTModuleContext,
+    Path: *const c_char
+) -> WasmEdge_Result
Expand description

Load and parse the WASM module from a WASM file into a +WasmEdge_ASTModuleContext.

+

Load and parse the WASM module from the file path, and return a +WasmEdge_ASTModuleContext as the result. The caller owns the +WasmEdge_ASTModuleContext object and should call +WasmEdge_ASTModuleDelete to destroy it.

+

\param Cxt the WasmEdge_LoaderContext. +\param [out] Module the output WasmEdge_ASTModuleContext if succeeded. +\param Path the NULL-terminated C string of the WASM file path.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_LogOff.html b/wasmedge_sys/ffi/fn.WasmEdge_LogOff.html new file mode 100644 index 000000000..022c6acf4 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_LogOff.html @@ -0,0 +1,2 @@ +WasmEdge_LogOff in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_LogOff()
Expand description

Set the logging system off.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_LogSetDebugLevel.html b/wasmedge_sys/ffi/fn.WasmEdge_LogSetDebugLevel.html new file mode 100644 index 000000000..09e78e42e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_LogSetDebugLevel.html @@ -0,0 +1,2 @@ +WasmEdge_LogSetDebugLevel in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_LogSetDebugLevel()
Expand description

Set the logging system to filter to debug level.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_LogSetErrorLevel.html b/wasmedge_sys/ffi/fn.WasmEdge_LogSetErrorLevel.html new file mode 100644 index 000000000..492246d13 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_LogSetErrorLevel.html @@ -0,0 +1,2 @@ +WasmEdge_LogSetErrorLevel in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_LogSetErrorLevel()
Expand description

Set the logging system to filter to error level.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceCreate.html new file mode 100644 index 000000000..cbf3b05dd --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceCreate.html @@ -0,0 +1,10 @@ +WasmEdge_MemoryInstanceCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceCreate(
+    MemType: *const WasmEdge_MemoryTypeContext
+) -> *mut WasmEdge_MemoryInstanceContext
Expand description

Creation of the WasmEdge_MemoryInstanceContext.

+

The caller owns the object and should call WasmEdge_MemoryInstanceDelete +to destroy it if the returned object is not added into a +WasmEdge_ModuleInstanceContext.

+

\param MemType the memory type context to initialize the memory instance +context.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceDelete.html new file mode 100644 index 000000000..3aad29485 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceDelete.html @@ -0,0 +1,7 @@ +WasmEdge_MemoryInstanceDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceDelete(
+    Cxt: *mut WasmEdge_MemoryInstanceContext
+)
Expand description

Deletion of the WasmEdge_MemoryInstanceContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_MemoryInstanceContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetData.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetData.html new file mode 100644 index 000000000..2d94f7152 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetData.html @@ -0,0 +1,14 @@ +WasmEdge_MemoryInstanceGetData in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceGetData(
+    Cxt: *const WasmEdge_MemoryInstanceContext,
+    Data: *mut u8,
+    Offset: u32,
+    Length: u32
+) -> WasmEdge_Result
Expand description

Copy the data to the output buffer from a memory instance.

+

\param Cxt the WasmEdge_MemoryInstanceContext. +\param [out] Data the result data buffer of copying destination. +\param Offset the data start offset in the memory instance. +\param Length the requested data length. If the Offset + Length is larger +than the data size in the memory instance, this function will failed.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetMemoryType.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetMemoryType.html new file mode 100644 index 000000000..08b3dbdb5 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetMemoryType.html @@ -0,0 +1,9 @@ +WasmEdge_MemoryInstanceGetMemoryType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceGetMemoryType(
+    Cxt: *const WasmEdge_MemoryInstanceContext
+) -> *const WasmEdge_MemoryTypeContext
Expand description

Get the memory type context from a memory instance.

+

The memory type context links to the memory type in the memory instance +context and owned by the context. The caller should NOT call the +WasmEdge_MemoryTypeDelete.

+

\param Cxt the WasmEdge_MemoryInstanceContext.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPageSize.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPageSize.html new file mode 100644 index 000000000..658d6a8ae --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPageSize.html @@ -0,0 +1,6 @@ +WasmEdge_MemoryInstanceGetPageSize in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceGetPageSize(
+    Cxt: *const WasmEdge_MemoryInstanceContext
+) -> u32
Expand description

Get the current page size (64 KiB of each page) of a memory instance.

+

\param Cxt the WasmEdge_MemoryInstanceContext.

+

\returns the page size of the memory instance.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPointer.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPointer.html new file mode 100644 index 000000000..a93ee11a8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPointer.html @@ -0,0 +1,11 @@ +WasmEdge_MemoryInstanceGetPointer in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceGetPointer(
+    Cxt: *mut WasmEdge_MemoryInstanceContext,
+    Offset: u32,
+    Length: u32
+) -> *mut u8
Expand description

Get the data pointer in a memory instance.

+

\param Cxt the WasmEdge_MemoryInstanceContext. +\param Offset the data start offset in the memory instance. +\param Length the requested data length. If the Offset + Length is larger +than the data size in the memory instance, this function will return NULL.

+

\returns the pointer to data with the start offset. NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPointerConst.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPointerConst.html new file mode 100644 index 000000000..30dad8348 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGetPointerConst.html @@ -0,0 +1,11 @@ +WasmEdge_MemoryInstanceGetPointerConst in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceGetPointerConst(
+    Cxt: *const WasmEdge_MemoryInstanceContext,
+    Offset: u32,
+    Length: u32
+) -> *const u8
Expand description

Get the const data pointer in a const memory instance.

+

\param Cxt the WasmEdge_MemoryInstanceContext. +\param Offset the data start offset in the memory instance. +\param Length the requested data length. If the Offset + Length is larger +than the data size in the memory instance, this function will return NULL.

+

\returns the pointer to data with the start offset. NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGrowPage.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGrowPage.html new file mode 100644 index 000000000..6d24cb3ba --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceGrowPage.html @@ -0,0 +1,9 @@ +WasmEdge_MemoryInstanceGrowPage in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceGrowPage(
+    Cxt: *mut WasmEdge_MemoryInstanceContext,
+    Page: u32
+) -> WasmEdge_Result
Expand description

Grow a memory instance with a page size.

+

\param Cxt the WasmEdge_MemoryInstanceContext. +\param Page the page count to grow in the memory instance.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceSetData.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceSetData.html new file mode 100644 index 000000000..6a45485f8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryInstanceSetData.html @@ -0,0 +1,14 @@ +WasmEdge_MemoryInstanceSetData in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryInstanceSetData(
+    Cxt: *mut WasmEdge_MemoryInstanceContext,
+    Data: *const u8,
+    Offset: u32,
+    Length: u32
+) -> WasmEdge_Result
Expand description

Copy the data into a memory instance from the input buffer.

+

\param Cxt the WasmEdge_MemoryInstanceContext. +\param Data the data buffer to copy. +\param Offset the data start offset in the memory instance. +\param Length the data buffer length. If the Offset + Length is larger +than the data size in the memory instance, this function will failed.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeCreate.html new file mode 100644 index 000000000..1196bda6f --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeCreate.html @@ -0,0 +1,8 @@ +WasmEdge_MemoryTypeCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryTypeCreate(
+    Limit: WasmEdge_Limit
+) -> *mut WasmEdge_MemoryTypeContext
Expand description

Creation of the WasmEdge_MemoryTypeContext.

+

The caller owns the object and should call WasmEdge_MemoryTypeDelete to +destroy it.

+

\param Limit the limit struct of the memory type.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeDelete.html new file mode 100644 index 000000000..72c205d39 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeDelete.html @@ -0,0 +1,7 @@ +WasmEdge_MemoryTypeDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryTypeDelete(
+    Cxt: *mut WasmEdge_MemoryTypeContext
+)
Expand description

Deletion of the WasmEdge_MemoryTypeContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_MemoryTypeContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeGetLimit.html b/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeGetLimit.html new file mode 100644 index 000000000..d1b43c9e9 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_MemoryTypeGetLimit.html @@ -0,0 +1,6 @@ +WasmEdge_MemoryTypeGetLimit in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_MemoryTypeGetLimit(
+    Cxt: *const WasmEdge_MemoryTypeContext
+) -> WasmEdge_Limit
Expand description

Get the limit from a memory type.

+

\param Cxt the WasmEdge_MemoryTypeContext.

+

\returns the limit struct of the memory type.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddFunction.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddFunction.html new file mode 100644 index 000000000..7b6fb2424 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddFunction.html @@ -0,0 +1,13 @@ +WasmEdge_ModuleInstanceAddFunction in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceAddFunction(
+    Cxt: *mut WasmEdge_ModuleInstanceContext,
+    Name: WasmEdge_String,
+    FuncCxt: *mut WasmEdge_FunctionInstanceContext
+)
Expand description

Add a function instance context into a WasmEdge_ModuleInstanceContext.

+

Export and move the ownership of the function instance into the module +instance. The caller should NOT access or destroy the function instance +context after calling this function.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext to add the function instance. +\param Name the export function name WasmEdge_String. +\param FuncCxt the WasmEdge_FunctionInstanceContext to add.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddGlobal.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddGlobal.html new file mode 100644 index 000000000..32b72c470 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddGlobal.html @@ -0,0 +1,13 @@ +WasmEdge_ModuleInstanceAddGlobal in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceAddGlobal(
+    Cxt: *mut WasmEdge_ModuleInstanceContext,
+    Name: WasmEdge_String,
+    GlobalCxt: *mut WasmEdge_GlobalInstanceContext
+)
Expand description

Add a global instance context into a WasmEdge_ModuleInstanceContext.

+

Export and move the ownership of the global instance into the module +instance. The caller should NOT access or destroy the global instance +context after calling this function.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext to add the global instance. +\param Name the export global name WasmEdge_String. +\param GlobalCxt the WasmEdge_GlobalInstanceContext to add.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddMemory.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddMemory.html new file mode 100644 index 000000000..56a28ea8c --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddMemory.html @@ -0,0 +1,13 @@ +WasmEdge_ModuleInstanceAddMemory in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceAddMemory(
+    Cxt: *mut WasmEdge_ModuleInstanceContext,
+    Name: WasmEdge_String,
+    MemoryCxt: *mut WasmEdge_MemoryInstanceContext
+)
Expand description

Add a memory instance context into a WasmEdge_ModuleInstanceContext.

+

Export and move the ownership of the memory instance into the module +instance. The caller should NOT access or destroy the memory instance +context after calling this function.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext to add the memory instance. +\param Name the export memory name WasmEdge_String. +\param MemoryCxt the WasmEdge_MemoryInstanceContext to add.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddTable.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddTable.html new file mode 100644 index 000000000..b64e47afe --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceAddTable.html @@ -0,0 +1,13 @@ +WasmEdge_ModuleInstanceAddTable in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceAddTable(
+    Cxt: *mut WasmEdge_ModuleInstanceContext,
+    Name: WasmEdge_String,
+    TableCxt: *mut WasmEdge_TableInstanceContext
+)
Expand description

Add a table instance context into a WasmEdge_ModuleInstanceContext.

+

Export and move the ownership of the table instance into the module +instance. The caller should NOT access or destroy the table instance +context after calling this function.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext to add the table instance. +\param Name the export table name WasmEdge_String. +\param TableCxt the WasmEdge_TableInstanceContext to add.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreate.html new file mode 100644 index 000000000..2637a4c53 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreate.html @@ -0,0 +1,12 @@ +WasmEdge_ModuleInstanceCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceCreate(
+    ModuleName: WasmEdge_String
+) -> *mut WasmEdge_ModuleInstanceContext
Expand description

Creation of the WasmEdge_ModuleInstanceContext.

+

Create a module instance context with exported module name for host +instances. Developer can use this API to create a module instance for +collecting host functions, tables, memories, and globals. +The caller owns the object and should call WasmEdge_ModuleInstanceDelete +to destroy it.

+

\param ModuleName the module name WasmEdge_String of this host module to +import.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreateWASI.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreateWASI.html new file mode 100644 index 000000000..3a730c1fa --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreateWASI.html @@ -0,0 +1,23 @@ +WasmEdge_ModuleInstanceCreateWASI in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceCreateWASI(
+    Args: *const *const c_char,
+    ArgLen: u32,
+    Envs: *const *const c_char,
+    EnvLen: u32,
+    Preopens: *const *const c_char,
+    PreopenLen: u32
+) -> *mut WasmEdge_ModuleInstanceContext
Expand description

Creation of the WasmEdge_ModuleInstanceContext for the WASI specification.

+

This function will create a WASI host module that contains the WASI host +functions and initialize it. The caller owns the object and should call +WasmEdge_ModuleInstanceDelete to destroy it.

+

\param Args the command line arguments. The first argument suggests being +the program name. NULL if the length is 0. +\param ArgLen the length of the command line arguments. +\param Envs the environment variables in the format ENV=VALUE. NULL if the +length is 0. +\param EnvLen the length of the environment variables. +\param Preopens the directory paths to preopen. String format in +GUEST_PATH:HOST_PATH means the path mapping, or the same path will be +mapped. NULL if the length is 0. +\param PreopenLen the length of the directory paths to preopen.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreateWithData.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreateWithData.html new file mode 100644 index 000000000..d37b679dd --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceCreateWithData.html @@ -0,0 +1,19 @@ +WasmEdge_ModuleInstanceCreateWithData in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceCreateWithData(
+    ModuleName: WasmEdge_String,
+    HostData: *mut c_void,
+    Finalizer: Option<unsafe extern "C" fn(arg1: *mut c_void)>
+) -> *mut WasmEdge_ModuleInstanceContext
Expand description

Creation of the WasmEdge_ModuleInstanceContext with host data.

+

Create a module instance context with exported module name, host data, and +host data finalizer for host instances. Developer can use this API to create +a module instance for collecting host functions, tables, memories, and +globals. When this created module instance being destroyed, the host data +finalizer will be invoked. The caller owns the object and should call +WasmEdge_ModuleInstanceDelete to destroy it.

+

\param ModuleName the module name WasmEdge_String of this host module to +import. +\param HostData the host data to set into the module instance. When calling +the finalizer, this pointer will become the argument of the finalizer +function. +\param Finalizer the function to finalize the host data.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceDelete.html new file mode 100644 index 000000000..ee01d97f0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceDelete.html @@ -0,0 +1,9 @@ +WasmEdge_ModuleInstanceDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceDelete(
+    Cxt: *mut WasmEdge_ModuleInstanceContext
+)
Expand description

Deletion of the WasmEdge_ModuleInstanceContext.

+

After calling this function, the context will be destroyed and should +NOT be used. +If the module instance has been registered into one or more store contexts, +it will be automatically unregistered.

+

\param Cxt the WasmEdge_ModuleInstanceContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindFunction.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindFunction.html new file mode 100644 index 000000000..2705ed797 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindFunction.html @@ -0,0 +1,12 @@ +WasmEdge_ModuleInstanceFindFunction in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceFindFunction(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Name: WasmEdge_String
+) -> *mut WasmEdge_FunctionInstanceContext
Expand description

Get the exported function instance context of a module instance.

+

The result function instance context links to the function instance in the +module instance context and owned by the module instance context, and the +caller should NOT call the WasmEdge_FunctionInstanceDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext. +\param Name the function name WasmEdge_String.

+

\returns pointer to the function instance context. NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindGlobal.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindGlobal.html new file mode 100644 index 000000000..5bfb18ca8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindGlobal.html @@ -0,0 +1,12 @@ +WasmEdge_ModuleInstanceFindGlobal in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceFindGlobal(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Name: WasmEdge_String
+) -> *mut WasmEdge_GlobalInstanceContext
Expand description

Get the exported global instance context of a module instance.

+

The result global instance context links to the global instance in the +module instance context and owned by the module instance context, and the +caller should NOT call the WasmEdge_GlobalInstanceDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext. +\param Name the global name WasmEdge_String.

+

\returns pointer to the global instance context. NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindMemory.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindMemory.html new file mode 100644 index 000000000..0590edf85 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindMemory.html @@ -0,0 +1,12 @@ +WasmEdge_ModuleInstanceFindMemory in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceFindMemory(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Name: WasmEdge_String
+) -> *mut WasmEdge_MemoryInstanceContext
Expand description

Get the exported memory instance context of a module instance.

+

The result memory instance context links to the memory instance in the +module instance context and owned by the module instance context, and the +caller should NOT call the WasmEdge_MemoryInstanceDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext. +\param Name the memory name WasmEdge_String.

+

\returns pointer to the memory instance context. NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindTable.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindTable.html new file mode 100644 index 000000000..2662ee801 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceFindTable.html @@ -0,0 +1,12 @@ +WasmEdge_ModuleInstanceFindTable in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceFindTable(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Name: WasmEdge_String
+) -> *mut WasmEdge_TableInstanceContext
Expand description

Get the exported table instance context of a module instance.

+

The result table instance context links to the table instance in the module +instance context and owned by the module instance context, and the caller +should NOT call the WasmEdge_TableInstanceDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext. +\param Name the table name WasmEdge_String.

+

\returns pointer to the table instance context. NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceGetHostData.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceGetHostData.html new file mode 100644 index 000000000..22d079d48 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceGetHostData.html @@ -0,0 +1,9 @@ +WasmEdge_ModuleInstanceGetHostData in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceGetHostData(
+    Cxt: *const WasmEdge_ModuleInstanceContext
+) -> *mut c_void
Expand description

Get the host data set into the module instance when creating.

+

The returned data is owned by the module instance, and will be passed into +the finalizer when deleting this module instance.

+

\param Cxt the WasmEdge_ModuleInstanceContext.

+

\returns host data. NULL if the module instance context is NULL or no host +data set into the module instance.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceGetModuleName.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceGetModuleName.html new file mode 100644 index 000000000..1824f2e95 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceGetModuleName.html @@ -0,0 +1,8 @@ +WasmEdge_ModuleInstanceGetModuleName in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceGetModuleName(
+    Cxt: *const WasmEdge_ModuleInstanceContext
+) -> WasmEdge_String
Expand description

Get the export module name of a module instance.

+

The returned string object is linked to the module name of the module +instance, and the caller should NOT call the WasmEdge_StringDelete.

+

\param Cxt the WasmEdge_ModuleInstanceContext.

+

\returns string object. Length will be 0 and Buf will be NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceInitWASI.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceInitWASI.html new file mode 100644 index 000000000..e5f6ad252 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceInitWASI.html @@ -0,0 +1,22 @@ +WasmEdge_ModuleInstanceInitWASI in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceInitWASI(
+    Cxt: *mut WasmEdge_ModuleInstanceContext,
+    Args: *const *const c_char,
+    ArgLen: u32,
+    Envs: *const *const c_char,
+    EnvLen: u32,
+    Preopens: *const *const c_char,
+    PreopenLen: u32
+)
Expand description

Initialize the WasmEdge_ModuleInstanceContext for the WASI specification.

+

This function will initialize the WASI host module with the parameters.

+

\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object. +\param Args the command line arguments. The first argument suggests being +the program name. NULL if the length is 0. +\param ArgLen the length of the command line arguments. +\param Envs the environment variables in the format ENV=VALUE. NULL if the +length is 0. +\param EnvLen the length of the environment variables. +\param Preopens the directory paths to preopen. String format in +GUEST_PATH:HOST_PATH means the path mapping, or the same path will be +mapped. NULL if the length is 0. +\param PreopenLen the length of the directory paths to preopen.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceInitWasmEdgeProcess.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceInitWasmEdgeProcess.html new file mode 100644 index 000000000..b3ff7cd10 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceInitWasmEdgeProcess.html @@ -0,0 +1,15 @@ +WasmEdge_ModuleInstanceInitWasmEdgeProcess in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceInitWasmEdgeProcess(
+    AllowedCmds: *const *const c_char,
+    CmdsLen: u32,
+    AllowAll: bool
+)
Expand description

Initialize the WasmEdge_ModuleInstanceContext for the wasmedge_process +specification.

+

This function will initialize the wasmedge_process host module with the +parameters.

+

\param AllowedCmds the allowed commands white list. NULL if the +length is 0. +\param CmdsLen the length of the allowed commands white list. +\param AllowAll the boolean value to allow all commands. false is +suggested. If this value is true, the allowed commands white list will not +be recorded and all commands can be executed by wasmedge_process.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListFunction.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListFunction.html new file mode 100644 index 000000000..83dae8caf --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListFunction.html @@ -0,0 +1,16 @@ +WasmEdge_ModuleInstanceListFunction in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceListFunction(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Names: *mut WasmEdge_String,
+    Len: u32
+) -> u32
Expand description

List the exported function names of a module instance.

+

The returned function names filled into the Names array are linked to the +exported names of functions of the module instance context, and the caller +should NOT call the WasmEdge_StringDelete. +If the Names buffer length is smaller than the result of the exported +function list size, the overflowed return values will be discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext. +\param [out] Names the output WasmEdge_String buffer of the function names. +\param Len the buffer length.

+

\returns actual exported function list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListFunctionLength.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListFunctionLength.html new file mode 100644 index 000000000..641cdf08f --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListFunctionLength.html @@ -0,0 +1,7 @@ +WasmEdge_ModuleInstanceListFunctionLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceListFunctionLength(
+    Cxt: *const WasmEdge_ModuleInstanceContext
+) -> u32
Expand description

Get the length of exported function list of a module instance.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext.

+

\returns length of the exported function list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListGlobal.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListGlobal.html new file mode 100644 index 000000000..16d801f40 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListGlobal.html @@ -0,0 +1,16 @@ +WasmEdge_ModuleInstanceListGlobal in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceListGlobal(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Names: *mut WasmEdge_String,
+    Len: u32
+) -> u32
Expand description

List the exported global names of a module instance.

+

The returned global names filled into the Names array are linked to the +exported names of globals of the module instance context, and the caller +should NOT call the WasmEdge_StringDelete. +If the Names buffer length is smaller than the result of the exported +global list size, the overflowed return values will be discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext. +\param [out] Names the output WasmEdge_String buffer of the global names. +\param Len the buffer length.

+

\returns actual exported global list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListGlobalLength.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListGlobalLength.html new file mode 100644 index 000000000..0a5465274 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListGlobalLength.html @@ -0,0 +1,7 @@ +WasmEdge_ModuleInstanceListGlobalLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceListGlobalLength(
+    Cxt: *const WasmEdge_ModuleInstanceContext
+) -> u32
Expand description

Get the length of exported global list of a module instance.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext.

+

\returns length of the exported global list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListMemory.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListMemory.html new file mode 100644 index 000000000..0b9401107 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListMemory.html @@ -0,0 +1,16 @@ +WasmEdge_ModuleInstanceListMemory in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceListMemory(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Names: *mut WasmEdge_String,
+    Len: u32
+) -> u32
Expand description

List the exported memory names of a module instance.

+

The returned memory names filled into the Names array are linked to the +exported names of memories of the module instance context, and the caller +should NOT call the WasmEdge_StringDelete. +If the Names buffer length is smaller than the result of the exported +memory list size, the overflowed return values will be discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext. +\param [out] Names the output WasmEdge_String buffer of the memory names. +\param Len the buffer length.

+

\returns actual exported memory list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListMemoryLength.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListMemoryLength.html new file mode 100644 index 000000000..43d8e1634 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListMemoryLength.html @@ -0,0 +1,7 @@ +WasmEdge_ModuleInstanceListMemoryLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceListMemoryLength(
+    Cxt: *const WasmEdge_ModuleInstanceContext
+) -> u32
Expand description

Get the length of exported memory list of a module instance.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext.

+

\returns length of the exported memory list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListTable.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListTable.html new file mode 100644 index 000000000..6a1f2e5b1 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListTable.html @@ -0,0 +1,16 @@ +WasmEdge_ModuleInstanceListTable in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceListTable(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Names: *mut WasmEdge_String,
+    Len: u32
+) -> u32
Expand description

List the exported table names of a module instance.

+

The returned table names filled into the Names array are linked to the +exported names of tables of the module instance context, and the caller +should NOT call the WasmEdge_StringDelete. +If the Names buffer length is smaller than the result of the exported +table list size, the overflowed return values will be discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext. +\param [out] Names the output WasmEdge_String buffer of the table names. +\param Len the buffer length.

+

\returns actual exported table list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListTableLength.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListTableLength.html new file mode 100644 index 000000000..51c994772 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceListTableLength.html @@ -0,0 +1,7 @@ +WasmEdge_ModuleInstanceListTableLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceListTableLength(
+    Cxt: *const WasmEdge_ModuleInstanceContext
+) -> u32
Expand description

Get the length of exported table list of a module instance.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_ModuleInstanceContext.

+

\returns length of the exported table list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceWASIGetExitCode.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceWASIGetExitCode.html new file mode 100644 index 000000000..6bc3161df --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceWASIGetExitCode.html @@ -0,0 +1,9 @@ +WasmEdge_ModuleInstanceWASIGetExitCode in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceWASIGetExitCode(
+    Cxt: *const WasmEdge_ModuleInstanceContext
+) -> u32
Expand description

Get the WASI exit code.

+

This function will return the exit code after running the “_start” function +of a wasm32-wasi program.

+

\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object.

+

\returns the exit code after executing the “_start” function. Return +EXIT_FAILURE if the Cxt is NULL or not a WASI host module.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceWASIGetNativeHandler.html b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceWASIGetNativeHandler.html new file mode 100644 index 000000000..fc08cc695 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ModuleInstanceWASIGetNativeHandler.html @@ -0,0 +1,14 @@ +WasmEdge_ModuleInstanceWASIGetNativeHandler in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ModuleInstanceWASIGetNativeHandler(
+    Cxt: *const WasmEdge_ModuleInstanceContext,
+    Fd: i32,
+    NativeHandler: *mut u64
+) -> u32
Expand description

Get the native handler from the WASI mapped FD/Handler.

+

This function will return the raw FD/Handler from a given mapped Fd +or Handler.

+

\param Cxt the WasmEdge_ModuleInstanceContext of WASI import object. +\param Fd the WASI mapped Fd. +\param [out] NativeHandler the raw Fd/Handler.

+

\returns the error code. Return 0 if the Native Handler is found. +Return 1 if the Cxt is NULL. +Return 2 if the given mapped Fd/handler is not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginCreateModule.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginCreateModule.html new file mode 100644 index 000000000..6949f8f33 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginCreateModule.html @@ -0,0 +1,13 @@ +WasmEdge_PluginCreateModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginCreateModule(
+    Cxt: *const WasmEdge_PluginContext,
+    ModuleName: WasmEdge_String
+) -> *mut WasmEdge_ModuleInstanceContext
Expand description

Create the module instance in the plug-in by the module name.

+

By giving the module name, developers can retrieve the module in the plug-in +and create the module instance. +The caller owns the object and should call WasmEdge_ModuleInstanceDelete +to destroy it.

+

\param Cxt the WasmEdge_PluginContext to retrieve and create module. +\param ModuleName the module name to retrieve.

+

\returns pointer to the module instance context, NULL if the module name not +found in the plug-in or the plug-in is not valid.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginFind.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginFind.html new file mode 100644 index 000000000..8154e93a5 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginFind.html @@ -0,0 +1,9 @@ +WasmEdge_PluginFind in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginFind(
+    Name: WasmEdge_String
+) -> *const WasmEdge_PluginContext
Expand description

Find the loaded plug-in context by name.

+

After loading the plug-ins from default paths or the given path, developers +can use this API to retrieve the plug-in context by name. Then developers +can create the module instance from the plug-in contexts.

+

\param Name the plug-in name WasmEdge_String.

+

\returns pointer to the plug-in context. NULL if the plug-in not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginGetPluginName.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginGetPluginName.html new file mode 100644 index 000000000..83ef74254 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginGetPluginName.html @@ -0,0 +1,8 @@ +WasmEdge_PluginGetPluginName in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginGetPluginName(
+    Cxt: *const WasmEdge_PluginContext
+) -> WasmEdge_String
Expand description

Get the plug-in name of the plug-in context.

+

The returned string object is linked to the plug-in name of the plug-in +context, and the caller should NOT call the WasmEdge_StringDelete.

+

\param Cxt the WasmEdge_PluginContext.

+

\returns string object. Length will be 0 and Buf will be NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginInitWASINN.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginInitWASINN.html new file mode 100644 index 000000000..7bbc84b40 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginInitWASINN.html @@ -0,0 +1,10 @@ +WasmEdge_PluginInitWASINN in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginInitWASINN(
+    NNPreloads: *const *const c_char,
+    PreloadsLen: u32
+)
Expand description

Initialize the wasi_nn plug-in.

+

This function will initialize the wasi_nn plug-in with the preloads string +list. Only available after loading the wasi_nn plug-in and before creating +the module instance from the plug-in.

+

\param NNPreloads the preload string list. NULL if the length is 0. +\param PreloadsLen the length of the preload list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginListModule.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginListModule.html new file mode 100644 index 000000000..e5b678d49 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginListModule.html @@ -0,0 +1,15 @@ +WasmEdge_PluginListModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginListModule(
+    Cxt: *const WasmEdge_PluginContext,
+    Names: *mut WasmEdge_String,
+    Len: u32
+) -> u32
Expand description

List the modules in the plug-in context with their names.

+

The returned module names filled into the Names array are owned by the +internal WasmEdge plug-in storage, and the caller should NOT call the +WasmEdge_StringDelete. +If the Names buffer length is smaller than the result of the loaded +plug-in list size, the overflowed return values will be discarded.

+

\param Cxt the WasmEdge_PluginContext to list the modules. +\param [out] Names the output WasmEdge_String buffer of the function names. +\param Len the buffer length.

+

\returns actual module list size of the plug-in.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginListModuleLength.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginListModuleLength.html new file mode 100644 index 000000000..58bcd2f64 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginListModuleLength.html @@ -0,0 +1,8 @@ +WasmEdge_PluginListModuleLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginListModuleLength(
+    Cxt: *const WasmEdge_PluginContext
+) -> u32
Expand description

Get the length of module list in the plug-in context.

+

There may be several modules in a plug-in. Developers can use this function +to get the length of the module list in a plug-in.

+

\param Cxt the WasmEdge_PluginContext to get the length of the module list.

+

\returns length of module list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginListPlugins.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginListPlugins.html new file mode 100644 index 000000000..ee61a31cd --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginListPlugins.html @@ -0,0 +1,13 @@ +WasmEdge_PluginListPlugins in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginListPlugins(
+    Names: *mut WasmEdge_String,
+    Len: u32
+) -> u32
Expand description

List the loaded plug-ins with their names.

+

The returned plug-in names filled into the Names array are owned by the +internal WasmEdge plug-in storage, and the caller should NOT call the +WasmEdge_StringDelete. +If the Names buffer length is smaller than the result of the loaded +plug-in list size, the overflowed return values will be discarded.

+

\param [out] Names the output WasmEdge_String buffer of the function names. +\param Len the buffer length.

+

\returns actual loaded plug-in list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginListPluginsLength.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginListPluginsLength.html new file mode 100644 index 000000000..7b31c96cb --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginListPluginsLength.html @@ -0,0 +1,3 @@ +WasmEdge_PluginListPluginsLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginListPluginsLength() -> u32
Expand description

Get the length of loaded plug-in list.

+

\returns length of loaded plug-in list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginLoadFromPath.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginLoadFromPath.html new file mode 100644 index 000000000..090a37137 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginLoadFromPath.html @@ -0,0 +1,8 @@ +WasmEdge_PluginLoadFromPath in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginLoadFromPath(
+    Path: *const c_char
+)
Expand description

Load the plugin with the given file or directory.

+

For the given file path, this function will load the plug-in. +For the given directory path, this function will load the plug-ins under the +directory recursively.

+

\param Path the path to plug-in file or directory.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_PluginLoadWithDefaultPaths.html b/wasmedge_sys/ffi/fn.WasmEdge_PluginLoadWithDefaultPaths.html new file mode 100644 index 000000000..6e5d96116 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_PluginLoadWithDefaultPaths.html @@ -0,0 +1,9 @@ +WasmEdge_PluginLoadWithDefaultPaths in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_PluginLoadWithDefaultPaths()
Expand description

Load plugins with the default search paths.

+

The default paths are:

+
    +
  1. The environment variable “WASMEDGE_PLUGIN_PATH”.
  2. +
  3. The “../plugin/” directory related to the WasmEdge installation path.
  4. +
  5. The “wasmedge/” directory under the library path if the WasmEdge is +installed under the “/usr”.
  6. +
+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_Plugin_GetDescriptor.html b/wasmedge_sys/ffi/fn.WasmEdge_Plugin_GetDescriptor.html new file mode 100644 index 000000000..6907e8536 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_Plugin_GetDescriptor.html @@ -0,0 +1,4 @@ +WasmEdge_Plugin_GetDescriptor in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_Plugin_GetDescriptor(
+) -> *const WasmEdge_PluginDescriptor
Expand description

Implement by plugins for returning the plugin descriptor.

+

\returns the plugin descriptor.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ResultGen.html b/wasmedge_sys/ffi/fn.WasmEdge_ResultGen.html new file mode 100644 index 000000000..6f4d65950 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ResultGen.html @@ -0,0 +1,9 @@ +WasmEdge_ResultGen in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ResultGen(
+    Category: WasmEdge_ErrCategory,
+    Code: u32
+) -> WasmEdge_Result
Expand description

Generate the result with code.

+

\param Category the WasmEdge_ErrCategory to specify the error category. +\param Code the 24-bit length error code. The data exceeds 24 bits will be +stripped.

+

\returns WasmEdge_Result struct with the given data.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ResultGetCategory.html b/wasmedge_sys/ffi/fn.WasmEdge_ResultGetCategory.html new file mode 100644 index 000000000..a946c2147 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ResultGetCategory.html @@ -0,0 +1,6 @@ +WasmEdge_ResultGetCategory in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ResultGetCategory(
+    Res: WasmEdge_Result
+) -> WasmEdge_ErrCategory
Expand description

Get the error category.

+

\param Res the WasmEdge_Result struct.

+

\returns error category in the WasmEdge_Result struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ResultGetCode.html b/wasmedge_sys/ffi/fn.WasmEdge_ResultGetCode.html new file mode 100644 index 000000000..2fd7f7b6c --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ResultGetCode.html @@ -0,0 +1,6 @@ +WasmEdge_ResultGetCode in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ResultGetCode(
+    Res: WasmEdge_Result
+) -> u32
Expand description

Get the result code.

+

\param Res the WasmEdge_Result struct.

+

\returns result code (24-bit size data) in the WasmEdge_Result struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ResultGetMessage.html b/wasmedge_sys/ffi/fn.WasmEdge_ResultGetMessage.html new file mode 100644 index 000000000..ad7ea4048 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ResultGetMessage.html @@ -0,0 +1,9 @@ +WasmEdge_ResultGetMessage in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ResultGetMessage(
+    Res: WasmEdge_Result
+) -> *const c_char
Expand description

Get the result message.

+

The returned string must NOT be destroyed. +If the error category of the result is NOT WasmEdge_ErrCategory_WASM, +the message will always be “user defined error code”.

+

\param Res the WasmEdge_Result struct.

+

\returns NULL-terminated C string of the corresponding error message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ResultOK.html b/wasmedge_sys/ffi/fn.WasmEdge_ResultOK.html new file mode 100644 index 000000000..415d0a90a --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ResultOK.html @@ -0,0 +1,7 @@ +WasmEdge_ResultOK in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ResultOK(
+    Res: WasmEdge_Result
+) -> bool
Expand description

Check the result is a success or not.

+

\param Res the WasmEdge_Result struct.

+

\returns true if the error code is WasmEdge_Result_Success or +WasmEdge_Result_Terminate, false for others.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StatisticsClear.html b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsClear.html new file mode 100644 index 000000000..5ae1cabd8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsClear.html @@ -0,0 +1,5 @@ +WasmEdge_StatisticsClear in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StatisticsClear(
+    Cxt: *mut WasmEdge_StatisticsContext
+)
Expand description

Clear all data in the WasmEdge_StatisticsContext.

+

\param Cxt the WasmEdge_StatisticsContext to clear.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StatisticsCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsCreate.html new file mode 100644 index 000000000..e790c3018 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsCreate.html @@ -0,0 +1,6 @@ +WasmEdge_StatisticsCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StatisticsCreate(
+) -> *mut WasmEdge_StatisticsContext
Expand description

Creation of the WasmEdge_StatisticsContext.

+

The caller owns the object and should call WasmEdge_StatisticsDelete to +destroy it.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StatisticsDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsDelete.html new file mode 100644 index 000000000..4ef935701 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsDelete.html @@ -0,0 +1,7 @@ +WasmEdge_StatisticsDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StatisticsDelete(
+    Cxt: *mut WasmEdge_StatisticsContext
+)
Expand description

Deletion of the WasmEdge_StatisticsContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_StatisticsContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetInstrCount.html b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetInstrCount.html new file mode 100644 index 000000000..b86a163a7 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetInstrCount.html @@ -0,0 +1,6 @@ +WasmEdge_StatisticsGetInstrCount in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StatisticsGetInstrCount(
+    Cxt: *const WasmEdge_StatisticsContext
+) -> u64
Expand description

Get the instruction count in execution.

+

\param Cxt the WasmEdge_StatisticsContext to get data.

+

\returns the instruction count in total execution.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetInstrPerSecond.html b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetInstrPerSecond.html new file mode 100644 index 000000000..5287deb37 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetInstrPerSecond.html @@ -0,0 +1,6 @@ +WasmEdge_StatisticsGetInstrPerSecond in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StatisticsGetInstrPerSecond(
+    Cxt: *const WasmEdge_StatisticsContext
+) -> f64
Expand description

Get the instruction count per second in execution.

+

\param Cxt the WasmEdge_StatisticsContext to get data.

+

\returns the instruction count per second.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetTotalCost.html b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetTotalCost.html new file mode 100644 index 000000000..81a781fb5 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsGetTotalCost.html @@ -0,0 +1,6 @@ +WasmEdge_StatisticsGetTotalCost in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StatisticsGetTotalCost(
+    Cxt: *const WasmEdge_StatisticsContext
+) -> u64
Expand description

Get the total cost in execution.

+

\param Cxt the WasmEdge_StatisticsContext to get data.

+

\returns the total cost.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StatisticsSetCostLimit.html b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsSetCostLimit.html new file mode 100644 index 000000000..9971acc7e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsSetCostLimit.html @@ -0,0 +1,9 @@ +WasmEdge_StatisticsSetCostLimit in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StatisticsSetCostLimit(
+    Cxt: *mut WasmEdge_StatisticsContext,
+    Limit: u64
+)
Expand description

Set the cost limit in execution.

+

The WASM execution will be aborted if the instruction costs exceeded the +limit and the ErrCode::Value::CostLimitExceeded will be returned.

+

\param Cxt the WasmEdge_StatisticsContext to set the cost table. +\param Limit the cost limit.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StatisticsSetCostTable.html b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsSetCostTable.html new file mode 100644 index 000000000..b7431feed --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StatisticsSetCostTable.html @@ -0,0 +1,9 @@ +WasmEdge_StatisticsSetCostTable in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StatisticsSetCostTable(
+    Cxt: *mut WasmEdge_StatisticsContext,
+    CostArr: *mut u64,
+    Len: u32
+)
Expand description

Set the costs of instructions.

+

\param Cxt the WasmEdge_StatisticsContext to set the cost table. +\param CostArr the cost table array. +\param Len the length of the cost table array.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StoreCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_StoreCreate.html new file mode 100644 index 000000000..f73af12c3 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StoreCreate.html @@ -0,0 +1,9 @@ +WasmEdge_StoreCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StoreCreate(
+) -> *mut WasmEdge_StoreContext
Expand description

Creation of the WasmEdge_StoreContext.

+

The caller owns the object and should call WasmEdge_StoreDelete to destroy +it. +The store is the linker for multiple WASM module instances. The store will +not own any module instance registered into it, and the module instances +will automatically be unregistered if they are destroyed.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StoreDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_StoreDelete.html new file mode 100644 index 000000000..91ab96dd3 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StoreDelete.html @@ -0,0 +1,9 @@ +WasmEdge_StoreDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StoreDelete(
+    Cxt: *mut WasmEdge_StoreContext
+)
Expand description

Deletion of the WasmEdge_StoreContext.

+

After calling this function, the context will be destroyed and should +NOT be used. +If there are module instances registered into this store context, they will +be automatically un-link to this store context.

+

\param Cxt the WasmEdge_StoreContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StoreFindModule.html b/wasmedge_sys/ffi/fn.WasmEdge_StoreFindModule.html new file mode 100644 index 000000000..71cafb29e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StoreFindModule.html @@ -0,0 +1,11 @@ +WasmEdge_StoreFindModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StoreFindModule(
+    Cxt: *const WasmEdge_StoreContext,
+    Name: WasmEdge_String
+) -> *const WasmEdge_ModuleInstanceContext
Expand description

Get the module instance context by the module name.

+

After registering a WASM module, developers can call this function to find +and get the registered module instance context by the module name.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_StoreContext. +\param Name the module name WasmEdge_String.

+

\returns pointer to the module instance context. NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StoreListModule.html b/wasmedge_sys/ffi/fn.WasmEdge_StoreListModule.html new file mode 100644 index 000000000..6ab094309 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StoreListModule.html @@ -0,0 +1,17 @@ +WasmEdge_StoreListModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StoreListModule(
+    Cxt: *const WasmEdge_StoreContext,
+    Names: *mut WasmEdge_String,
+    Len: u32
+) -> u32
Expand description

List the registered module names.

+

This function will list all registered module names. +The returned module names filled into the Names array are linked to the +registered module names in the store context, and the caller should NOT +call the WasmEdge_StringDelete. +If the Names buffer length is smaller than the result of the registered +named module list size, the overflowed return values will be discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_StoreContext. +\param [out] Names the output names WasmEdge_String buffer of named modules. +\param Len the buffer length.

+

\returns actual registered named module list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StoreListModuleLength.html b/wasmedge_sys/ffi/fn.WasmEdge_StoreListModuleLength.html new file mode 100644 index 000000000..ffabfa882 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StoreListModuleLength.html @@ -0,0 +1,7 @@ +WasmEdge_StoreListModuleLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StoreListModuleLength(
+    Cxt: *const WasmEdge_StoreContext
+) -> u32
Expand description

Get the length of registered module list in store.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_StoreContext.

+

\returns length of registered named module list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StringCopy.html b/wasmedge_sys/ffi/fn.WasmEdge_StringCopy.html new file mode 100644 index 000000000..001a59e49 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StringCopy.html @@ -0,0 +1,14 @@ +WasmEdge_StringCopy in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StringCopy(
+    Str: WasmEdge_String,
+    Buf: *mut c_char,
+    Len: u32
+) -> u32
Expand description

Copy the content of WasmEdge_String object to the buffer.

+

This function copy at most Len characters from the WasmEdge_String +object to the destination buffer. If the string length is less than Len +characters long, the remainder of the buffer is filled with `\0’ characters. +Otherwise, the destination is not terminated.

+

\param Str the source WasmEdge_String object to copy. +\param Buf the buffer to fill the string content. +\param Len the buffer length.

+

\returns the copied length of string.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StringCreateByBuffer.html b/wasmedge_sys/ffi/fn.WasmEdge_StringCreateByBuffer.html new file mode 100644 index 000000000..7bcd4c6a7 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StringCreateByBuffer.html @@ -0,0 +1,11 @@ +WasmEdge_StringCreateByBuffer in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StringCreateByBuffer(
+    Buf: *const c_char,
+    Len: u32
+) -> WasmEdge_String
Expand description

Creation of the WasmEdge_String with the buffer and its length.

+

The caller owns the object and should call WasmEdge_StringDelete to +destroy it.

+

\param Buf the buffer to copy into the WasmEdge_String object. +\param Len the buffer length.

+

\returns string object. Length will be 0 and Buf will be NULL if failed or +the input buffer is a NULL.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StringCreateByCString.html b/wasmedge_sys/ffi/fn.WasmEdge_StringCreateByCString.html new file mode 100644 index 000000000..b3886f9f1 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StringCreateByCString.html @@ -0,0 +1,12 @@ +WasmEdge_StringCreateByCString in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StringCreateByCString(
+    Str: *const c_char
+) -> WasmEdge_String
Expand description

Creation of the WasmEdge_String with the C string.

+

The caller owns the object and should call WasmEdge_StringDelete to +destroy it. This function only supports the C string with NULL termination. +If the input string may have \0 character, please use the +WasmEdge_StringCreateByBuffer instead.

+

\param Str the NULL-terminated C string to copy into the WasmEdge_String +object.

+

\returns string object. Length will be 0 and Buf will be NULL if failed or +the input string is a NULL.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StringDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_StringDelete.html new file mode 100644 index 000000000..075a41f26 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StringDelete.html @@ -0,0 +1,5 @@ +WasmEdge_StringDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StringDelete(Str: WasmEdge_String)
Expand description

Deletion of the WasmEdge_String.

+

After calling this function, the resources in the WasmEdge_String object +will be released and the object should NOT be used.

+

\param Str the WasmEdge_String object to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StringIsEqual.html b/wasmedge_sys/ffi/fn.WasmEdge_StringIsEqual.html new file mode 100644 index 000000000..fc570c1bc --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StringIsEqual.html @@ -0,0 +1,9 @@ +WasmEdge_StringIsEqual in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StringIsEqual(
+    Str1: WasmEdge_String,
+    Str2: WasmEdge_String
+) -> bool
Expand description

Compare the two WasmEdge_String objects.

+

\param Str1 the first WasmEdge_String object to compare. +\param Str2 the second WasmEdge_String object to compare.

+

\returns true if the content of two WasmEdge_String objects are the same, +false if not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_StringWrap.html b/wasmedge_sys/ffi/fn.WasmEdge_StringWrap.html new file mode 100644 index 000000000..022620bf3 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_StringWrap.html @@ -0,0 +1,11 @@ +WasmEdge_StringWrap in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_StringWrap(
+    Buf: *const c_char,
+    Len: u32
+) -> WasmEdge_String
Expand description

Create the WasmEdge_String wraps to the buffer.

+

This function creates a WasmEdge_String object which wraps to the input +buffer. The caller should guarantee the life cycle of the input buffer, and +should NOT call the WasmEdge_StringDelete.

+

\param Buf the buffer to copy into the WasmEdge_String object. +\param Len the buffer length.

+

\returns string object refer to the input buffer with its length.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceCreate.html new file mode 100644 index 000000000..b0e6f82f9 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceCreate.html @@ -0,0 +1,10 @@ +WasmEdge_TableInstanceCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableInstanceCreate(
+    TabType: *const WasmEdge_TableTypeContext
+) -> *mut WasmEdge_TableInstanceContext
Expand description

Creation of the WasmEdge_TableInstanceContext.

+

The caller owns the object and should call WasmEdge_TableInstanceDelete to +destroy it if the returned object is not added into a +WasmEdge_ModuleInstanceContext.

+

\param TabType the table type context to initialize the table instance +context.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceDelete.html new file mode 100644 index 000000000..4e40ca181 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceDelete.html @@ -0,0 +1,7 @@ +WasmEdge_TableInstanceDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableInstanceDelete(
+    Cxt: *mut WasmEdge_TableInstanceContext
+)
Expand description

Deletion of the WasmEdge_TableInstanceContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_TableInstanceContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetData.html b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetData.html new file mode 100644 index 000000000..31b68404d --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetData.html @@ -0,0 +1,11 @@ +WasmEdge_TableInstanceGetData in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableInstanceGetData(
+    Cxt: *const WasmEdge_TableInstanceContext,
+    Data: *mut WasmEdge_Value,
+    Offset: u32
+) -> WasmEdge_Result
Expand description

Get the reference value in a table instance.

+

\param Cxt the WasmEdge_TableInstanceContext. +\param [out] Data the result reference value. +\param Offset the reference value offset (index) in the table instance.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetSize.html b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetSize.html new file mode 100644 index 000000000..69bab3240 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetSize.html @@ -0,0 +1,6 @@ +WasmEdge_TableInstanceGetSize in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableInstanceGetSize(
+    Cxt: *const WasmEdge_TableInstanceContext
+) -> u32
Expand description

Get the size of a table instance.

+

\param Cxt the WasmEdge_TableInstanceContext.

+

\returns the size of the table instance.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetTableType.html b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetTableType.html new file mode 100644 index 000000000..daa60a7d6 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGetTableType.html @@ -0,0 +1,9 @@ +WasmEdge_TableInstanceGetTableType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableInstanceGetTableType(
+    Cxt: *const WasmEdge_TableInstanceContext
+) -> *const WasmEdge_TableTypeContext
Expand description

Get the table type context from a table instance.

+

The table type context links to the table type in the table instance context +and owned by the context. The caller should NOT call the +WasmEdge_TableTypeDelete.

+

\param Cxt the WasmEdge_TableInstanceContext.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGrow.html b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGrow.html new file mode 100644 index 000000000..9d588652e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceGrow.html @@ -0,0 +1,9 @@ +WasmEdge_TableInstanceGrow in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableInstanceGrow(
+    Cxt: *mut WasmEdge_TableInstanceContext,
+    Size: u32
+) -> WasmEdge_Result
Expand description

Grow a table instance with a size.

+

\param Cxt the WasmEdge_TableInstanceContext. +\param Size the count of reference values to grow in the table instance.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceSetData.html b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceSetData.html new file mode 100644 index 000000000..0f42c1292 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableInstanceSetData.html @@ -0,0 +1,11 @@ +WasmEdge_TableInstanceSetData in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableInstanceSetData(
+    Cxt: *mut WasmEdge_TableInstanceContext,
+    Data: WasmEdge_Value,
+    Offset: u32
+) -> WasmEdge_Result
Expand description

Set the reference value into a table instance.

+

\param Cxt the WasmEdge_TableInstanceContext. +\param Data the reference value to set into the table instance. +\param Offset the reference value offset (index) in the table instance.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableTypeCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_TableTypeCreate.html new file mode 100644 index 000000000..b6a5be27e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableTypeCreate.html @@ -0,0 +1,10 @@ +WasmEdge_TableTypeCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableTypeCreate(
+    RefType: WasmEdge_RefType,
+    Limit: WasmEdge_Limit
+) -> *mut WasmEdge_TableTypeContext
Expand description

Creation of the WasmEdge_TableTypeContext.

+

The caller owns the object and should call WasmEdge_TableTypeDelete to +destroy it.

+

\param RefType the reference type of the table type. +\param Limit the limit struct of the table type.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableTypeDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_TableTypeDelete.html new file mode 100644 index 000000000..1fe94aee7 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableTypeDelete.html @@ -0,0 +1,7 @@ +WasmEdge_TableTypeDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableTypeDelete(
+    Cxt: *mut WasmEdge_TableTypeContext
+)
Expand description

Deletion of the WasmEdge_TableTypeContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_TableTypeContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableTypeGetLimit.html b/wasmedge_sys/ffi/fn.WasmEdge_TableTypeGetLimit.html new file mode 100644 index 000000000..caf19e1d2 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableTypeGetLimit.html @@ -0,0 +1,6 @@ +WasmEdge_TableTypeGetLimit in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableTypeGetLimit(
+    Cxt: *const WasmEdge_TableTypeContext
+) -> WasmEdge_Limit
Expand description

Get the limit from a table type.

+

\param Cxt the WasmEdge_TableTypeContext.

+

\returns the limit struct of the table type.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_TableTypeGetRefType.html b/wasmedge_sys/ffi/fn.WasmEdge_TableTypeGetRefType.html new file mode 100644 index 000000000..74edf7b5e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_TableTypeGetRefType.html @@ -0,0 +1,6 @@ +WasmEdge_TableTypeGetRefType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_TableTypeGetRefType(
+    Cxt: *const WasmEdge_TableTypeContext
+) -> WasmEdge_RefType
Expand description

Get the reference type from a table type.

+

\param Cxt the WasmEdge_TableTypeContext.

+

\returns the reference type of the table type.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncExecute.html b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncExecute.html new file mode 100644 index 000000000..0d03cd46b --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncExecute.html @@ -0,0 +1,21 @@ +WasmEdge_VMAsyncExecute in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMAsyncExecute(
+    Cxt: *mut WasmEdge_VMContext,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32
+) -> *mut WasmEdge_Async
Expand description

Asynchronous invoke a WASM function by name.

+

This is the final step to invoke a WASM function step by step. +After instantiating a WASM module in the VM context, the WASM module is +registered into the store in the VM context as an anonymous module. Then you +can repeatedly call this function to invoke the exported WASM functions by +their names until the VM context is reset or a new WASM module is registered +or loaded. For calling the functions in registered WASM modules with module +names, please use WasmEdge_VMAsyncExecuteRegistered instead.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length.

+

\returns WasmEdge_Async. Call WasmEdge_AsyncGet for the result, and call +WasmEdge_AsyncDelete to destroy this object.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncExecuteRegistered.html b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncExecuteRegistered.html new file mode 100644 index 000000000..f8c13dfec --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncExecuteRegistered.html @@ -0,0 +1,19 @@ +WasmEdge_VMAsyncExecuteRegistered in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMAsyncExecuteRegistered(
+    Cxt: *mut WasmEdge_VMContext,
+    ModuleName: WasmEdge_String,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32
+) -> *mut WasmEdge_Async
Expand description

Asynchronous invoke a WASM function by its module name and function name.

+

After registering a WASM module in the VM context, you can repeatedly call +this function to invoke exported WASM functions by their module names and +function names until the VM context is reset.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param ModuleName the module name WasmEdge_String. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length.

+

\returns WasmEdge_Async. Call WasmEdge_AsyncGet for the result, and call +WasmEdge_AsyncDelete to destroy this object.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromASTModule.html b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromASTModule.html new file mode 100644 index 000000000..bdca6c4bc --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromASTModule.html @@ -0,0 +1,27 @@ +WasmEdge_VMAsyncRunWasmFromASTModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMAsyncRunWasmFromASTModule(
+    Cxt: *mut WasmEdge_VMContext,
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32
+) -> *mut WasmEdge_Async
Expand description

Instantiate the WASM module from a WasmEdge AST Module and asynchronous +invoke a function by name.

+

This is the function to invoke a WASM function rapidly. +Load and instantiate the WASM module from the WasmEdge AST Module, and then +invoke the function by name and parameters. If the Returns buffer length +is smaller than the arity of the function, the overflowed return values will +be discarded. +After calling this function, a new module instance is instantiated, and the +old one will be destroyed.

+

The caller owns the object and should call WasmEdge_AsyncDelete to destroy +it.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param ASTCxt the WasmEdge AST Module context generated by loader or +compiler. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length.

+

\returns WasmEdge_Async. Call WasmEdge_AsyncGet for the result, and call +WasmEdge_AsyncDelete to destroy this object.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromBuffer.html b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromBuffer.html new file mode 100644 index 000000000..9b0d18153 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromBuffer.html @@ -0,0 +1,28 @@ +WasmEdge_VMAsyncRunWasmFromBuffer in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMAsyncRunWasmFromBuffer(
+    Cxt: *mut WasmEdge_VMContext,
+    Buf: *const u8,
+    BufLen: u32,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32
+) -> *mut WasmEdge_Async
Expand description

Instantiate the WASM module from a buffer and asynchronous invoke a function +by name.

+

This is the function to invoke a WASM function rapidly. +Load and instantiate the WASM module from a buffer, and then invoke a +function by name and parameters. If the Returns buffer length is smaller +than the arity of the function, the overflowed return values will be +discarded. +After calling this function, a new module instance is instantiated, and the +old one will be destroyed.

+

The caller owns the object and should call WasmEdge_AsyncDelete to destroy +it.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param Buf the buffer of WASM binary. +\param BufLen the length of the buffer. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length.

+

\returns WasmEdge_Async. Call WasmEdge_AsyncGet for the result, and call +WasmEdge_AsyncDelete to destroy this object.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromFile.html b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromFile.html new file mode 100644 index 000000000..d56891b93 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMAsyncRunWasmFromFile.html @@ -0,0 +1,26 @@ +WasmEdge_VMAsyncRunWasmFromFile in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMAsyncRunWasmFromFile(
+    Cxt: *mut WasmEdge_VMContext,
+    Path: *const c_char,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32
+) -> *mut WasmEdge_Async
Expand description

Instantiate the WASM module from a WASM file and asynchronous invoke a +function by name.

+

This is the function to invoke a WASM function rapidly. +Load and instantiate the WASM module from the file path, and then invoke a +function by name and parameters. If the Returns buffer length is smaller +than the arity of the function, the overflowed return values will be +discarded. +After calling this function, a new module instance is instantiated, and the +old one will be destroyed.

+

The caller owns the object and should call WasmEdge_AsyncDelete to destroy +it.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param Path the NULL-terminated C string of the WASM file path. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length.

+

\returns WasmEdge_Async. Call WasmEdge_AsyncGet for the result, and call +WasmEdge_AsyncDelete to destroy this object.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMCleanup.html b/wasmedge_sys/ffi/fn.WasmEdge_VMCleanup.html new file mode 100644 index 000000000..51ed6191c --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMCleanup.html @@ -0,0 +1,9 @@ +WasmEdge_VMCleanup in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMCleanup(
+    Cxt: *mut WasmEdge_VMContext
+)
Expand description

Reset of WasmEdge_VMContext.

+

After calling this function, the statistics, loaded module, the instantiated +instances, and the registered instances except the WASI and plug-ins will +all be cleared.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext to reset.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_VMCreate.html new file mode 100644 index 000000000..acbf18755 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMCreate.html @@ -0,0 +1,14 @@ +WasmEdge_VMCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMCreate(
+    ConfCxt: *const WasmEdge_ConfigureContext,
+    StoreCxt: *mut WasmEdge_StoreContext
+) -> *mut WasmEdge_VMContext
Expand description

Creation of the WasmEdge_VMContext.

+

The caller owns the object and should call WasmEdge_VMDelete to destroy +it.

+

\param ConfCxt the WasmEdge_ConfigureContext as the configuration of VM. +NULL for the default configuration. +\param StoreCxt the WasmEdge_StoreContext as the external WASM store of VM. +The instantiation and execution will refer to this store context, and the +life cycle should be ensured until the VM context is deleted. NULL for the +default store owned by WasmEdge_VMContext.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_VMDelete.html new file mode 100644 index 000000000..0e63739d8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMDelete.html @@ -0,0 +1,7 @@ +WasmEdge_VMDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMDelete(
+    Cxt: *mut WasmEdge_VMContext
+)
Expand description

Deletion of the WasmEdge_VMContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_VMContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMExecute.html b/wasmedge_sys/ffi/fn.WasmEdge_VMExecute.html new file mode 100644 index 000000000..01b1bc21c --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMExecute.html @@ -0,0 +1,27 @@ +WasmEdge_VMExecute in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMExecute(
+    Cxt: *mut WasmEdge_VMContext,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32,
+    Returns: *mut WasmEdge_Value,
+    ReturnLen: u32
+) -> WasmEdge_Result
Expand description

Invoke a WASM function by name.

+

This is the final step to invoke a WASM function step by step. +After instantiating a WASM module in the VM context, the WASM module is +registered into the store in the VM context as an anonymous module. Then you +can repeatedly call this function to invoke the exported WASM functions by +their names until the VM context is reset or a new WASM module is registered +or loaded. For calling the functions in registered WASM modules with module +names, please use WasmEdge_VMExecuteRegistered instead. If the Returns +buffer length is smaller than the arity of the function, the overflowed +return values will be discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length. +\param [out] Returns the WasmEdge_Value buffer to fill the return values. +\param ReturnLen the return buffer length.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMExecuteRegistered.html b/wasmedge_sys/ffi/fn.WasmEdge_VMExecuteRegistered.html new file mode 100644 index 000000000..43022b614 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMExecuteRegistered.html @@ -0,0 +1,25 @@ +WasmEdge_VMExecuteRegistered in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMExecuteRegistered(
+    Cxt: *mut WasmEdge_VMContext,
+    ModuleName: WasmEdge_String,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32,
+    Returns: *mut WasmEdge_Value,
+    ReturnLen: u32
+) -> WasmEdge_Result
Expand description

Invoke a WASM function by its module name and function name.

+

After registering a WASM module in the VM context, you can repeatedly call +this function to invoke exported WASM functions by their module names and +function names until the VM context is reset. If the Returns buffer length +is smaller than the arity of the function, the overflowed return values will +be discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param ModuleName the module name WasmEdge_String. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length. +\param [out] Returns the WasmEdge_Value buffer to fill the return values. +\param ReturnLen the return buffer length.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetActiveModule.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetActiveModule.html new file mode 100644 index 000000000..288cb37d8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetActiveModule.html @@ -0,0 +1,11 @@ +WasmEdge_VMGetActiveModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetActiveModule(
+    Cxt: *const WasmEdge_VMContext
+) -> *const WasmEdge_ModuleInstanceContext
Expand description

Get the current instantiated module in VM.

+

After instantiating a module instance into the VM, developers can call this +API to get the module instance to retrieve the exported instances. The +module instance context links to the context owned by the VM context. The +caller should NOT call the WasmEdge_ModuleInstanceDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns pointer to the module instance context. NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetExecutorContext.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetExecutorContext.html new file mode 100644 index 000000000..9c46b62dd --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetExecutorContext.html @@ -0,0 +1,10 @@ +WasmEdge_VMGetExecutorContext in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetExecutorContext(
+    Cxt: *mut WasmEdge_VMContext
+) -> *mut WasmEdge_ExecutorContext
Expand description

Get the executor context used in the WasmEdge_VMContext.

+

The returned executor context links to the executor in the VM context and +owned by the VM context. This function will return NULL if error occurs. The +caller should NOT call the WasmEdge_ExecutorDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns pointer to the executor context.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionList.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionList.html new file mode 100644 index 000000000..44591852b --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionList.html @@ -0,0 +1,25 @@ +WasmEdge_VMGetFunctionList in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetFunctionList(
+    Cxt: *const WasmEdge_VMContext,
+    Names: *mut WasmEdge_String,
+    FuncTypes: *mut *const WasmEdge_FunctionTypeContext,
+    Len: u32
+) -> u32
Expand description

Get the exported function list.

+

The returned function names filled into the Names array link to the +exported names of functions owned by the vm context, and the caller should +NOT call the WasmEdge_StringDelete to destroy them. +The function type contexts filled into the FuncTypes array of the +corresponding function names link to the context owned by the VM context. +The caller should NOT call the WasmEdge_FunctionTypeDelete to destroy +them. +If the Names and FuncTypes buffer lengths are smaller than the result of +the exported function list size, the overflowed return values will be +discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param [out] Names the output names WasmEdge_String buffer of exported +functions. Can be NULL if names are not needed. +\param [out] FuncTypes the function type contexts buffer. Can be NULL if +function types are not needed. +\param Len the buffer length.

+

\returns actual exported function list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionListLength.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionListLength.html new file mode 100644 index 000000000..45ab0f788 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionListLength.html @@ -0,0 +1,7 @@ +WasmEdge_VMGetFunctionListLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetFunctionListLength(
+    Cxt: *const WasmEdge_VMContext
+) -> u32
Expand description

Get the length of exported function list.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns length of exported function list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionType.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionType.html new file mode 100644 index 000000000..fd8e8227f --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionType.html @@ -0,0 +1,19 @@ +WasmEdge_VMGetFunctionType in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetFunctionType(
+    Cxt: *const WasmEdge_VMContext,
+    FuncName: WasmEdge_String
+) -> *const WasmEdge_FunctionTypeContext
Expand description

Get the function type by function name.

+

After instantiating a WASM module in the VM context, the WASM module is +registered into the store in the VM context as an anonymous module. Then you +can call this function to get the function type by the exported function +name until the VM context is reset or a new WASM module is registered or +loaded. For getting the function type of functions in registered WASM +modules with module names, please use WasmEdge_VMGetFunctionTypeRegistered +instead. +The returned function type context are linked to the context owned by the VM +context, and the caller should NOT call the +WasmEdge_FunctionTypeDelete to destroy it.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param FuncName the function name WasmEdge_String.

+

\returns the function type. NULL if the function not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionTypeRegistered.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionTypeRegistered.html new file mode 100644 index 000000000..b8960a8fa --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetFunctionTypeRegistered.html @@ -0,0 +1,17 @@ +WasmEdge_VMGetFunctionTypeRegistered in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetFunctionTypeRegistered(
+    Cxt: *const WasmEdge_VMContext,
+    ModuleName: WasmEdge_String,
+    FuncName: WasmEdge_String
+) -> *const WasmEdge_FunctionTypeContext
Expand description

Get the function type by function name.

+

After registering a WASM module in the VM context, you can call this +function to get the function type by the functions’ exported module names +and function names until the VM context is reset. +The returned function type context are linked to the context owned by the VM +context, and the caller should NOT call the +WasmEdge_FunctionTypeDelete to destroy it.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param ModuleName the module name WasmEdge_String. +\param FuncName the function name WasmEdge_String.

+

\returns the function type. NULL if the function not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetImportModuleContext.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetImportModuleContext.html new file mode 100644 index 000000000..147f01fae --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetImportModuleContext.html @@ -0,0 +1,22 @@ +WasmEdge_VMGetImportModuleContext in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetImportModuleContext(
+    Cxt: *const WasmEdge_VMContext,
+    Reg: WasmEdge_HostRegistration
+) -> *mut WasmEdge_ModuleInstanceContext
Expand description

Get the module instance corresponding to the WasmEdge_HostRegistration +settings.

+

When creating the VM context with a configuration, the built-in host module +will be registered according to the WasmEdge_HostRegistration settings +added into the WasmEdge_ConfigureContext. You can call this function to +get the WasmEdge_ModuleInstanceContext corresponding to the settings. The +module instance context links to the context owned by the VM context. The +caller should NOT call the WasmEdge_ModuleInstanceDelete.

+
WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();
+WasmEdge_ConfigureAddHostRegistration(Conf, WasmEdge_HostRegistration_Wasi);
+WasmEdge_VMContext *VM = WasmEdge_VMCreate(Conf, NULL);
+WasmEdge_ModuleInstanceContext *WasiMod =
+    WasmEdge_VMGetImportModuleContext(VM, WasmEdge_HostRegistration_Wasi);
+
+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param Reg the host registration value to get the import module.

+

\returns pointer to the module instance context. NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetLoaderContext.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetLoaderContext.html new file mode 100644 index 000000000..f02a9e260 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetLoaderContext.html @@ -0,0 +1,10 @@ +WasmEdge_VMGetLoaderContext in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetLoaderContext(
+    Cxt: *mut WasmEdge_VMContext
+) -> *mut WasmEdge_LoaderContext
Expand description

Get the loader context used in the WasmEdge_VMContext.

+

The returned loader context links to the loader in the VM context and owned +by the VM context. This function will return NULL if error occurs. The +caller should NOT call the WasmEdge_LoaderDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns pointer to the loader context.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetRegisteredModule.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetRegisteredModule.html new file mode 100644 index 000000000..00ade4415 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetRegisteredModule.html @@ -0,0 +1,14 @@ +WasmEdge_VMGetRegisteredModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetRegisteredModule(
+    Cxt: *const WasmEdge_VMContext,
+    ModuleName: WasmEdge_String
+) -> *const WasmEdge_ModuleInstanceContext
Expand description

Get the registered module in VM by the module name.

+

After registering a WASM module into the VM context, developers can call +this function to get the module instance by the module name. The returned +module instance context links to the context owned by the VM context, and +the caller should NOT call the WasmEdge_ModuleInstanceDelete to +destroy it.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param ModuleName the module name WasmEdge_String.

+

\returns pointer to the module instance context. NULL if not found.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetStatisticsContext.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetStatisticsContext.html new file mode 100644 index 000000000..cf6f2e3af --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetStatisticsContext.html @@ -0,0 +1,10 @@ +WasmEdge_VMGetStatisticsContext in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetStatisticsContext(
+    Cxt: *mut WasmEdge_VMContext
+) -> *mut WasmEdge_StatisticsContext
Expand description

Get the statistics context used in the WasmEdge_VMContext.

+

The statistics context links to the statistics in the VM context and owned +by the VM context. The caller should NOT call the +WasmEdge_StatisticsDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns pointer to the statistics context.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetStoreContext.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetStoreContext.html new file mode 100644 index 000000000..b8ccab6d3 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetStoreContext.html @@ -0,0 +1,10 @@ +WasmEdge_VMGetStoreContext in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetStoreContext(
+    Cxt: *mut WasmEdge_VMContext
+) -> *mut WasmEdge_StoreContext
Expand description

Get the store context used in the WasmEdge_VMContext.

+

The returned store context links to the store in the VM context and owned by +the VM context. This function will return NULL if error occurs. The caller +should NOT call the WasmEdge_StoreDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns pointer to the store context.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMGetValidatorContext.html b/wasmedge_sys/ffi/fn.WasmEdge_VMGetValidatorContext.html new file mode 100644 index 000000000..27ae04798 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMGetValidatorContext.html @@ -0,0 +1,10 @@ +WasmEdge_VMGetValidatorContext in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMGetValidatorContext(
+    Cxt: *mut WasmEdge_VMContext
+) -> *mut WasmEdge_ValidatorContext
Expand description

Get the validator context used in the WasmEdge_VMContext.

+

The returned validator context links to the validator in the VM context and +owned by the VM context. This function will return NULL if error occurs. The +caller should NOT call the WasmEdge_ValidatorDelete.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns pointer to the validator context.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMInstantiate.html b/wasmedge_sys/ffi/fn.WasmEdge_VMInstantiate.html new file mode 100644 index 000000000..9563df521 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMInstantiate.html @@ -0,0 +1,14 @@ +WasmEdge_VMInstantiate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMInstantiate(
+    Cxt: *mut WasmEdge_VMContext
+) -> WasmEdge_Result
Expand description

Instantiate the validated WASM module in the VM context.

+

This is the third step to invoke a WASM function step by step. +After validating a WASM module in the VM context, You can call this function +to instantiate it. And you can then call WasmEdge_VMExecute for invoking +the exported function in this WASM module. +After calling this function, a new module instance is instantiated, and the +old one will be destroyed.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMListRegisteredModule.html b/wasmedge_sys/ffi/fn.WasmEdge_VMListRegisteredModule.html new file mode 100644 index 000000000..e3760ddc9 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMListRegisteredModule.html @@ -0,0 +1,18 @@ +WasmEdge_VMListRegisteredModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMListRegisteredModule(
+    Cxt: *const WasmEdge_VMContext,
+    Names: *mut WasmEdge_String,
+    Len: u32
+) -> u32
Expand description

List the registered module names in the WasmEdge_VMContext.

+

This function will list all registered module names. +The returned module names filled into the Names array are linked to the +registered module names in the VM context, and the caller should NOT +call the WasmEdge_StringDelete. +If the Names buffer length is smaller than the result of the registered +named module list size, the overflowed return values will be discarded.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param [out] Names the output names WasmEdge_String buffer of the registered +modules. +\param Len the buffer length.

+

\returns actual registered module list size.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMListRegisteredModuleLength.html b/wasmedge_sys/ffi/fn.WasmEdge_VMListRegisteredModuleLength.html new file mode 100644 index 000000000..6841d7f42 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMListRegisteredModuleLength.html @@ -0,0 +1,7 @@ +WasmEdge_VMListRegisteredModuleLength in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMListRegisteredModuleLength(
+    Cxt: *const WasmEdge_VMContext
+) -> u32
Expand description

Get the length of registered module list in the WasmEdge_VMContext.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns length of registered module list.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromASTModule.html b/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromASTModule.html new file mode 100644 index 000000000..9bdd4e5f0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromASTModule.html @@ -0,0 +1,15 @@ +WasmEdge_VMLoadWasmFromASTModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMLoadWasmFromASTModule(
+    Cxt: *mut WasmEdge_VMContext,
+    ASTCxt: *const WasmEdge_ASTModuleContext
+) -> WasmEdge_Result
Expand description

Load the WASM module from loaded WasmEdge AST Module.

+

This is the first step to invoke a WASM function step by step. +Copy the loaded WasmEdge AST Module context into VM. The VM context has no +dependency on the input AST Module context. You can then call +WasmEdge_VMValidate for the next step.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param ASTCxt the WasmEdge AST Module context generated by loader or +compiler.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromBuffer.html b/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromBuffer.html new file mode 100644 index 000000000..54474f34b --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromBuffer.html @@ -0,0 +1,15 @@ +WasmEdge_VMLoadWasmFromBuffer in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMLoadWasmFromBuffer(
+    Cxt: *mut WasmEdge_VMContext,
+    Buf: *const u8,
+    BufLen: u32
+) -> WasmEdge_Result
Expand description

Load the WASM module from a buffer.

+

This is the first step to invoke a WASM function step by step. +Load and parse the WASM module from a buffer. You can then call +WasmEdge_VMValidate for the next step.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param Buf the buffer of WASM binary. +\param BufLen the length of the buffer.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromFile.html b/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromFile.html new file mode 100644 index 000000000..a906669e9 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMLoadWasmFromFile.html @@ -0,0 +1,13 @@ +WasmEdge_VMLoadWasmFromFile in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMLoadWasmFromFile(
+    Cxt: *mut WasmEdge_VMContext,
+    Path: *const c_char
+) -> WasmEdge_Result
Expand description

Load the WASM module from a WASM file.

+

This is the first step to invoke a WASM function step by step. +Load and parse the WASM module from the file path. You can then call +WasmEdge_VMValidate for the next step.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param Path the NULL-terminated C string of the WASM file path.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromASTModule.html b/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromASTModule.html new file mode 100644 index 000000000..b0c227bc9 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromASTModule.html @@ -0,0 +1,17 @@ +WasmEdge_VMRegisterModuleFromASTModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMRegisterModuleFromASTModule(
+    Cxt: *mut WasmEdge_VMContext,
+    ModuleName: WasmEdge_String,
+    ASTCxt: *const WasmEdge_ASTModuleContext
+) -> WasmEdge_Result
Expand description

Instantiate and register an AST Module into a named module instance in VM.

+

Load from the AST Module, and register all exported instances and +instantiate them into the store in VM with their exported name and module +name.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext which contains the store. +\param ModuleName the WasmEdge_String of module name for all exported +instances. +\param ASTCxt the WasmEdge AST Module context generated by loader or +compiler.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromBuffer.html b/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromBuffer.html new file mode 100644 index 000000000..0954c5d0e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromBuffer.html @@ -0,0 +1,18 @@ +WasmEdge_VMRegisterModuleFromBuffer in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMRegisterModuleFromBuffer(
+    Cxt: *mut WasmEdge_VMContext,
+    ModuleName: WasmEdge_String,
+    Buf: *const u8,
+    BufLen: u32
+) -> WasmEdge_Result
Expand description

Register and instantiate WASM into the store in VM from a buffer.

+

Load a WASM module from a buffer, and register all exported instances and +instantiate them into the store into the VM with their exported name and +module name.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext which contains the store. +\param ModuleName the WasmEdge_String of module name for all exported +instances. +\param Buf the buffer of WASM binary. +\param BufLen the length of the buffer.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromFile.html b/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromFile.html new file mode 100644 index 000000000..99871932f --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromFile.html @@ -0,0 +1,16 @@ +WasmEdge_VMRegisterModuleFromFile in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMRegisterModuleFromFile(
+    Cxt: *mut WasmEdge_VMContext,
+    ModuleName: WasmEdge_String,
+    Path: *const c_char
+) -> WasmEdge_Result
Expand description

Register and instantiate WASM into the store in VM from a WASM file.

+

Load a WASM file from the path, and register all exported instances and +instantiate them into the store into the VM with their exported name and +module name.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext which contains the store. +\param ModuleName the WasmEdge_String of module name for all exported +instances. +\param Path the NULL-terminated C string of the WASM file path.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromImport.html b/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromImport.html new file mode 100644 index 000000000..0f9cbb174 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMRegisterModuleFromImport.html @@ -0,0 +1,21 @@ +WasmEdge_VMRegisterModuleFromImport in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMRegisterModuleFromImport(
+    Cxt: *mut WasmEdge_VMContext,
+    ImportCxt: *const WasmEdge_ModuleInstanceContext
+) -> WasmEdge_Result
Expand description

Register a module instance into the store in VM with exporting its module +name.

+

After calling this function, the existing module instance will be registered +into the store context in this VM, and the other modules can import the +exported instances for linking when instantiation. Developers SHOULD +guarantee the life cycle of this existing module instance, or the error will +occur when in execution after the module instance being destroyed if it has +been imported by other modules. That is, developers should call the +WasmEdge_ModuleInstanceDelete if this existing module instance will not be +used anymore or after the deletion of this VM. When the module instance is +deleted, it will be unregistered to the store context in this VM +automatically.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext which contains the store. +\param ImportCxt the WasmEdge_ModuleInstanceContext to register.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromASTModule.html b/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromASTModule.html new file mode 100644 index 000000000..36ae8e362 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromASTModule.html @@ -0,0 +1,29 @@ +WasmEdge_VMRunWasmFromASTModule in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMRunWasmFromASTModule(
+    Cxt: *mut WasmEdge_VMContext,
+    ASTCxt: *const WasmEdge_ASTModuleContext,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32,
+    Returns: *mut WasmEdge_Value,
+    ReturnLen: u32
+) -> WasmEdge_Result
Expand description

Instantiate the WASM module from a WasmEdge AST Module and invoke a function +by name.

+

This is the function to invoke a WASM function rapidly. +Load and instantiate the WASM module from the WasmEdge AST Module, and then +invoke the function by name and parameters. If the Returns buffer length +is smaller than the arity of the function, the overflowed return values will +be discarded. +After calling this function, a new module instance is instantiated, and the +old one will be destroyed.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param ASTCxt the WasmEdge AST Module context generated by loader or +compiler. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length. +\param [out] Returns the WasmEdge_Value buffer to fill the return values. +\param ReturnLen the return buffer length.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromBuffer.html b/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromBuffer.html new file mode 100644 index 000000000..9b6a59983 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromBuffer.html @@ -0,0 +1,29 @@ +WasmEdge_VMRunWasmFromBuffer in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMRunWasmFromBuffer(
+    Cxt: *mut WasmEdge_VMContext,
+    Buf: *const u8,
+    BufLen: u32,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32,
+    Returns: *mut WasmEdge_Value,
+    ReturnLen: u32
+) -> WasmEdge_Result
Expand description

Instantiate the WASM module from a buffer and invoke a function by name.

+

This is the function to invoke a WASM function rapidly. +Load and instantiate the WASM module from a buffer, and then invoke a +function by name and parameters. If the Returns buffer length is smaller +than the arity of the function, the overflowed return values will be +discarded. +After calling this function, a new module instance is instantiated, and the +old one will be destroyed.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param Buf the buffer of WASM binary. +\param BufLen the length of the buffer. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length. +\param [out] Returns the WasmEdge_Value buffer to fill the return values. +\param ReturnLen the return buffer length.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromFile.html b/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromFile.html new file mode 100644 index 000000000..bb0cadcc2 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMRunWasmFromFile.html @@ -0,0 +1,27 @@ +WasmEdge_VMRunWasmFromFile in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMRunWasmFromFile(
+    Cxt: *mut WasmEdge_VMContext,
+    Path: *const c_char,
+    FuncName: WasmEdge_String,
+    Params: *const WasmEdge_Value,
+    ParamLen: u32,
+    Returns: *mut WasmEdge_Value,
+    ReturnLen: u32
+) -> WasmEdge_Result
Expand description

Instantiate the WASM module from a WASM file and invoke a function by name.

+

This is the function to invoke a WASM function rapidly. +Load and instantiate the WASM module from the file path, and then invoke a +function by name and parameters. If the Returns buffer length is smaller +than the arity of the function, the overflowed return values will be +discarded. +After calling this function, a new module instance is instantiated, and the +old one will be destroyed.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext. +\param Path the NULL-terminated C string of the WASM file path. +\param FuncName the function name WasmEdge_String. +\param Params the WasmEdge_Value buffer with the parameter values. +\param ParamLen the parameter buffer length. +\param [out] Returns the WasmEdge_Value buffer to fill the return values. +\param ReturnLen the return buffer length.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VMValidate.html b/wasmedge_sys/ffi/fn.WasmEdge_VMValidate.html new file mode 100644 index 000000000..1cae93a5f --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VMValidate.html @@ -0,0 +1,13 @@ +WasmEdge_VMValidate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VMValidate(
+    Cxt: *mut WasmEdge_VMContext
+) -> WasmEdge_Result
Expand description

Validate the WASM module loaded into the VM context.

+

This is the second step to invoke a WASM function step by step. +After loading a WASM module into VM context, You can call this function to +validate it. And you can then call WasmEdge_VMInstantiate for the next +step. Note that only validated WASM modules can be instantiated in the VM +context.

+

This function is thread-safe.

+

\param Cxt the WasmEdge_VMContext.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValidatorCreate.html b/wasmedge_sys/ffi/fn.WasmEdge_ValidatorCreate.html new file mode 100644 index 000000000..1309385c6 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValidatorCreate.html @@ -0,0 +1,9 @@ +WasmEdge_ValidatorCreate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValidatorCreate(
+    ConfCxt: *const WasmEdge_ConfigureContext
+) -> *mut WasmEdge_ValidatorContext
Expand description

Creation of the WasmEdge_ValidatorContext.

+

The caller owns the object and should call WasmEdge_ValidatorDelete to +destroy it.

+

\param ConfCxt the WasmEdge_ConfigureContext as the configuration of +Validator. NULL for the default configuration.

+

\returns pointer to context, NULL if failed.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValidatorDelete.html b/wasmedge_sys/ffi/fn.WasmEdge_ValidatorDelete.html new file mode 100644 index 000000000..a10fc0aff --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValidatorDelete.html @@ -0,0 +1,7 @@ +WasmEdge_ValidatorDelete in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValidatorDelete(
+    Cxt: *mut WasmEdge_ValidatorContext
+)
Expand description

Deletion of the WasmEdge_ValidatorContext.

+

After calling this function, the context will be destroyed and should +NOT be used.

+

\param Cxt the WasmEdge_ValidatorContext to destroy.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValidatorValidate.html b/wasmedge_sys/ffi/fn.WasmEdge_ValidatorValidate.html new file mode 100644 index 000000000..8367dff12 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValidatorValidate.html @@ -0,0 +1,9 @@ +WasmEdge_ValidatorValidate in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValidatorValidate(
+    Cxt: *mut WasmEdge_ValidatorContext,
+    ASTCxt: *const WasmEdge_ASTModuleContext
+) -> WasmEdge_Result
Expand description

Validate the WasmEdge AST Module.

+

\param Cxt the WasmEdge_ValidatorContext. +\param ASTCxt the WasmEdge_ASTModuleContext to validate.

+

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error +message.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGenExternRef.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenExternRef.html new file mode 100644 index 000000000..502c4ef64 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenExternRef.html @@ -0,0 +1,8 @@ +WasmEdge_ValueGenExternRef in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGenExternRef(
+    Ref: *mut c_void
+) -> WasmEdge_Value
Expand description

Generate the function reference WASM value.

+

The values generated by this function are only meaningful when the +WasmEdge_Proposal_ReferenceTypes turns on in configuration.

+

\param Ref the reference to the external object.

+

\returns WasmEdge_Value struct with the external reference.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGenF32.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenF32.html new file mode 100644 index 000000000..bf16e01eb --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenF32.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGenF32 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGenF32(
+    Val: f32
+) -> WasmEdge_Value
Expand description

Generate the F32 WASM value.

+

\param Val the F32 value.

+

\returns WasmEdge_Value struct with the F32 value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGenF64.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenF64.html new file mode 100644 index 000000000..a60d0c82a --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenF64.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGenF64 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGenF64(
+    Val: f64
+) -> WasmEdge_Value
Expand description

Generate the F64 WASM value.

+

\param Val the F64 value.

+

\returns WasmEdge_Value struct with the F64 value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGenFuncRef.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenFuncRef.html new file mode 100644 index 000000000..2ddfe7525 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenFuncRef.html @@ -0,0 +1,9 @@ +WasmEdge_ValueGenFuncRef in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGenFuncRef(
+    Cxt: *const WasmEdge_FunctionInstanceContext
+) -> WasmEdge_Value
Expand description

Generate the function reference WASM value.

+

The values generated by this function are only meaningful when the +WasmEdge_Proposal_BulkMemoryOperations or the +WasmEdge_Proposal_ReferenceTypes turns on in configuration.

+

\param Cxt the function instance context to convert to the reference.

+

\returns WasmEdge_Value struct with the function reference.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGenI32.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenI32.html new file mode 100644 index 000000000..751bbd6f1 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenI32.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGenI32 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGenI32(
+    Val: i32
+) -> WasmEdge_Value
Expand description

Generate the I32 WASM value.

+

\param Val the I32 value.

+

\returns WasmEdge_Value struct with the I32 value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGenI64.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenI64.html new file mode 100644 index 000000000..ada9d1d08 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenI64.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGenI64 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGenI64(
+    Val: i64
+) -> WasmEdge_Value
Expand description

Generate the I64 WASM value.

+

\param Val the I64 value.

+

\returns WasmEdge_Value struct with the I64 value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGenNullRef.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenNullRef.html new file mode 100644 index 000000000..01e5fec3e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenNullRef.html @@ -0,0 +1,9 @@ +WasmEdge_ValueGenNullRef in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGenNullRef(
+    T: WasmEdge_RefType
+) -> WasmEdge_Value
Expand description

Generate the NULL reference WASM value.

+

The values generated by this function are only meaningful when the +WasmEdge_Proposal_BulkMemoryOperations or the +WasmEdge_Proposal_ReferenceTypes turns on in configuration.

+

\param T the reference type.

+

\returns WasmEdge_Value struct with the NULL reference.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGenV128.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenV128.html new file mode 100644 index 000000000..a9786d2f8 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGenV128.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGenV128 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGenV128(
+    Val: int128_t
+) -> WasmEdge_Value
Expand description

Generate the V128 WASM value.

+

\param Val the V128 value.

+

\returns WasmEdge_Value struct with the V128 value.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGetExternRef.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetExternRef.html new file mode 100644 index 000000000..18c1d8d16 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetExternRef.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGetExternRef in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGetExternRef(
+    Val: WasmEdge_Value
+) -> *mut c_void
Expand description

Retrieve the external reference from the WASM value.

+

\param Val the WasmEdge_Value struct.

+

\returns external reference in the input struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGetF32.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetF32.html new file mode 100644 index 000000000..e819d772e --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetF32.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGetF32 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGetF32(
+    Val: WasmEdge_Value
+) -> f32
Expand description

Retrieve the F32 value from the WASM value.

+

\param Val the WasmEdge_Value struct.

+

\returns F32 value in the input struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGetF64.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetF64.html new file mode 100644 index 000000000..092f2dd9a --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetF64.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGetF64 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGetF64(
+    Val: WasmEdge_Value
+) -> f64
Expand description

Retrieve the F64 value from the WASM value.

+

\param Val the WasmEdge_Value struct.

+

\returns F64 value in the input struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGetFuncRef.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetFuncRef.html new file mode 100644 index 000000000..b35774e30 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetFuncRef.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGetFuncRef in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGetFuncRef(
+    Val: WasmEdge_Value
+) -> *const WasmEdge_FunctionInstanceContext
Expand description

Retrieve the function instance context from the WASM value.

+

\param Val the WasmEdge_Value struct.

+

\returns pointer to function instance context in the input struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGetI32.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetI32.html new file mode 100644 index 000000000..05806e6b5 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetI32.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGetI32 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGetI32(
+    Val: WasmEdge_Value
+) -> i32
Expand description

Retrieve the I32 value from the WASM value.

+

\param Val the WasmEdge_Value struct.

+

\returns I32 value in the input struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGetI64.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetI64.html new file mode 100644 index 000000000..1e029a8b5 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetI64.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGetI64 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGetI64(
+    Val: WasmEdge_Value
+) -> i64
Expand description

Retrieve the I64 value from the WASM value.

+

\param Val the WasmEdge_Value struct.

+

\returns I64 value in the input struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueGetV128.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetV128.html new file mode 100644 index 000000000..fb1769af0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueGetV128.html @@ -0,0 +1,6 @@ +WasmEdge_ValueGetV128 in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueGetV128(
+    Val: WasmEdge_Value
+) -> int128_t
Expand description

Retrieve the V128 value from the WASM value.

+

\param Val the WasmEdge_Value struct.

+

\returns V128 value in the input struct.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_ValueIsNullRef.html b/wasmedge_sys/ffi/fn.WasmEdge_ValueIsNullRef.html new file mode 100644 index 000000000..45d440e86 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_ValueIsNullRef.html @@ -0,0 +1,6 @@ +WasmEdge_ValueIsNullRef in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_ValueIsNullRef(
+    Val: WasmEdge_Value
+) -> bool
Expand description

Specify the WASM value is a null reference or not.

+

\param Val the WasmEdge_Value struct.

+

\returns true if the value is a null reference, false if not.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VersionGet.html b/wasmedge_sys/ffi/fn.WasmEdge_VersionGet.html new file mode 100644 index 000000000..b19ca29e0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VersionGet.html @@ -0,0 +1,4 @@ +WasmEdge_VersionGet in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VersionGet() -> *const c_char
Expand description

Get the version string of the WasmEdge C API.

+

The returned string must NOT be destroyed.

+

\returns NULL-terminated C string of version.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VersionGetMajor.html b/wasmedge_sys/ffi/fn.WasmEdge_VersionGetMajor.html new file mode 100644 index 000000000..f081379e0 --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VersionGetMajor.html @@ -0,0 +1,3 @@ +WasmEdge_VersionGetMajor in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VersionGetMajor() -> u32
Expand description

Get the major version value of the WasmEdge C API.

+

\returns Value of the major version.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VersionGetMinor.html b/wasmedge_sys/ffi/fn.WasmEdge_VersionGetMinor.html new file mode 100644 index 000000000..6558e2b0f --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VersionGetMinor.html @@ -0,0 +1,3 @@ +WasmEdge_VersionGetMinor in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VersionGetMinor() -> u32
Expand description

Get the minor version value of the WasmEdge C API.

+

\returns Value of the minor version.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/fn.WasmEdge_VersionGetPatch.html b/wasmedge_sys/ffi/fn.WasmEdge_VersionGetPatch.html new file mode 100644 index 000000000..ac43ca81c --- /dev/null +++ b/wasmedge_sys/ffi/fn.WasmEdge_VersionGetPatch.html @@ -0,0 +1,3 @@ +WasmEdge_VersionGetPatch in wasmedge_sys::ffi - Rust
pub unsafe extern "C" fn WasmEdge_VersionGetPatch() -> u32
Expand description

Get the patch version value of the WasmEdge C API.

+

\returns Value of the patch version.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/index.html b/wasmedge_sys/ffi/index.html new file mode 100644 index 000000000..d39a010fa --- /dev/null +++ b/wasmedge_sys/ffi/index.html @@ -0,0 +1,15 @@ +wasmedge_sys::ffi - Rust

Module wasmedge_sys::ffi

source ·
Expand description

Foreign function interfaces generated from WasmEdge C-API.

+

Structs

Constants

Functions

Type Aliases

\ No newline at end of file diff --git a/wasmedge_sys/ffi/sidebar-items.js b/wasmedge_sys/ffi/sidebar-items.js new file mode 100644 index 000000000..69c2a67bd --- /dev/null +++ b/wasmedge_sys/ffi/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["INT16_MAX","INT16_MIN","INT32_MAX","INT32_MIN","INT8_MAX","INT8_MIN","INTPTR_MAX","INTPTR_MIN","INT_FAST16_MAX","INT_FAST16_MIN","INT_FAST32_MAX","INT_FAST32_MIN","INT_FAST8_MAX","INT_FAST8_MIN","INT_LEAST16_MAX","INT_LEAST16_MIN","INT_LEAST32_MAX","INT_LEAST32_MIN","INT_LEAST8_MAX","INT_LEAST8_MIN","PTRDIFF_MAX","PTRDIFF_MIN","SIG_ATOMIC_MAX","SIG_ATOMIC_MIN","SIZE_MAX","UINT16_MAX","UINT32_MAX","UINT8_MAX","UINTPTR_MAX","UINT_FAST16_MAX","UINT_FAST32_MAX","UINT_FAST8_MAX","UINT_LEAST16_MAX","UINT_LEAST32_MAX","UINT_LEAST8_MAX","WASMEDGE_VERSION","WASMEDGE_VERSION_MAJOR","WASMEDGE_VERSION_MINOR","WASMEDGE_VERSION_PATCH","WINT_MAX","WINT_MIN","WasmEdge_CompilerOptimizationLevel_O0","WasmEdge_CompilerOptimizationLevel_O1","WasmEdge_CompilerOptimizationLevel_O2","WasmEdge_CompilerOptimizationLevel_O3","WasmEdge_CompilerOptimizationLevel_Os","WasmEdge_CompilerOptimizationLevel_Oz","WasmEdge_CompilerOutputFormat_Native","WasmEdge_CompilerOutputFormat_Wasm","WasmEdge_ErrCategory_UserLevelError","WasmEdge_ErrCategory_WASM","WasmEdge_ErrCode_AOTDisabled","WasmEdge_ErrCode_ConstExprRequired","WasmEdge_ErrCode_CostLimitExceeded","WasmEdge_ErrCode_DataCountRequired","WasmEdge_ErrCode_DataSegDoesNotFit","WasmEdge_ErrCode_DivideByZero","WasmEdge_ErrCode_DupExportName","WasmEdge_ErrCode_ENDCodeExpected","WasmEdge_ErrCode_ElemSegDoesNotFit","WasmEdge_ErrCode_ExpectSharedMemory","WasmEdge_ErrCode_ExpectedZeroByte","WasmEdge_ErrCode_FuncNotFound","WasmEdge_ErrCode_FuncSigMismatch","WasmEdge_ErrCode_HostFuncError","WasmEdge_ErrCode_IllegalGrammar","WasmEdge_ErrCode_IllegalOpCode","WasmEdge_ErrCode_IllegalPath","WasmEdge_ErrCode_ImmutableGlobal","WasmEdge_ErrCode_IncompatibleDataCount","WasmEdge_ErrCode_IncompatibleFuncCode","WasmEdge_ErrCode_IncompatibleImportType","WasmEdge_ErrCode_IndirectCallTypeMismatch","WasmEdge_ErrCode_InstrTypeMismatch","WasmEdge_ErrCode_IntegerOverflow","WasmEdge_ErrCode_IntegerTooLarge","WasmEdge_ErrCode_IntegerTooLong","WasmEdge_ErrCode_Interrupted","WasmEdge_ErrCode_IntrinsicsTableNotFound","WasmEdge_ErrCode_InvalidAlignment","WasmEdge_ErrCode_InvalidConvToInt","WasmEdge_ErrCode_InvalidDataIdx","WasmEdge_ErrCode_InvalidElemIdx","WasmEdge_ErrCode_InvalidFuncIdx","WasmEdge_ErrCode_InvalidFuncTypeIdx","WasmEdge_ErrCode_InvalidGlobalIdx","WasmEdge_ErrCode_InvalidLabelIdx","WasmEdge_ErrCode_InvalidLaneIdx","WasmEdge_ErrCode_InvalidLimit","WasmEdge_ErrCode_InvalidLocalIdx","WasmEdge_ErrCode_InvalidMemPages","WasmEdge_ErrCode_InvalidMemoryIdx","WasmEdge_ErrCode_InvalidMut","WasmEdge_ErrCode_InvalidRefIdx","WasmEdge_ErrCode_InvalidResultArity","WasmEdge_ErrCode_InvalidStartFunc","WasmEdge_ErrCode_InvalidTableIdx","WasmEdge_ErrCode_JunkSection","WasmEdge_ErrCode_LengthOutOfBounds","WasmEdge_ErrCode_MalformedElemType","WasmEdge_ErrCode_MalformedExportKind","WasmEdge_ErrCode_MalformedImportKind","WasmEdge_ErrCode_MalformedMagic","WasmEdge_ErrCode_MalformedRefType","WasmEdge_ErrCode_MalformedSection","WasmEdge_ErrCode_MalformedUTF8","WasmEdge_ErrCode_MalformedValType","WasmEdge_ErrCode_MalformedVersion","WasmEdge_ErrCode_MemoryOutOfBounds","WasmEdge_ErrCode_ModuleNameConflict","WasmEdge_ErrCode_MultiMemories","WasmEdge_ErrCode_MultiTables","WasmEdge_ErrCode_NotValidated","WasmEdge_ErrCode_ReadError","WasmEdge_ErrCode_RefTypeMismatch","WasmEdge_ErrCode_RuntimeError","WasmEdge_ErrCode_SectionSizeMismatch","WasmEdge_ErrCode_SharedMemoryNoMax","WasmEdge_ErrCode_Success","WasmEdge_ErrCode_TableOutOfBounds","WasmEdge_ErrCode_Terminated","WasmEdge_ErrCode_TooManyLocals","WasmEdge_ErrCode_TypeCheckFailed","WasmEdge_ErrCode_UnalignedAtomicAccess","WasmEdge_ErrCode_UndefinedElement","WasmEdge_ErrCode_UnexpectedEnd","WasmEdge_ErrCode_UninitializedElement","WasmEdge_ErrCode_UnknownImport","WasmEdge_ErrCode_Unreachable","WasmEdge_ErrCode_UserDefError","WasmEdge_ErrCode_WrongInstanceAddress","WasmEdge_ErrCode_WrongInstanceIndex","WasmEdge_ErrCode_WrongVMWorkflow","WasmEdge_ExternalType_Function","WasmEdge_ExternalType_Global","WasmEdge_ExternalType_Memory","WasmEdge_ExternalType_Table","WasmEdge_HostRegistration_Wasi","WasmEdge_Mutability_Const","WasmEdge_Mutability_Var","WasmEdge_NumType_F32","WasmEdge_NumType_F64","WasmEdge_NumType_I32","WasmEdge_NumType_I64","WasmEdge_NumType_V128","WasmEdge_Plugin_CurrentAPIVersion","WasmEdge_ProgramOptionType_Double","WasmEdge_ProgramOptionType_Float","WasmEdge_ProgramOptionType_Int16","WasmEdge_ProgramOptionType_Int32","WasmEdge_ProgramOptionType_Int64","WasmEdge_ProgramOptionType_Int8","WasmEdge_ProgramOptionType_None","WasmEdge_ProgramOptionType_String","WasmEdge_ProgramOptionType_Toggle","WasmEdge_ProgramOptionType_UInt16","WasmEdge_ProgramOptionType_UInt32","WasmEdge_ProgramOptionType_UInt64","WasmEdge_ProgramOptionType_UInt8","WasmEdge_Proposal_Annotations","WasmEdge_Proposal_BulkMemoryOperations","WasmEdge_Proposal_ExceptionHandling","WasmEdge_Proposal_ExtendedConst","WasmEdge_Proposal_FunctionReferences","WasmEdge_Proposal_ImportExportMutGlobals","WasmEdge_Proposal_Memory64","WasmEdge_Proposal_MultiMemories","WasmEdge_Proposal_MultiValue","WasmEdge_Proposal_NonTrapFloatToIntConversions","WasmEdge_Proposal_ReferenceTypes","WasmEdge_Proposal_SIMD","WasmEdge_Proposal_SignExtensionOperators","WasmEdge_Proposal_TailCall","WasmEdge_Proposal_Threads","WasmEdge_RefType_ExternRef","WasmEdge_RefType_FuncRef","WasmEdge_ValType_ExternRef","WasmEdge_ValType_F32","WasmEdge_ValType_F64","WasmEdge_ValType_FuncRef","WasmEdge_ValType_I32","WasmEdge_ValType_I64","WasmEdge_ValType_V128","_ATFILE_SOURCE","_BITS_STDINT_INTN_H","_BITS_STDINT_UINTN_H","_BITS_TIME64_H","_BITS_TYPESIZES_H","_BITS_TYPES_H","_BITS_WCHAR_H","_DEFAULT_SOURCE","_FEATURES_H","_POSIX_C_SOURCE","_POSIX_SOURCE","_STDC_PREDEF_H","_STDINT_H","_SYS_CDEFS_H","__FD_SETSIZE","__GLIBC_MINOR__","__GLIBC_USE_DEPRECATED_GETS","__GLIBC_USE_DEPRECATED_SCANF","__GLIBC_USE_IEC_60559_BFP_EXT","__GLIBC_USE_IEC_60559_BFP_EXT_C2X","__GLIBC_USE_IEC_60559_EXT","__GLIBC_USE_IEC_60559_FUNCS_EXT","__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X","__GLIBC_USE_IEC_60559_TYPES_EXT","__GLIBC_USE_ISOC2X","__GLIBC_USE_LIB_EXT2","__GLIBC__","__GNU_LIBRARY__","__HAVE_GENERIC_SELECTION","__INO_T_MATCHES_INO64_T","__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64","__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI","__OFF_T_MATCHES_OFF64_T","__RLIM_T_MATCHES_RLIM64_T","__STATFS_MATCHES_STATFS64","__STDC_IEC_559_COMPLEX__","__STDC_IEC_559__","__STDC_IEC_60559_BFP__","__STDC_IEC_60559_COMPLEX__","__STDC_ISO_10646__","__SYSCALL_WORDSIZE","__TIMESIZE","__USE_ATFILE","__USE_FORTIFY_LEVEL","__USE_ISOC11","__USE_ISOC95","__USE_ISOC99","__USE_MISC","__USE_POSIX","__USE_POSIX199309","__USE_POSIX199506","__USE_POSIX2","__USE_POSIX_IMPLICITLY","__USE_XOPEN2K","__USE_XOPEN2K8","__WORDSIZE","__WORDSIZE_TIME64_COMPAT32","__bool_true_false_are_defined","__glibc_c99_flexarr_available","false_","true_"],"fn":["WasmEdge_ASTModuleDelete","WasmEdge_ASTModuleListExports","WasmEdge_ASTModuleListExportsLength","WasmEdge_ASTModuleListImports","WasmEdge_ASTModuleListImportsLength","WasmEdge_AsyncCancel","WasmEdge_AsyncDelete","WasmEdge_AsyncGet","WasmEdge_AsyncGetReturnsLength","WasmEdge_AsyncWait","WasmEdge_AsyncWaitFor","WasmEdge_CallingFrameGetExecutor","WasmEdge_CallingFrameGetMemoryInstance","WasmEdge_CallingFrameGetModuleInstance","WasmEdge_CompilerCompile","WasmEdge_CompilerCompileFromBuffer","WasmEdge_CompilerCreate","WasmEdge_CompilerDelete","WasmEdge_ConfigureAddHostRegistration","WasmEdge_ConfigureAddProposal","WasmEdge_ConfigureCompilerGetOptimizationLevel","WasmEdge_ConfigureCompilerGetOutputFormat","WasmEdge_ConfigureCompilerIsDumpIR","WasmEdge_ConfigureCompilerIsGenericBinary","WasmEdge_ConfigureCompilerIsInterruptible","WasmEdge_ConfigureCompilerSetDumpIR","WasmEdge_ConfigureCompilerSetGenericBinary","WasmEdge_ConfigureCompilerSetInterruptible","WasmEdge_ConfigureCompilerSetOptimizationLevel","WasmEdge_ConfigureCompilerSetOutputFormat","WasmEdge_ConfigureCreate","WasmEdge_ConfigureDelete","WasmEdge_ConfigureGetMaxMemoryPage","WasmEdge_ConfigureHasHostRegistration","WasmEdge_ConfigureHasProposal","WasmEdge_ConfigureIsAllowAFUNIX","WasmEdge_ConfigureIsForceInterpreter","WasmEdge_ConfigureRemoveHostRegistration","WasmEdge_ConfigureRemoveProposal","WasmEdge_ConfigureSetAllowAFUNIX","WasmEdge_ConfigureSetForceInterpreter","WasmEdge_ConfigureSetMaxMemoryPage","WasmEdge_ConfigureStatisticsIsCostMeasuring","WasmEdge_ConfigureStatisticsIsInstructionCounting","WasmEdge_ConfigureStatisticsIsTimeMeasuring","WasmEdge_ConfigureStatisticsSetCostMeasuring","WasmEdge_ConfigureStatisticsSetInstructionCounting","WasmEdge_ConfigureStatisticsSetTimeMeasuring","WasmEdge_Driver_Compiler","WasmEdge_Driver_Tool","WasmEdge_Driver_UniTool","WasmEdge_ExecutorAsyncInvoke","WasmEdge_ExecutorCreate","WasmEdge_ExecutorDelete","WasmEdge_ExecutorExperimentalRegisterPostHostFunction","WasmEdge_ExecutorExperimentalRegisterPreHostFunction","WasmEdge_ExecutorInstantiate","WasmEdge_ExecutorInvoke","WasmEdge_ExecutorRegister","WasmEdge_ExecutorRegisterImport","WasmEdge_ExportTypeGetExternalName","WasmEdge_ExportTypeGetExternalType","WasmEdge_ExportTypeGetFunctionType","WasmEdge_ExportTypeGetGlobalType","WasmEdge_ExportTypeGetMemoryType","WasmEdge_ExportTypeGetTableType","WasmEdge_FunctionInstanceCreate","WasmEdge_FunctionInstanceCreateBinding","WasmEdge_FunctionInstanceDelete","WasmEdge_FunctionInstanceGetData","WasmEdge_FunctionInstanceGetFunctionType","WasmEdge_FunctionTypeCreate","WasmEdge_FunctionTypeDelete","WasmEdge_FunctionTypeGetParameters","WasmEdge_FunctionTypeGetParametersLength","WasmEdge_FunctionTypeGetReturns","WasmEdge_FunctionTypeGetReturnsLength","WasmEdge_GlobalInstanceCreate","WasmEdge_GlobalInstanceDelete","WasmEdge_GlobalInstanceGetGlobalType","WasmEdge_GlobalInstanceGetValue","WasmEdge_GlobalInstanceSetValue","WasmEdge_GlobalTypeCreate","WasmEdge_GlobalTypeDelete","WasmEdge_GlobalTypeGetMutability","WasmEdge_GlobalTypeGetValType","WasmEdge_ImportTypeGetExternalName","WasmEdge_ImportTypeGetExternalType","WasmEdge_ImportTypeGetFunctionType","WasmEdge_ImportTypeGetGlobalType","WasmEdge_ImportTypeGetMemoryType","WasmEdge_ImportTypeGetModuleName","WasmEdge_ImportTypeGetTableType","WasmEdge_LimitIsEqual","WasmEdge_LoaderCreate","WasmEdge_LoaderDelete","WasmEdge_LoaderParseFromBuffer","WasmEdge_LoaderParseFromFile","WasmEdge_LogOff","WasmEdge_LogSetDebugLevel","WasmEdge_LogSetErrorLevel","WasmEdge_MemoryInstanceCreate","WasmEdge_MemoryInstanceDelete","WasmEdge_MemoryInstanceGetData","WasmEdge_MemoryInstanceGetMemoryType","WasmEdge_MemoryInstanceGetPageSize","WasmEdge_MemoryInstanceGetPointer","WasmEdge_MemoryInstanceGetPointerConst","WasmEdge_MemoryInstanceGrowPage","WasmEdge_MemoryInstanceSetData","WasmEdge_MemoryTypeCreate","WasmEdge_MemoryTypeDelete","WasmEdge_MemoryTypeGetLimit","WasmEdge_ModuleInstanceAddFunction","WasmEdge_ModuleInstanceAddGlobal","WasmEdge_ModuleInstanceAddMemory","WasmEdge_ModuleInstanceAddTable","WasmEdge_ModuleInstanceCreate","WasmEdge_ModuleInstanceCreateWASI","WasmEdge_ModuleInstanceCreateWithData","WasmEdge_ModuleInstanceDelete","WasmEdge_ModuleInstanceFindFunction","WasmEdge_ModuleInstanceFindGlobal","WasmEdge_ModuleInstanceFindMemory","WasmEdge_ModuleInstanceFindTable","WasmEdge_ModuleInstanceGetHostData","WasmEdge_ModuleInstanceGetModuleName","WasmEdge_ModuleInstanceInitWASI","WasmEdge_ModuleInstanceInitWasmEdgeProcess","WasmEdge_ModuleInstanceListFunction","WasmEdge_ModuleInstanceListFunctionLength","WasmEdge_ModuleInstanceListGlobal","WasmEdge_ModuleInstanceListGlobalLength","WasmEdge_ModuleInstanceListMemory","WasmEdge_ModuleInstanceListMemoryLength","WasmEdge_ModuleInstanceListTable","WasmEdge_ModuleInstanceListTableLength","WasmEdge_ModuleInstanceWASIGetExitCode","WasmEdge_ModuleInstanceWASIGetNativeHandler","WasmEdge_PluginCreateModule","WasmEdge_PluginFind","WasmEdge_PluginGetPluginName","WasmEdge_PluginInitWASINN","WasmEdge_PluginListModule","WasmEdge_PluginListModuleLength","WasmEdge_PluginListPlugins","WasmEdge_PluginListPluginsLength","WasmEdge_PluginLoadFromPath","WasmEdge_PluginLoadWithDefaultPaths","WasmEdge_Plugin_GetDescriptor","WasmEdge_ResultGen","WasmEdge_ResultGetCategory","WasmEdge_ResultGetCode","WasmEdge_ResultGetMessage","WasmEdge_ResultOK","WasmEdge_StatisticsClear","WasmEdge_StatisticsCreate","WasmEdge_StatisticsDelete","WasmEdge_StatisticsGetInstrCount","WasmEdge_StatisticsGetInstrPerSecond","WasmEdge_StatisticsGetTotalCost","WasmEdge_StatisticsSetCostLimit","WasmEdge_StatisticsSetCostTable","WasmEdge_StoreCreate","WasmEdge_StoreDelete","WasmEdge_StoreFindModule","WasmEdge_StoreListModule","WasmEdge_StoreListModuleLength","WasmEdge_StringCopy","WasmEdge_StringCreateByBuffer","WasmEdge_StringCreateByCString","WasmEdge_StringDelete","WasmEdge_StringIsEqual","WasmEdge_StringWrap","WasmEdge_TableInstanceCreate","WasmEdge_TableInstanceDelete","WasmEdge_TableInstanceGetData","WasmEdge_TableInstanceGetSize","WasmEdge_TableInstanceGetTableType","WasmEdge_TableInstanceGrow","WasmEdge_TableInstanceSetData","WasmEdge_TableTypeCreate","WasmEdge_TableTypeDelete","WasmEdge_TableTypeGetLimit","WasmEdge_TableTypeGetRefType","WasmEdge_VMAsyncExecute","WasmEdge_VMAsyncExecuteRegistered","WasmEdge_VMAsyncRunWasmFromASTModule","WasmEdge_VMAsyncRunWasmFromBuffer","WasmEdge_VMAsyncRunWasmFromFile","WasmEdge_VMCleanup","WasmEdge_VMCreate","WasmEdge_VMDelete","WasmEdge_VMExecute","WasmEdge_VMExecuteRegistered","WasmEdge_VMGetActiveModule","WasmEdge_VMGetExecutorContext","WasmEdge_VMGetFunctionList","WasmEdge_VMGetFunctionListLength","WasmEdge_VMGetFunctionType","WasmEdge_VMGetFunctionTypeRegistered","WasmEdge_VMGetImportModuleContext","WasmEdge_VMGetLoaderContext","WasmEdge_VMGetRegisteredModule","WasmEdge_VMGetStatisticsContext","WasmEdge_VMGetStoreContext","WasmEdge_VMGetValidatorContext","WasmEdge_VMInstantiate","WasmEdge_VMListRegisteredModule","WasmEdge_VMListRegisteredModuleLength","WasmEdge_VMLoadWasmFromASTModule","WasmEdge_VMLoadWasmFromBuffer","WasmEdge_VMLoadWasmFromFile","WasmEdge_VMRegisterModuleFromASTModule","WasmEdge_VMRegisterModuleFromBuffer","WasmEdge_VMRegisterModuleFromFile","WasmEdge_VMRegisterModuleFromImport","WasmEdge_VMRunWasmFromASTModule","WasmEdge_VMRunWasmFromBuffer","WasmEdge_VMRunWasmFromFile","WasmEdge_VMValidate","WasmEdge_ValidatorCreate","WasmEdge_ValidatorDelete","WasmEdge_ValidatorValidate","WasmEdge_ValueGenExternRef","WasmEdge_ValueGenF32","WasmEdge_ValueGenF64","WasmEdge_ValueGenFuncRef","WasmEdge_ValueGenI32","WasmEdge_ValueGenI64","WasmEdge_ValueGenNullRef","WasmEdge_ValueGenV128","WasmEdge_ValueGetExternRef","WasmEdge_ValueGetF32","WasmEdge_ValueGetF64","WasmEdge_ValueGetFuncRef","WasmEdge_ValueGetI32","WasmEdge_ValueGetI64","WasmEdge_ValueGetV128","WasmEdge_ValueIsNullRef","WasmEdge_VersionGet","WasmEdge_VersionGetMajor","WasmEdge_VersionGetMinor","WasmEdge_VersionGetPatch"],"struct":["WasmEdge_ASTModuleContext","WasmEdge_Async","WasmEdge_CallingFrameContext","WasmEdge_CompilerContext","WasmEdge_ConfigureContext","WasmEdge_ExecutorContext","WasmEdge_ExportTypeContext","WasmEdge_FunctionInstanceContext","WasmEdge_FunctionTypeContext","WasmEdge_GlobalInstanceContext","WasmEdge_GlobalTypeContext","WasmEdge_ImportTypeContext","WasmEdge_Limit","WasmEdge_LoaderContext","WasmEdge_MemoryInstanceContext","WasmEdge_MemoryTypeContext","WasmEdge_ModuleDescriptor","WasmEdge_ModuleInstanceContext","WasmEdge_PluginContext","WasmEdge_PluginDescriptor","WasmEdge_PluginVersionData","WasmEdge_ProgramOption","WasmEdge_Result","WasmEdge_StatisticsContext","WasmEdge_StoreContext","WasmEdge_String","WasmEdge_TableInstanceContext","WasmEdge_TableTypeContext","WasmEdge_VMContext","WasmEdge_ValidatorContext","WasmEdge_Value","__fsid_t"],"type":["WasmEdge_CompilerOptimizationLevel","WasmEdge_CompilerOutputFormat","WasmEdge_ErrCategory","WasmEdge_ErrCode","WasmEdge_ExternalType","WasmEdge_HostFunc_t","WasmEdge_HostRegistration","WasmEdge_Mutability","WasmEdge_NumType","WasmEdge_ProgramOptionType","WasmEdge_Proposal","WasmEdge_RefType","WasmEdge_ValType","WasmEdge_WrapFunc_t","__blkcnt64_t","__blkcnt_t","__blksize_t","__caddr_t","__clock_t","__clockid_t","__daddr_t","__dev_t","__fsblkcnt64_t","__fsblkcnt_t","__fsfilcnt64_t","__fsfilcnt_t","__fsword_t","__gid_t","__id_t","__ino64_t","__ino_t","__int16_t","__int32_t","__int64_t","__int8_t","__int_least16_t","__int_least32_t","__int_least64_t","__int_least8_t","__intmax_t","__intptr_t","__key_t","__loff_t","__mode_t","__nlink_t","__off64_t","__off_t","__pid_t","__quad_t","__rlim64_t","__rlim_t","__sig_atomic_t","__socklen_t","__ssize_t","__suseconds64_t","__suseconds_t","__syscall_slong_t","__syscall_ulong_t","__time_t","__timer_t","__u_char","__u_int","__u_long","__u_quad_t","__u_short","__uid_t","__uint16_t","__uint32_t","__uint64_t","__uint8_t","__uint_least16_t","__uint_least32_t","__uint_least64_t","__uint_least8_t","__uintmax_t","__useconds_t","int128_t","int_fast16_t","int_fast32_t","int_fast64_t","int_fast8_t","int_least16_t","int_least32_t","int_least64_t","int_least8_t","intmax_t","uint128_t","uint_fast16_t","uint_fast32_t","uint_fast64_t","uint_fast8_t","uint_least16_t","uint_least32_t","uint_least64_t","uint_least8_t","uintmax_t"]}; \ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ASTModuleContext.html b/wasmedge_sys/ffi/struct.WasmEdge_ASTModuleContext.html new file mode 100644 index 000000000..9a86c116a --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ASTModuleContext.html @@ -0,0 +1,13 @@ +WasmEdge_ASTModuleContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ASTModuleContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_ASTModuleContext

source§

fn clone(&self) -> WasmEdge_ASTModuleContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ASTModuleContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ASTModuleContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_Async.html b/wasmedge_sys/ffi/struct.WasmEdge_Async.html new file mode 100644 index 000000000..e67db406b --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_Async.html @@ -0,0 +1,13 @@ +WasmEdge_Async in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_Async { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_Async

source§

fn clone(&self) -> WasmEdge_Async

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_Async

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_Async

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_CallingFrameContext.html b/wasmedge_sys/ffi/struct.WasmEdge_CallingFrameContext.html new file mode 100644 index 000000000..51340d87c --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_CallingFrameContext.html @@ -0,0 +1,13 @@ +WasmEdge_CallingFrameContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_CallingFrameContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_CallingFrameContext

source§

fn clone(&self) -> WasmEdge_CallingFrameContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_CallingFrameContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_CallingFrameContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_CompilerContext.html b/wasmedge_sys/ffi/struct.WasmEdge_CompilerContext.html new file mode 100644 index 000000000..df44d9f47 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_CompilerContext.html @@ -0,0 +1,13 @@ +WasmEdge_CompilerContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_CompilerContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_CompilerContext

source§

fn clone(&self) -> WasmEdge_CompilerContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_CompilerContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_CompilerContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ConfigureContext.html b/wasmedge_sys/ffi/struct.WasmEdge_ConfigureContext.html new file mode 100644 index 000000000..5646410b5 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ConfigureContext.html @@ -0,0 +1,13 @@ +WasmEdge_ConfigureContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ConfigureContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_ConfigureContext

source§

fn clone(&self) -> WasmEdge_ConfigureContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ConfigureContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ConfigureContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ExecutorContext.html b/wasmedge_sys/ffi/struct.WasmEdge_ExecutorContext.html new file mode 100644 index 000000000..56135047c --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ExecutorContext.html @@ -0,0 +1,13 @@ +WasmEdge_ExecutorContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ExecutorContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_ExecutorContext

source§

fn clone(&self) -> WasmEdge_ExecutorContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ExecutorContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ExecutorContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ExportTypeContext.html b/wasmedge_sys/ffi/struct.WasmEdge_ExportTypeContext.html new file mode 100644 index 000000000..b721887b3 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ExportTypeContext.html @@ -0,0 +1,13 @@ +WasmEdge_ExportTypeContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ExportTypeContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_ExportTypeContext

source§

fn clone(&self) -> WasmEdge_ExportTypeContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ExportTypeContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ExportTypeContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_FunctionInstanceContext.html b/wasmedge_sys/ffi/struct.WasmEdge_FunctionInstanceContext.html new file mode 100644 index 000000000..98895bfb8 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_FunctionInstanceContext.html @@ -0,0 +1,13 @@ +WasmEdge_FunctionInstanceContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_FunctionInstanceContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_FunctionInstanceContext

source§

fn clone(&self) -> WasmEdge_FunctionInstanceContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_FunctionInstanceContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_FunctionInstanceContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_FunctionTypeContext.html b/wasmedge_sys/ffi/struct.WasmEdge_FunctionTypeContext.html new file mode 100644 index 000000000..491d1679c --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_FunctionTypeContext.html @@ -0,0 +1,13 @@ +WasmEdge_FunctionTypeContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_FunctionTypeContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_FunctionTypeContext

source§

fn clone(&self) -> WasmEdge_FunctionTypeContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_FunctionTypeContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_FunctionTypeContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_GlobalInstanceContext.html b/wasmedge_sys/ffi/struct.WasmEdge_GlobalInstanceContext.html new file mode 100644 index 000000000..fd39f99ba --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_GlobalInstanceContext.html @@ -0,0 +1,13 @@ +WasmEdge_GlobalInstanceContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_GlobalInstanceContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_GlobalInstanceContext

source§

fn clone(&self) -> WasmEdge_GlobalInstanceContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_GlobalInstanceContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_GlobalInstanceContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_GlobalTypeContext.html b/wasmedge_sys/ffi/struct.WasmEdge_GlobalTypeContext.html new file mode 100644 index 000000000..6717dccf9 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_GlobalTypeContext.html @@ -0,0 +1,13 @@ +WasmEdge_GlobalTypeContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_GlobalTypeContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_GlobalTypeContext

source§

fn clone(&self) -> WasmEdge_GlobalTypeContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_GlobalTypeContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_GlobalTypeContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ImportTypeContext.html b/wasmedge_sys/ffi/struct.WasmEdge_ImportTypeContext.html new file mode 100644 index 000000000..53be4aa27 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ImportTypeContext.html @@ -0,0 +1,13 @@ +WasmEdge_ImportTypeContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ImportTypeContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_ImportTypeContext

source§

fn clone(&self) -> WasmEdge_ImportTypeContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ImportTypeContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ImportTypeContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_Limit.html b/wasmedge_sys/ffi/struct.WasmEdge_Limit.html new file mode 100644 index 000000000..53f040983 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_Limit.html @@ -0,0 +1,23 @@ +WasmEdge_Limit in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_Limit { + pub HasMax: bool, + pub Shared: bool, + pub Min: u32, + pub Max: u32, +}
Expand description

Struct of WASM limit.

+

Fields§

§HasMax: bool

Boolean to describe has max value or not.

+
§Shared: bool

Boolean to describe is shared memory or not.

+
§Min: u32

Minimum value.

+
§Max: u32

Maximum value. Will be ignored if the HasMax is false.

+

Trait Implementations§

source§

impl Clone for WasmEdge_Limit

source§

fn clone(&self) -> WasmEdge_Limit

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_Limit

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_Limit

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_LoaderContext.html b/wasmedge_sys/ffi/struct.WasmEdge_LoaderContext.html new file mode 100644 index 000000000..a21034d99 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_LoaderContext.html @@ -0,0 +1,13 @@ +WasmEdge_LoaderContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_LoaderContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_LoaderContext

source§

fn clone(&self) -> WasmEdge_LoaderContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_LoaderContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_LoaderContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_MemoryInstanceContext.html b/wasmedge_sys/ffi/struct.WasmEdge_MemoryInstanceContext.html new file mode 100644 index 000000000..8b96755b6 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_MemoryInstanceContext.html @@ -0,0 +1,13 @@ +WasmEdge_MemoryInstanceContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_MemoryInstanceContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_MemoryInstanceContext

source§

fn clone(&self) -> WasmEdge_MemoryInstanceContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_MemoryInstanceContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_MemoryInstanceContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_MemoryTypeContext.html b/wasmedge_sys/ffi/struct.WasmEdge_MemoryTypeContext.html new file mode 100644 index 000000000..a532b33e5 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_MemoryTypeContext.html @@ -0,0 +1,13 @@ +WasmEdge_MemoryTypeContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_MemoryTypeContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_MemoryTypeContext

source§

fn clone(&self) -> WasmEdge_MemoryTypeContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_MemoryTypeContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_MemoryTypeContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ModuleDescriptor.html b/wasmedge_sys/ffi/struct.WasmEdge_ModuleDescriptor.html new file mode 100644 index 000000000..fde58d7bc --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ModuleDescriptor.html @@ -0,0 +1,18 @@ +WasmEdge_ModuleDescriptor in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ModuleDescriptor { + pub Name: *const c_char, + pub Description: *const c_char, + pub Create: Option<unsafe extern "C" fn(arg1: *const WasmEdge_ModuleDescriptor) -> *mut WasmEdge_ModuleInstanceContext>, +}
Expand description

Module descriptor for plugins.

+

Fields§

§Name: *const c_char§Description: *const c_char§Create: Option<unsafe extern "C" fn(arg1: *const WasmEdge_ModuleDescriptor) -> *mut WasmEdge_ModuleInstanceContext>

Trait Implementations§

source§

impl Clone for WasmEdge_ModuleDescriptor

source§

fn clone(&self) -> WasmEdge_ModuleDescriptor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ModuleDescriptor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ModuleDescriptor

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ModuleInstanceContext.html b/wasmedge_sys/ffi/struct.WasmEdge_ModuleInstanceContext.html new file mode 100644 index 000000000..60846fe62 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ModuleInstanceContext.html @@ -0,0 +1,13 @@ +WasmEdge_ModuleInstanceContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ModuleInstanceContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_ModuleInstanceContext

source§

fn clone(&self) -> WasmEdge_ModuleInstanceContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ModuleInstanceContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ModuleInstanceContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_PluginContext.html b/wasmedge_sys/ffi/struct.WasmEdge_PluginContext.html new file mode 100644 index 000000000..85d1da565 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_PluginContext.html @@ -0,0 +1,13 @@ +WasmEdge_PluginContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_PluginContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_PluginContext

source§

fn clone(&self) -> WasmEdge_PluginContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_PluginContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_PluginContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_PluginDescriptor.html b/wasmedge_sys/ffi/struct.WasmEdge_PluginDescriptor.html new file mode 100644 index 000000000..a112868cd --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_PluginDescriptor.html @@ -0,0 +1,23 @@ +WasmEdge_PluginDescriptor in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_PluginDescriptor { + pub Name: *const c_char, + pub Description: *const c_char, + pub APIVersion: u32, + pub Version: WasmEdge_PluginVersionData, + pub ModuleCount: u32, + pub ProgramOptionCount: u32, + pub ModuleDescriptions: *mut WasmEdge_ModuleDescriptor, + pub ProgramOptions: *mut WasmEdge_ProgramOption, +}
Expand description

Plugin descriptor for plugins.

+

Fields§

§Name: *const c_char§Description: *const c_char§APIVersion: u32§Version: WasmEdge_PluginVersionData§ModuleCount: u32§ProgramOptionCount: u32§ModuleDescriptions: *mut WasmEdge_ModuleDescriptor§ProgramOptions: *mut WasmEdge_ProgramOption

Trait Implementations§

source§

impl Clone for WasmEdge_PluginDescriptor

source§

fn clone(&self) -> WasmEdge_PluginDescriptor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_PluginDescriptor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_PluginDescriptor

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_PluginVersionData.html b/wasmedge_sys/ffi/struct.WasmEdge_PluginVersionData.html new file mode 100644 index 000000000..079eac2a0 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_PluginVersionData.html @@ -0,0 +1,19 @@ +WasmEdge_PluginVersionData in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_PluginVersionData { + pub Major: u32, + pub Minor: u32, + pub Patch: u32, + pub Build: u32, +}
Expand description

Version data for plugins.

+

Fields§

§Major: u32§Minor: u32§Patch: u32§Build: u32

Trait Implementations§

source§

impl Clone for WasmEdge_PluginVersionData

source§

fn clone(&self) -> WasmEdge_PluginVersionData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_PluginVersionData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PluginVersion> for WasmEdge_PluginVersionData

source§

fn from(value: PluginVersion) -> Self

Converts to this type from the input type.
source§

impl Copy for WasmEdge_PluginVersionData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ProgramOption.html b/wasmedge_sys/ffi/struct.WasmEdge_ProgramOption.html new file mode 100644 index 000000000..e68bb4bbc --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ProgramOption.html @@ -0,0 +1,20 @@ +WasmEdge_ProgramOption in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ProgramOption { + pub Name: *const c_char, + pub Description: *const c_char, + pub Type: WasmEdge_ProgramOptionType, + pub Storage: *mut c_void, + pub DefaultValue: *const c_void, +}
Expand description

Program option for plugins.

+

Fields§

§Name: *const c_char§Description: *const c_char§Type: WasmEdge_ProgramOptionType§Storage: *mut c_void§DefaultValue: *const c_void

Trait Implementations§

source§

impl Clone for WasmEdge_ProgramOption

source§

fn clone(&self) -> WasmEdge_ProgramOption

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ProgramOption

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ProgramOption

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_Result.html b/wasmedge_sys/ffi/struct.WasmEdge_Result.html new file mode 100644 index 000000000..079ea2ea7 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_Result.html @@ -0,0 +1,16 @@ +WasmEdge_Result in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_Result { + pub Code: u32, +}
Expand description

WasmEdge result struct.

+

Fields§

§Code: u32

Trait Implementations§

source§

impl Clone for WasmEdge_Result

source§

fn clone(&self) -> WasmEdge_Result

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_Result

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_Result

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_StatisticsContext.html b/wasmedge_sys/ffi/struct.WasmEdge_StatisticsContext.html new file mode 100644 index 000000000..dd7882352 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_StatisticsContext.html @@ -0,0 +1,13 @@ +WasmEdge_StatisticsContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_StatisticsContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_StatisticsContext

source§

fn clone(&self) -> WasmEdge_StatisticsContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_StatisticsContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_StatisticsContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_StoreContext.html b/wasmedge_sys/ffi/struct.WasmEdge_StoreContext.html new file mode 100644 index 000000000..fa64c9c66 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_StoreContext.html @@ -0,0 +1,13 @@ +WasmEdge_StoreContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_StoreContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_StoreContext

source§

fn clone(&self) -> WasmEdge_StoreContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_StoreContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_StoreContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_String.html b/wasmedge_sys/ffi/struct.WasmEdge_String.html new file mode 100644 index 000000000..a08ff1771 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_String.html @@ -0,0 +1,17 @@ +WasmEdge_String in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_String { + pub Length: u32, + pub Buf: *const c_char, +}
Expand description

WasmEdge string struct.

+

Fields§

§Length: u32§Buf: *const c_char

Trait Implementations§

source§

impl Clone for WasmEdge_String

source§

fn clone(&self) -> WasmEdge_String

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_String

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<WasmEdge_String> for String

source§

fn from(s: WasmEdge_String) -> Self

Converts to this type from the input type.
source§

impl Copy for WasmEdge_String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_TableInstanceContext.html b/wasmedge_sys/ffi/struct.WasmEdge_TableInstanceContext.html new file mode 100644 index 000000000..d0a11760d --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_TableInstanceContext.html @@ -0,0 +1,13 @@ +WasmEdge_TableInstanceContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_TableInstanceContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_TableInstanceContext

source§

fn clone(&self) -> WasmEdge_TableInstanceContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_TableInstanceContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_TableInstanceContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_TableTypeContext.html b/wasmedge_sys/ffi/struct.WasmEdge_TableTypeContext.html new file mode 100644 index 000000000..d95446ee8 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_TableTypeContext.html @@ -0,0 +1,13 @@ +WasmEdge_TableTypeContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_TableTypeContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_TableTypeContext

source§

fn clone(&self) -> WasmEdge_TableTypeContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_TableTypeContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_TableTypeContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_VMContext.html b/wasmedge_sys/ffi/struct.WasmEdge_VMContext.html new file mode 100644 index 000000000..da3537884 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_VMContext.html @@ -0,0 +1,13 @@ +WasmEdge_VMContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_VMContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_VMContext

source§

fn clone(&self) -> WasmEdge_VMContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_VMContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_VMContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_ValidatorContext.html b/wasmedge_sys/ffi/struct.WasmEdge_ValidatorContext.html new file mode 100644 index 000000000..9d60a5bd3 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_ValidatorContext.html @@ -0,0 +1,13 @@ +WasmEdge_ValidatorContext in wasmedge_sys::ffi - Rust
#[repr(C)]
pub struct WasmEdge_ValidatorContext { /* private fields */ }

Trait Implementations§

source§

impl Clone for WasmEdge_ValidatorContext

source§

fn clone(&self) -> WasmEdge_ValidatorContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_ValidatorContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for WasmEdge_ValidatorContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.WasmEdge_Value.html b/wasmedge_sys/ffi/struct.WasmEdge_Value.html new file mode 100644 index 000000000..661a41618 --- /dev/null +++ b/wasmedge_sys/ffi/struct.WasmEdge_Value.html @@ -0,0 +1,17 @@ +WasmEdge_Value in wasmedge_sys::ffi - Rust
#[repr(C, align(16))]
pub struct WasmEdge_Value { + pub Value: uint128_t, + pub Type: WasmEdge_ValType, +}
Expand description

WasmEdge WASM value struct.

+

Fields§

§Value: uint128_t§Type: WasmEdge_ValType

Trait Implementations§

source§

impl Clone for WasmEdge_Value

source§

fn clone(&self) -> WasmEdge_Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdge_Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<WasmEdge_Value> for WasmValue

source§

fn from(raw_val: WasmEdge_Value) -> Self

Converts to this type from the input type.
source§

impl Copy for WasmEdge_Value

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/struct.__fsid_t.html b/wasmedge_sys/ffi/struct.__fsid_t.html new file mode 100644 index 000000000..154626273 --- /dev/null +++ b/wasmedge_sys/ffi/struct.__fsid_t.html @@ -0,0 +1,15 @@ +__fsid_t in wasmedge_sys::ffi - Rust

Struct wasmedge_sys::ffi::__fsid_t

source ·
#[repr(C)]
pub struct __fsid_t { + pub __val: [c_int; 2], +}

Fields§

§__val: [c_int; 2]

Trait Implementations§

source§

impl Clone for __fsid_t

source§

fn clone(&self) -> __fsid_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for __fsid_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for __fsid_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_CompilerOptimizationLevel.html b/wasmedge_sys/ffi/type.WasmEdge_CompilerOptimizationLevel.html new file mode 100644 index 000000000..525be5b2b --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_CompilerOptimizationLevel.html @@ -0,0 +1 @@ +WasmEdge_CompilerOptimizationLevel in wasmedge_sys::ffi - Rust
pub type WasmEdge_CompilerOptimizationLevel = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_CompilerOutputFormat.html b/wasmedge_sys/ffi/type.WasmEdge_CompilerOutputFormat.html new file mode 100644 index 000000000..78d4953f2 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_CompilerOutputFormat.html @@ -0,0 +1 @@ +WasmEdge_CompilerOutputFormat in wasmedge_sys::ffi - Rust
pub type WasmEdge_CompilerOutputFormat = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_ErrCategory.html b/wasmedge_sys/ffi/type.WasmEdge_ErrCategory.html new file mode 100644 index 000000000..2618e0696 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_ErrCategory.html @@ -0,0 +1 @@ +WasmEdge_ErrCategory in wasmedge_sys::ffi - Rust
pub type WasmEdge_ErrCategory = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_ErrCode.html b/wasmedge_sys/ffi/type.WasmEdge_ErrCode.html new file mode 100644 index 000000000..ad969aaf1 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_ErrCode.html @@ -0,0 +1 @@ +WasmEdge_ErrCode in wasmedge_sys::ffi - Rust
pub type WasmEdge_ErrCode = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_ExternalType.html b/wasmedge_sys/ffi/type.WasmEdge_ExternalType.html new file mode 100644 index 000000000..a76aef587 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_ExternalType.html @@ -0,0 +1 @@ +WasmEdge_ExternalType in wasmedge_sys::ffi - Rust
pub type WasmEdge_ExternalType = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_HostFunc_t.html b/wasmedge_sys/ffi/type.WasmEdge_HostFunc_t.html new file mode 100644 index 000000000..17f083ba6 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_HostFunc_t.html @@ -0,0 +1,6 @@ +WasmEdge_HostFunc_t in wasmedge_sys::ffi - Rust
pub type WasmEdge_HostFunc_t = Option<unsafe extern "C" fn(Data: *mut c_void, CallFrameCxt: *const WasmEdge_CallingFrameContext, Params: *const WasmEdge_Value, Returns: *mut WasmEdge_Value) -> WasmEdge_Result>;

Aliased Type§

enum WasmEdge_HostFunc_t {
+    None,
+    Some(unsafe extern "C" fn(_: *mut c_void, _: *const WasmEdge_CallingFrameContext, _: *const WasmEdge_Value, _: *mut WasmEdge_Value) -> WasmEdge_Result),
+}

Variants§

§1.0.0

None

No value.

+
§1.0.0

Some(unsafe extern "C" fn(_: *mut c_void, _: *const WasmEdge_CallingFrameContext, _: *const WasmEdge_Value, _: *mut WasmEdge_Value) -> WasmEdge_Result)

Some value of type T.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_HostRegistration.html b/wasmedge_sys/ffi/type.WasmEdge_HostRegistration.html new file mode 100644 index 000000000..ab612a6e5 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_HostRegistration.html @@ -0,0 +1 @@ +WasmEdge_HostRegistration in wasmedge_sys::ffi - Rust
pub type WasmEdge_HostRegistration = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_Mutability.html b/wasmedge_sys/ffi/type.WasmEdge_Mutability.html new file mode 100644 index 000000000..96f9eddf8 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_Mutability.html @@ -0,0 +1 @@ +WasmEdge_Mutability in wasmedge_sys::ffi - Rust
pub type WasmEdge_Mutability = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_NumType.html b/wasmedge_sys/ffi/type.WasmEdge_NumType.html new file mode 100644 index 000000000..d3b880950 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_NumType.html @@ -0,0 +1 @@ +WasmEdge_NumType in wasmedge_sys::ffi - Rust
pub type WasmEdge_NumType = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_ProgramOptionType.html b/wasmedge_sys/ffi/type.WasmEdge_ProgramOptionType.html new file mode 100644 index 000000000..1f5b74311 --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_ProgramOptionType.html @@ -0,0 +1,2 @@ +WasmEdge_ProgramOptionType in wasmedge_sys::ffi - Rust
pub type WasmEdge_ProgramOptionType = c_uint;
Expand description

Type of option value.

+

Trait Implementations§

source§

impl From<ProgramOptionType> for WasmEdge_ProgramOptionType

source§

fn from(value: ProgramOptionType) -> Self

Converts to this type from the input type.
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_Proposal.html b/wasmedge_sys/ffi/type.WasmEdge_Proposal.html new file mode 100644 index 000000000..4313abe9c --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_Proposal.html @@ -0,0 +1 @@ +WasmEdge_Proposal in wasmedge_sys::ffi - Rust
pub type WasmEdge_Proposal = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_RefType.html b/wasmedge_sys/ffi/type.WasmEdge_RefType.html new file mode 100644 index 000000000..e948cfd9c --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_RefType.html @@ -0,0 +1 @@ +WasmEdge_RefType in wasmedge_sys::ffi - Rust
pub type WasmEdge_RefType = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_ValType.html b/wasmedge_sys/ffi/type.WasmEdge_ValType.html new file mode 100644 index 000000000..5f333901e --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_ValType.html @@ -0,0 +1 @@ +WasmEdge_ValType in wasmedge_sys::ffi - Rust
pub type WasmEdge_ValType = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.WasmEdge_WrapFunc_t.html b/wasmedge_sys/ffi/type.WasmEdge_WrapFunc_t.html new file mode 100644 index 000000000..8b69e71dd --- /dev/null +++ b/wasmedge_sys/ffi/type.WasmEdge_WrapFunc_t.html @@ -0,0 +1,6 @@ +WasmEdge_WrapFunc_t in wasmedge_sys::ffi - Rust
pub type WasmEdge_WrapFunc_t = Option<unsafe extern "C" fn(This: *mut c_void, Data: *mut c_void, CallFrameCxt: *const WasmEdge_CallingFrameContext, Params: *const WasmEdge_Value, ParamLen: u32, Returns: *mut WasmEdge_Value, ReturnLen: u32) -> WasmEdge_Result>;

Aliased Type§

enum WasmEdge_WrapFunc_t {
+    None,
+    Some(unsafe extern "C" fn(_: *mut c_void, _: *mut c_void, _: *const WasmEdge_CallingFrameContext, _: *const WasmEdge_Value, _: u32, _: *mut WasmEdge_Value, _: u32) -> WasmEdge_Result),
+}

Variants§

§1.0.0

None

No value.

+
§1.0.0

Some(unsafe extern "C" fn(_: *mut c_void, _: *mut c_void, _: *const WasmEdge_CallingFrameContext, _: *const WasmEdge_Value, _: u32, _: *mut WasmEdge_Value, _: u32) -> WasmEdge_Result)

Some value of type T.

+
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__blkcnt64_t.html b/wasmedge_sys/ffi/type.__blkcnt64_t.html new file mode 100644 index 000000000..2a047f0a8 --- /dev/null +++ b/wasmedge_sys/ffi/type.__blkcnt64_t.html @@ -0,0 +1 @@ +__blkcnt64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__blkcnt64_t

source ·
pub type __blkcnt64_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__blkcnt_t.html b/wasmedge_sys/ffi/type.__blkcnt_t.html new file mode 100644 index 000000000..b1f73b6ba --- /dev/null +++ b/wasmedge_sys/ffi/type.__blkcnt_t.html @@ -0,0 +1 @@ +__blkcnt_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__blkcnt_t

source ·
pub type __blkcnt_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__blksize_t.html b/wasmedge_sys/ffi/type.__blksize_t.html new file mode 100644 index 000000000..1d8820ec7 --- /dev/null +++ b/wasmedge_sys/ffi/type.__blksize_t.html @@ -0,0 +1 @@ +__blksize_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__blksize_t

source ·
pub type __blksize_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__caddr_t.html b/wasmedge_sys/ffi/type.__caddr_t.html new file mode 100644 index 000000000..de20a6173 --- /dev/null +++ b/wasmedge_sys/ffi/type.__caddr_t.html @@ -0,0 +1 @@ +__caddr_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__caddr_t

source ·
pub type __caddr_t = *mut c_char;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__clock_t.html b/wasmedge_sys/ffi/type.__clock_t.html new file mode 100644 index 000000000..97f53cd2d --- /dev/null +++ b/wasmedge_sys/ffi/type.__clock_t.html @@ -0,0 +1 @@ +__clock_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__clock_t

source ·
pub type __clock_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__clockid_t.html b/wasmedge_sys/ffi/type.__clockid_t.html new file mode 100644 index 000000000..fe6c5fe6f --- /dev/null +++ b/wasmedge_sys/ffi/type.__clockid_t.html @@ -0,0 +1 @@ +__clockid_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__clockid_t

source ·
pub type __clockid_t = c_int;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__daddr_t.html b/wasmedge_sys/ffi/type.__daddr_t.html new file mode 100644 index 000000000..25c8bc305 --- /dev/null +++ b/wasmedge_sys/ffi/type.__daddr_t.html @@ -0,0 +1 @@ +__daddr_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__daddr_t

source ·
pub type __daddr_t = c_int;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__dev_t.html b/wasmedge_sys/ffi/type.__dev_t.html new file mode 100644 index 000000000..8eeb04388 --- /dev/null +++ b/wasmedge_sys/ffi/type.__dev_t.html @@ -0,0 +1 @@ +__dev_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__dev_t

source ·
pub type __dev_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__fsblkcnt64_t.html b/wasmedge_sys/ffi/type.__fsblkcnt64_t.html new file mode 100644 index 000000000..d79242495 --- /dev/null +++ b/wasmedge_sys/ffi/type.__fsblkcnt64_t.html @@ -0,0 +1 @@ +__fsblkcnt64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__fsblkcnt64_t

source ·
pub type __fsblkcnt64_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__fsblkcnt_t.html b/wasmedge_sys/ffi/type.__fsblkcnt_t.html new file mode 100644 index 000000000..4bb1869e6 --- /dev/null +++ b/wasmedge_sys/ffi/type.__fsblkcnt_t.html @@ -0,0 +1 @@ +__fsblkcnt_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__fsblkcnt_t

source ·
pub type __fsblkcnt_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__fsfilcnt64_t.html b/wasmedge_sys/ffi/type.__fsfilcnt64_t.html new file mode 100644 index 000000000..1f50d3de5 --- /dev/null +++ b/wasmedge_sys/ffi/type.__fsfilcnt64_t.html @@ -0,0 +1 @@ +__fsfilcnt64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__fsfilcnt64_t

source ·
pub type __fsfilcnt64_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__fsfilcnt_t.html b/wasmedge_sys/ffi/type.__fsfilcnt_t.html new file mode 100644 index 000000000..ec49e1bea --- /dev/null +++ b/wasmedge_sys/ffi/type.__fsfilcnt_t.html @@ -0,0 +1 @@ +__fsfilcnt_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__fsfilcnt_t

source ·
pub type __fsfilcnt_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__fsword_t.html b/wasmedge_sys/ffi/type.__fsword_t.html new file mode 100644 index 000000000..a2bf09e4d --- /dev/null +++ b/wasmedge_sys/ffi/type.__fsword_t.html @@ -0,0 +1 @@ +__fsword_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__fsword_t

source ·
pub type __fsword_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__gid_t.html b/wasmedge_sys/ffi/type.__gid_t.html new file mode 100644 index 000000000..2f75f63b5 --- /dev/null +++ b/wasmedge_sys/ffi/type.__gid_t.html @@ -0,0 +1 @@ +__gid_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__gid_t

source ·
pub type __gid_t = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__id_t.html b/wasmedge_sys/ffi/type.__id_t.html new file mode 100644 index 000000000..2c4deacb0 --- /dev/null +++ b/wasmedge_sys/ffi/type.__id_t.html @@ -0,0 +1 @@ +__id_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__id_t

source ·
pub type __id_t = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__ino64_t.html b/wasmedge_sys/ffi/type.__ino64_t.html new file mode 100644 index 000000000..efaa14372 --- /dev/null +++ b/wasmedge_sys/ffi/type.__ino64_t.html @@ -0,0 +1 @@ +__ino64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__ino64_t

source ·
pub type __ino64_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__ino_t.html b/wasmedge_sys/ffi/type.__ino_t.html new file mode 100644 index 000000000..6cb99f697 --- /dev/null +++ b/wasmedge_sys/ffi/type.__ino_t.html @@ -0,0 +1 @@ +__ino_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__ino_t

source ·
pub type __ino_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__int16_t.html b/wasmedge_sys/ffi/type.__int16_t.html new file mode 100644 index 000000000..47ce9f7f6 --- /dev/null +++ b/wasmedge_sys/ffi/type.__int16_t.html @@ -0,0 +1 @@ +__int16_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__int16_t

source ·
pub type __int16_t = c_short;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__int32_t.html b/wasmedge_sys/ffi/type.__int32_t.html new file mode 100644 index 000000000..f7dcae724 --- /dev/null +++ b/wasmedge_sys/ffi/type.__int32_t.html @@ -0,0 +1 @@ +__int32_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__int32_t

source ·
pub type __int32_t = c_int;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__int64_t.html b/wasmedge_sys/ffi/type.__int64_t.html new file mode 100644 index 000000000..7085f2b03 --- /dev/null +++ b/wasmedge_sys/ffi/type.__int64_t.html @@ -0,0 +1 @@ +__int64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__int64_t

source ·
pub type __int64_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__int8_t.html b/wasmedge_sys/ffi/type.__int8_t.html new file mode 100644 index 000000000..b76bb4ca5 --- /dev/null +++ b/wasmedge_sys/ffi/type.__int8_t.html @@ -0,0 +1 @@ +__int8_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__int8_t

source ·
pub type __int8_t = c_schar;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__int_least16_t.html b/wasmedge_sys/ffi/type.__int_least16_t.html new file mode 100644 index 000000000..bc483b9dc --- /dev/null +++ b/wasmedge_sys/ffi/type.__int_least16_t.html @@ -0,0 +1 @@ +__int_least16_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__int_least16_t

source ·
pub type __int_least16_t = __int16_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__int_least32_t.html b/wasmedge_sys/ffi/type.__int_least32_t.html new file mode 100644 index 000000000..e61ac5190 --- /dev/null +++ b/wasmedge_sys/ffi/type.__int_least32_t.html @@ -0,0 +1 @@ +__int_least32_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__int_least32_t

source ·
pub type __int_least32_t = __int32_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__int_least64_t.html b/wasmedge_sys/ffi/type.__int_least64_t.html new file mode 100644 index 000000000..9282fd380 --- /dev/null +++ b/wasmedge_sys/ffi/type.__int_least64_t.html @@ -0,0 +1 @@ +__int_least64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__int_least64_t

source ·
pub type __int_least64_t = __int64_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__int_least8_t.html b/wasmedge_sys/ffi/type.__int_least8_t.html new file mode 100644 index 000000000..b15e139b3 --- /dev/null +++ b/wasmedge_sys/ffi/type.__int_least8_t.html @@ -0,0 +1 @@ +__int_least8_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__int_least8_t

source ·
pub type __int_least8_t = __int8_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__intmax_t.html b/wasmedge_sys/ffi/type.__intmax_t.html new file mode 100644 index 000000000..e15844635 --- /dev/null +++ b/wasmedge_sys/ffi/type.__intmax_t.html @@ -0,0 +1 @@ +__intmax_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__intmax_t

source ·
pub type __intmax_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__intptr_t.html b/wasmedge_sys/ffi/type.__intptr_t.html new file mode 100644 index 000000000..139325b88 --- /dev/null +++ b/wasmedge_sys/ffi/type.__intptr_t.html @@ -0,0 +1 @@ +__intptr_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__intptr_t

source ·
pub type __intptr_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__key_t.html b/wasmedge_sys/ffi/type.__key_t.html new file mode 100644 index 000000000..818e6283d --- /dev/null +++ b/wasmedge_sys/ffi/type.__key_t.html @@ -0,0 +1 @@ +__key_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__key_t

source ·
pub type __key_t = c_int;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__loff_t.html b/wasmedge_sys/ffi/type.__loff_t.html new file mode 100644 index 000000000..b9856be4e --- /dev/null +++ b/wasmedge_sys/ffi/type.__loff_t.html @@ -0,0 +1 @@ +__loff_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__loff_t

source ·
pub type __loff_t = __off64_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__mode_t.html b/wasmedge_sys/ffi/type.__mode_t.html new file mode 100644 index 000000000..1062ceb71 --- /dev/null +++ b/wasmedge_sys/ffi/type.__mode_t.html @@ -0,0 +1 @@ +__mode_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__mode_t

source ·
pub type __mode_t = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__nlink_t.html b/wasmedge_sys/ffi/type.__nlink_t.html new file mode 100644 index 000000000..670f57664 --- /dev/null +++ b/wasmedge_sys/ffi/type.__nlink_t.html @@ -0,0 +1 @@ +__nlink_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__nlink_t

source ·
pub type __nlink_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__off64_t.html b/wasmedge_sys/ffi/type.__off64_t.html new file mode 100644 index 000000000..51a1b3167 --- /dev/null +++ b/wasmedge_sys/ffi/type.__off64_t.html @@ -0,0 +1 @@ +__off64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__off64_t

source ·
pub type __off64_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__off_t.html b/wasmedge_sys/ffi/type.__off_t.html new file mode 100644 index 000000000..597231d1b --- /dev/null +++ b/wasmedge_sys/ffi/type.__off_t.html @@ -0,0 +1 @@ +__off_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__off_t

source ·
pub type __off_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__pid_t.html b/wasmedge_sys/ffi/type.__pid_t.html new file mode 100644 index 000000000..ae9bf309b --- /dev/null +++ b/wasmedge_sys/ffi/type.__pid_t.html @@ -0,0 +1 @@ +__pid_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__pid_t

source ·
pub type __pid_t = c_int;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__quad_t.html b/wasmedge_sys/ffi/type.__quad_t.html new file mode 100644 index 000000000..8a947b83b --- /dev/null +++ b/wasmedge_sys/ffi/type.__quad_t.html @@ -0,0 +1 @@ +__quad_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__quad_t

source ·
pub type __quad_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__rlim64_t.html b/wasmedge_sys/ffi/type.__rlim64_t.html new file mode 100644 index 000000000..6e0ae066a --- /dev/null +++ b/wasmedge_sys/ffi/type.__rlim64_t.html @@ -0,0 +1 @@ +__rlim64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__rlim64_t

source ·
pub type __rlim64_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__rlim_t.html b/wasmedge_sys/ffi/type.__rlim_t.html new file mode 100644 index 000000000..a99821b5e --- /dev/null +++ b/wasmedge_sys/ffi/type.__rlim_t.html @@ -0,0 +1 @@ +__rlim_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__rlim_t

source ·
pub type __rlim_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__sig_atomic_t.html b/wasmedge_sys/ffi/type.__sig_atomic_t.html new file mode 100644 index 000000000..5c8f14dca --- /dev/null +++ b/wasmedge_sys/ffi/type.__sig_atomic_t.html @@ -0,0 +1 @@ +__sig_atomic_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__sig_atomic_t

source ·
pub type __sig_atomic_t = c_int;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__socklen_t.html b/wasmedge_sys/ffi/type.__socklen_t.html new file mode 100644 index 000000000..6074b58bb --- /dev/null +++ b/wasmedge_sys/ffi/type.__socklen_t.html @@ -0,0 +1 @@ +__socklen_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__socklen_t

source ·
pub type __socklen_t = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__ssize_t.html b/wasmedge_sys/ffi/type.__ssize_t.html new file mode 100644 index 000000000..83ce7df2a --- /dev/null +++ b/wasmedge_sys/ffi/type.__ssize_t.html @@ -0,0 +1 @@ +__ssize_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__ssize_t

source ·
pub type __ssize_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__suseconds64_t.html b/wasmedge_sys/ffi/type.__suseconds64_t.html new file mode 100644 index 000000000..3938dd376 --- /dev/null +++ b/wasmedge_sys/ffi/type.__suseconds64_t.html @@ -0,0 +1 @@ +__suseconds64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__suseconds64_t

source ·
pub type __suseconds64_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__suseconds_t.html b/wasmedge_sys/ffi/type.__suseconds_t.html new file mode 100644 index 000000000..e44aaea66 --- /dev/null +++ b/wasmedge_sys/ffi/type.__suseconds_t.html @@ -0,0 +1 @@ +__suseconds_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__suseconds_t

source ·
pub type __suseconds_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__syscall_slong_t.html b/wasmedge_sys/ffi/type.__syscall_slong_t.html new file mode 100644 index 000000000..ec545d99c --- /dev/null +++ b/wasmedge_sys/ffi/type.__syscall_slong_t.html @@ -0,0 +1 @@ +__syscall_slong_t in wasmedge_sys::ffi - Rust
pub type __syscall_slong_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__syscall_ulong_t.html b/wasmedge_sys/ffi/type.__syscall_ulong_t.html new file mode 100644 index 000000000..73d9314fe --- /dev/null +++ b/wasmedge_sys/ffi/type.__syscall_ulong_t.html @@ -0,0 +1 @@ +__syscall_ulong_t in wasmedge_sys::ffi - Rust
pub type __syscall_ulong_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__time_t.html b/wasmedge_sys/ffi/type.__time_t.html new file mode 100644 index 000000000..1989510ef --- /dev/null +++ b/wasmedge_sys/ffi/type.__time_t.html @@ -0,0 +1 @@ +__time_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__time_t

source ·
pub type __time_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__timer_t.html b/wasmedge_sys/ffi/type.__timer_t.html new file mode 100644 index 000000000..0483b3918 --- /dev/null +++ b/wasmedge_sys/ffi/type.__timer_t.html @@ -0,0 +1 @@ +__timer_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__timer_t

source ·
pub type __timer_t = *mut c_void;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__u_char.html b/wasmedge_sys/ffi/type.__u_char.html new file mode 100644 index 000000000..7a1899d93 --- /dev/null +++ b/wasmedge_sys/ffi/type.__u_char.html @@ -0,0 +1 @@ +__u_char in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__u_char

source ·
pub type __u_char = c_uchar;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__u_int.html b/wasmedge_sys/ffi/type.__u_int.html new file mode 100644 index 000000000..61d7e86fb --- /dev/null +++ b/wasmedge_sys/ffi/type.__u_int.html @@ -0,0 +1 @@ +__u_int in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__u_int

source ·
pub type __u_int = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__u_long.html b/wasmedge_sys/ffi/type.__u_long.html new file mode 100644 index 000000000..016e9ec72 --- /dev/null +++ b/wasmedge_sys/ffi/type.__u_long.html @@ -0,0 +1 @@ +__u_long in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__u_long

source ·
pub type __u_long = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__u_quad_t.html b/wasmedge_sys/ffi/type.__u_quad_t.html new file mode 100644 index 000000000..841e8a425 --- /dev/null +++ b/wasmedge_sys/ffi/type.__u_quad_t.html @@ -0,0 +1 @@ +__u_quad_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__u_quad_t

source ·
pub type __u_quad_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__u_short.html b/wasmedge_sys/ffi/type.__u_short.html new file mode 100644 index 000000000..e4f2ca8a5 --- /dev/null +++ b/wasmedge_sys/ffi/type.__u_short.html @@ -0,0 +1 @@ +__u_short in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__u_short

source ·
pub type __u_short = c_ushort;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uid_t.html b/wasmedge_sys/ffi/type.__uid_t.html new file mode 100644 index 000000000..68440cdc7 --- /dev/null +++ b/wasmedge_sys/ffi/type.__uid_t.html @@ -0,0 +1 @@ +__uid_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__uid_t

source ·
pub type __uid_t = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uint16_t.html b/wasmedge_sys/ffi/type.__uint16_t.html new file mode 100644 index 000000000..c5ba85724 --- /dev/null +++ b/wasmedge_sys/ffi/type.__uint16_t.html @@ -0,0 +1 @@ +__uint16_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__uint16_t

source ·
pub type __uint16_t = c_ushort;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uint32_t.html b/wasmedge_sys/ffi/type.__uint32_t.html new file mode 100644 index 000000000..43249e2fe --- /dev/null +++ b/wasmedge_sys/ffi/type.__uint32_t.html @@ -0,0 +1 @@ +__uint32_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__uint32_t

source ·
pub type __uint32_t = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uint64_t.html b/wasmedge_sys/ffi/type.__uint64_t.html new file mode 100644 index 000000000..23657955f --- /dev/null +++ b/wasmedge_sys/ffi/type.__uint64_t.html @@ -0,0 +1 @@ +__uint64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__uint64_t

source ·
pub type __uint64_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uint8_t.html b/wasmedge_sys/ffi/type.__uint8_t.html new file mode 100644 index 000000000..c1d640af2 --- /dev/null +++ b/wasmedge_sys/ffi/type.__uint8_t.html @@ -0,0 +1 @@ +__uint8_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__uint8_t

source ·
pub type __uint8_t = c_uchar;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uint_least16_t.html b/wasmedge_sys/ffi/type.__uint_least16_t.html new file mode 100644 index 000000000..35c353154 --- /dev/null +++ b/wasmedge_sys/ffi/type.__uint_least16_t.html @@ -0,0 +1 @@ +__uint_least16_t in wasmedge_sys::ffi - Rust
pub type __uint_least16_t = __uint16_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uint_least32_t.html b/wasmedge_sys/ffi/type.__uint_least32_t.html new file mode 100644 index 000000000..b82e51660 --- /dev/null +++ b/wasmedge_sys/ffi/type.__uint_least32_t.html @@ -0,0 +1 @@ +__uint_least32_t in wasmedge_sys::ffi - Rust
pub type __uint_least32_t = __uint32_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uint_least64_t.html b/wasmedge_sys/ffi/type.__uint_least64_t.html new file mode 100644 index 000000000..fa9b2a2dc --- /dev/null +++ b/wasmedge_sys/ffi/type.__uint_least64_t.html @@ -0,0 +1 @@ +__uint_least64_t in wasmedge_sys::ffi - Rust
pub type __uint_least64_t = __uint64_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uint_least8_t.html b/wasmedge_sys/ffi/type.__uint_least8_t.html new file mode 100644 index 000000000..cd0f01d38 --- /dev/null +++ b/wasmedge_sys/ffi/type.__uint_least8_t.html @@ -0,0 +1 @@ +__uint_least8_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__uint_least8_t

source ·
pub type __uint_least8_t = __uint8_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__uintmax_t.html b/wasmedge_sys/ffi/type.__uintmax_t.html new file mode 100644 index 000000000..8e023a479 --- /dev/null +++ b/wasmedge_sys/ffi/type.__uintmax_t.html @@ -0,0 +1 @@ +__uintmax_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__uintmax_t

source ·
pub type __uintmax_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.__useconds_t.html b/wasmedge_sys/ffi/type.__useconds_t.html new file mode 100644 index 000000000..490465974 --- /dev/null +++ b/wasmedge_sys/ffi/type.__useconds_t.html @@ -0,0 +1 @@ +__useconds_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::__useconds_t

source ·
pub type __useconds_t = c_uint;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int128_t.html b/wasmedge_sys/ffi/type.int128_t.html new file mode 100644 index 000000000..9e16c41ee --- /dev/null +++ b/wasmedge_sys/ffi/type.int128_t.html @@ -0,0 +1 @@ +int128_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int128_t

source ·
pub type int128_t = i128;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int_fast16_t.html b/wasmedge_sys/ffi/type.int_fast16_t.html new file mode 100644 index 000000000..605ab60a5 --- /dev/null +++ b/wasmedge_sys/ffi/type.int_fast16_t.html @@ -0,0 +1 @@ +int_fast16_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int_fast16_t

source ·
pub type int_fast16_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int_fast32_t.html b/wasmedge_sys/ffi/type.int_fast32_t.html new file mode 100644 index 000000000..ff8add982 --- /dev/null +++ b/wasmedge_sys/ffi/type.int_fast32_t.html @@ -0,0 +1 @@ +int_fast32_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int_fast32_t

source ·
pub type int_fast32_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int_fast64_t.html b/wasmedge_sys/ffi/type.int_fast64_t.html new file mode 100644 index 000000000..320c8c305 --- /dev/null +++ b/wasmedge_sys/ffi/type.int_fast64_t.html @@ -0,0 +1 @@ +int_fast64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int_fast64_t

source ·
pub type int_fast64_t = c_long;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int_fast8_t.html b/wasmedge_sys/ffi/type.int_fast8_t.html new file mode 100644 index 000000000..76bfe59d8 --- /dev/null +++ b/wasmedge_sys/ffi/type.int_fast8_t.html @@ -0,0 +1 @@ +int_fast8_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int_fast8_t

source ·
pub type int_fast8_t = c_schar;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int_least16_t.html b/wasmedge_sys/ffi/type.int_least16_t.html new file mode 100644 index 000000000..87f285dbf --- /dev/null +++ b/wasmedge_sys/ffi/type.int_least16_t.html @@ -0,0 +1 @@ +int_least16_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int_least16_t

source ·
pub type int_least16_t = __int_least16_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int_least32_t.html b/wasmedge_sys/ffi/type.int_least32_t.html new file mode 100644 index 000000000..88a3004d8 --- /dev/null +++ b/wasmedge_sys/ffi/type.int_least32_t.html @@ -0,0 +1 @@ +int_least32_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int_least32_t

source ·
pub type int_least32_t = __int_least32_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int_least64_t.html b/wasmedge_sys/ffi/type.int_least64_t.html new file mode 100644 index 000000000..f0669b5c7 --- /dev/null +++ b/wasmedge_sys/ffi/type.int_least64_t.html @@ -0,0 +1 @@ +int_least64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int_least64_t

source ·
pub type int_least64_t = __int_least64_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.int_least8_t.html b/wasmedge_sys/ffi/type.int_least8_t.html new file mode 100644 index 000000000..bf0a2ca11 --- /dev/null +++ b/wasmedge_sys/ffi/type.int_least8_t.html @@ -0,0 +1 @@ +int_least8_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::int_least8_t

source ·
pub type int_least8_t = __int_least8_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.intmax_t.html b/wasmedge_sys/ffi/type.intmax_t.html new file mode 100644 index 000000000..5edc0f734 --- /dev/null +++ b/wasmedge_sys/ffi/type.intmax_t.html @@ -0,0 +1 @@ +intmax_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::intmax_t

source ·
pub type intmax_t = __intmax_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint128_t.html b/wasmedge_sys/ffi/type.uint128_t.html new file mode 100644 index 000000000..b6a03eedb --- /dev/null +++ b/wasmedge_sys/ffi/type.uint128_t.html @@ -0,0 +1 @@ +uint128_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint128_t

source ·
pub type uint128_t = u128;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint_fast16_t.html b/wasmedge_sys/ffi/type.uint_fast16_t.html new file mode 100644 index 000000000..5f1b5e1e2 --- /dev/null +++ b/wasmedge_sys/ffi/type.uint_fast16_t.html @@ -0,0 +1 @@ +uint_fast16_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint_fast16_t

source ·
pub type uint_fast16_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint_fast32_t.html b/wasmedge_sys/ffi/type.uint_fast32_t.html new file mode 100644 index 000000000..8b4b9b3ac --- /dev/null +++ b/wasmedge_sys/ffi/type.uint_fast32_t.html @@ -0,0 +1 @@ +uint_fast32_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint_fast32_t

source ·
pub type uint_fast32_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint_fast64_t.html b/wasmedge_sys/ffi/type.uint_fast64_t.html new file mode 100644 index 000000000..77388a8f4 --- /dev/null +++ b/wasmedge_sys/ffi/type.uint_fast64_t.html @@ -0,0 +1 @@ +uint_fast64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint_fast64_t

source ·
pub type uint_fast64_t = c_ulong;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint_fast8_t.html b/wasmedge_sys/ffi/type.uint_fast8_t.html new file mode 100644 index 000000000..5ec93f297 --- /dev/null +++ b/wasmedge_sys/ffi/type.uint_fast8_t.html @@ -0,0 +1 @@ +uint_fast8_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint_fast8_t

source ·
pub type uint_fast8_t = c_uchar;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint_least16_t.html b/wasmedge_sys/ffi/type.uint_least16_t.html new file mode 100644 index 000000000..ba1676a5c --- /dev/null +++ b/wasmedge_sys/ffi/type.uint_least16_t.html @@ -0,0 +1 @@ +uint_least16_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint_least16_t

source ·
pub type uint_least16_t = __uint_least16_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint_least32_t.html b/wasmedge_sys/ffi/type.uint_least32_t.html new file mode 100644 index 000000000..7e0ca5ba5 --- /dev/null +++ b/wasmedge_sys/ffi/type.uint_least32_t.html @@ -0,0 +1 @@ +uint_least32_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint_least32_t

source ·
pub type uint_least32_t = __uint_least32_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint_least64_t.html b/wasmedge_sys/ffi/type.uint_least64_t.html new file mode 100644 index 000000000..6b441f9f0 --- /dev/null +++ b/wasmedge_sys/ffi/type.uint_least64_t.html @@ -0,0 +1 @@ +uint_least64_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint_least64_t

source ·
pub type uint_least64_t = __uint_least64_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uint_least8_t.html b/wasmedge_sys/ffi/type.uint_least8_t.html new file mode 100644 index 000000000..1034c411a --- /dev/null +++ b/wasmedge_sys/ffi/type.uint_least8_t.html @@ -0,0 +1 @@ +uint_least8_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uint_least8_t

source ·
pub type uint_least8_t = __uint_least8_t;
\ No newline at end of file diff --git a/wasmedge_sys/ffi/type.uintmax_t.html b/wasmedge_sys/ffi/type.uintmax_t.html new file mode 100644 index 000000000..461b6fc48 --- /dev/null +++ b/wasmedge_sys/ffi/type.uintmax_t.html @@ -0,0 +1 @@ +uintmax_t in wasmedge_sys::ffi - Rust

Type Alias wasmedge_sys::ffi::uintmax_t

source ·
pub type uintmax_t = __uintmax_t;
\ No newline at end of file diff --git a/wasmedge_sys/frame/index.html b/wasmedge_sys/frame/index.html new file mode 100644 index 000000000..b627df351 --- /dev/null +++ b/wasmedge_sys/frame/index.html @@ -0,0 +1,2 @@ +wasmedge_sys::frame - Rust

Module wasmedge_sys::frame

source ·
Expand description

Defines WasmEdge CallingFrame.

+

Structs

\ No newline at end of file diff --git a/wasmedge_sys/frame/sidebar-items.js b/wasmedge_sys/frame/sidebar-items.js new file mode 100644 index 000000000..ebd1da183 --- /dev/null +++ b/wasmedge_sys/frame/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["CallingFrame"]}; \ No newline at end of file diff --git a/wasmedge_sys/frame/struct.CallingFrame.html b/wasmedge_sys/frame/struct.CallingFrame.html new file mode 100644 index 000000000..2fe39c5d7 --- /dev/null +++ b/wasmedge_sys/frame/struct.CallingFrame.html @@ -0,0 +1,30 @@ +CallingFrame in wasmedge_sys::frame - Rust
pub struct CallingFrame { /* private fields */ }
Expand description

Represents a calling frame on top of stack.

+

Implementations§

source§

impl CallingFrame

source

pub fn executor_mut(&self) -> Option<Executor>

Returns the executor instance from this calling frame.

+
source

pub fn module_instance(&self) -> Option<Instance>

Returns the module instance in this calling frame.

+

If the executing function instance is a host function and not added into any module instance, then returns None.

+

When a wasm function is executing and trying to call a host function inside, a frame with the module +instance the wasm function belongs to will be pushed onto the stack. And therefore the calling frame +context will record that module instance.

+
source

pub fn memory_mut(&self, idx: u32) -> Option<Memory>

Returns the memory instance by the given index from the module instance of the current +calling frame. If the memory instance is not found, returns None.

+

By default, a WASM module has only one memory instance after instantiation. Therefore, users can pass in 0 as +the index to get the memory instance in host function body. When the MultiMemories +config option is enabled, there would be more than one memory instances in the wasm module. Users can retrieve +the target memory instance by specifying the index of the memory instance in the wasm module instance.

+
Arguments
+
    +
  • idx - The index of the memory instance.
  • +
+
source

pub fn as_ptr(&self) -> *const WasmEdge_CallingFrameContext

Available on crate feature ffi only.

Provides a raw pointer to the inner CallingFrame context.

+

Trait Implementations§

source§

impl Debug for CallingFrame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for CallingFrame

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/index.html b/wasmedge_sys/index.html new file mode 100644 index 000000000..d0627ee71 --- /dev/null +++ b/wasmedge_sys/index.html @@ -0,0 +1,48 @@ +wasmedge_sys - Rust

Crate wasmedge_sys

source ·
Expand description

Overview

+

The wasmedge-sys crate defines a group of low-level Rust APIs for WasmEdge, a light-weight, high-performance, and extensible WebAssembly runtime for cloud-native, edge, and decentralized applications.

+

For developers, it is strongly recommended that the APIs in wasmedge-sys are used to construct high-level libraries, while wasmedge-sdk is for building up business applications.

+
    +
  • Notice that wasmedge-sys requires Rust v1.71 or above in the stable channel.
  • +
+

Build

+

To use or build the wasmedge-sys crate, the WasmEdge library is required. Please refer to WasmEdge Installation and Uninstallation to install the WasmEdge library.

+
    +
  • +

    The following table provides the versioning information about each crate of WasmEdge Rust bindings.

    +
    + + + + + + + + + + + + + + + + + + + + +
    wasmedge-sdkWasmEdge libwasmedge-syswasmedge-typeswasmedge-macroasync-wasi
    0.13.10.13.50.17.30.4.40.6.10.1.0
    0.13.00.13.50.17.30.4.40.6.10.1.0
    0.12.20.13.40.17.20.4.40.6.10.1.0
    0.12.10.13.40.17.10.4.40.6.10.1.0
    0.12.00.13.40.17.00.4.40.6.10.1.0
    0.11.20.13.30.16.20.4.30.6.10.1.0
    0.11.00.13.30.16.00.4.30.6.00.0.3
    0.10.10.13.30.15.10.4.20.5.00.0.2
    0.10.00.13.20.15.00.4.20.5.00.0.2
    0.9.00.13.10.14.00.4.20.4.00.0.1
    0.9.00.13.00.14.00.4.20.4.00.0.1
    0.8.10.12.10.13.10.4.10.3.0-
    0.8.00.12.00.13.00.4.10.3.0-
    0.7.10.11.20.12.20.3.10.3.0-
    0.7.00.11.20.120.3.10.3.0-
    0.6.00.11.20.110.3.00.2.0-
    0.5.00.11.10.100.3.00.1.0-
    0.4.00.11.00.90.2.1--
    0.3.00.10.10.80.2--
    0.1.00.10.00.70.1--
    +
  • +
+

API Reference

+ +

See also

+ +

Modules

  • Foreign function interfaces generated from WasmEdge C-API.
  • Defines WasmEdge CallingFrame.
  • Defines WasmEdge instance structs, including Function, Global, Memory, Table, and etc.
  • Defines PluginManager and Plugin structs.
  • Defines the WebAssembly primitive types.
  • Defines the versioning and logging functions.

Structs

  • Represents a calling frame on top of stack.
  • Defines WasmEdge ahead-of-time(AOT) compiler and the relevant APIs.
  • Defines Config struct used to check/set the configuration options.
  • Defines an execution environment for both pure WASM and compiled WASM.
  • Defines the types of the exported wasm values.
  • Defines a reference to a host function.
  • Defines the type of a host function.
  • Defines a host function.
  • Defines a WebAssembly global variable, which stores a single value of the given type and a flag indicating whether it is mutable or not.
  • Defines the type of a wasm global variable.
  • An ImportModule represents a host module with a name. A host module consists of one or more host function, table, memory, and global instances, which are defined outside wasm modules and fed into wasm modules as imports.
  • Defines the types of the imported wasm value.
  • An Instance represents an instantiated module. In the instantiation process, An Instance is created from alModule. From an Instance the exported functions, tables, memories, and globals can be fetched.
  • Loader is used to load WASM modules from the given WASM files or buffers.
  • Defines the type of a wasm memory instance
  • Defines a WebAssembly memory instance, which is a linear memory described by its type. Each memory instance consists of a vector of bytes and an optional maximum size, and its size is a multiple of the WebAssembly page size (64KiB of each page).
  • Defines compiled in-memory representation of an input WASM binary.
  • Struct of WasmEdge Statistics.
  • A Store represents all global state that can be manipulated by WebAssembly programs. It consists of the runtime representation of all instances of functions, tables, memories, and globals.
  • A WasmEdge Table defines a WebAssembly table instance described by its type. A table is an array-like structure and stores function references.
  • A WasmEdge TableType classifies a Table instance over elements of element types within a size range.
  • Struct of WasmEdge Validator.
  • A WasiModule is a module instance for the WASI specification.
  • Defines a WebAssembly value.

Enums

  • Defines three types of module instances that can be imported into a WasmEdge Store instance.

Traits

\ No newline at end of file diff --git a/wasmedge_sys/instance/function/index.html b/wasmedge_sys/instance/function/index.html new file mode 100644 index 000000000..83b23114e --- /dev/null +++ b/wasmedge_sys/instance/function/index.html @@ -0,0 +1,2 @@ +wasmedge_sys::instance::function - Rust
Expand description

Defines WasmEdge Function and FuncType structs.

+

Structs

Type Aliases

\ No newline at end of file diff --git a/wasmedge_sys/instance/function/sidebar-items.js b/wasmedge_sys/instance/function/sidebar-items.js new file mode 100644 index 000000000..28c89b2a7 --- /dev/null +++ b/wasmedge_sys/instance/function/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["FuncRef","FuncType","Function"],"type":["CustomFnWrapper"]}; \ No newline at end of file diff --git a/wasmedge_sys/instance/function/struct.FuncRef.html b/wasmedge_sys/instance/function/struct.FuncRef.html new file mode 100644 index 000000000..6bbef51dc --- /dev/null +++ b/wasmedge_sys/instance/function/struct.FuncRef.html @@ -0,0 +1,33 @@ +FuncRef in wasmedge_sys::instance::function - Rust
pub struct FuncRef { /* private fields */ }
Expand description

Defines a reference to a host function.

+

Implementations§

source§

impl FuncRef

source

pub fn ty(&self) -> WasmEdgeResult<FuncType>

Returns the underlying wasm type of the host function this FuncRef points to.

+
Errors
+

If fail to get the function type, then an error is returned.

+
source

pub fn call<E: Engine>( + &self, + engine: &E, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs this host function the reference refers to.

+
Arguments
+
    +
  • +

    engine - The object implementing the Engine trait.

    +
  • +
  • +

    args - The arguments passed to the host function.

    +
  • +
+
Error
+

If fail to run the host function, then an error is returned.

+

Trait Implementations§

source§

impl Clone for FuncRef

source§

fn clone(&self) -> FuncRef

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FuncRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FuncRef

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/function/struct.FuncType.html b/wasmedge_sys/instance/function/struct.FuncType.html new file mode 100644 index 000000000..0d15ac69f --- /dev/null +++ b/wasmedge_sys/instance/function/struct.FuncType.html @@ -0,0 +1,39 @@ +FuncType in wasmedge_sys::instance::function - Rust
pub struct FuncType { /* private fields */ }
Expand description

Defines the type of a host function.

+

A WasmEdge FuncType classifies the signature of a Function, including the type information of both the arguments and the returns.

+

Implementations§

source§

impl FuncType

source

pub fn create<I: IntoIterator<Item = ValType>, R: IntoIterator<Item = ValType>>( + args: I, + returns: R +) -> WasmEdgeResult<Self>

Create a new FuncType to be associated with the given arguments and returns.

+
Arguments
+
    +
  • +

    args - The argument types of a Function.

    +
  • +
  • +

    returns - The types of the returns of a Function.

    +
  • +
+
Error
+

If fail to create a FuncType, then an error is returned.

+
Example
+
use wasmedge_sys::FuncType;
+use wasmedge_types::ValType;
+
+let func_ty = FuncType::create(vec![ValType::I32;2], vec![ValType::I32]).expect("fail to create a FuncType");
+
source

pub fn params_len(&self) -> u32

Returns the number of the arguments of a Function.

+
source

pub fn params_type_iter(&self) -> impl Iterator<Item = ValType>

Returns an Iterator of the arguments of a Function.

+
source

pub fn returns_len(&self) -> u32

Returns the number of the returns of a Function.

+
source

pub fn returns_type_iter(&self) -> impl Iterator<Item = ValType>

Returns an Iterator of the return types of a Function.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_FunctionTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner function type context.

+

Trait Implementations§

source§

impl Debug for FuncType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FuncType

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<FuncType> for FuncType

source§

fn from(ty: FuncType) -> Self

Converts to this type from the input type.
source§

impl From<FuncType> for FuncType

source§

fn from(ty: FuncType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/function/struct.Function.html b/wasmedge_sys/instance/function/struct.Function.html new file mode 100644 index 000000000..a6c9ad7af --- /dev/null +++ b/wasmedge_sys/instance/function/struct.Function.html @@ -0,0 +1,133 @@ +Function in wasmedge_sys::instance::function - Rust
pub struct Function { /* private fields */ }
Expand description

Defines a host function.

+

A WasmEdge Function defines a WebAssembly host function described by its type. A host function is a closure of the original function defined in either the host or the WebAssembly module.

+

Implementations§

source§

impl Function

source

pub fn create_sync_func<T>( + ty: &FuncType, + real_fn: Box<dyn Fn(CallingFrame, Vec<WasmValue>, *mut c_void) -> Result<Vec<WasmValue>, HostFuncError> + Send + Sync>, + data: Option<Box<T>>, + cost: u64 +) -> WasmEdgeResult<Self>

Creates a host function with the given function type.

+

N.B. that this function is used for thread-safe scenarios.

+
Arguments
+
    +
  • +

    ty - The types of the arguments and returns of the target function.

    +
  • +
  • +

    real_fn - The pointer to the target function.

    +
  • +
  • +

    data - The host context data used in this function.

    +
  • +
  • +

    cost - The function cost in the Statistics. Pass 0 if the calculation is not needed.

    +
  • +
+
Error
+ +
Example
+

The example defines a host function real_add, and creates a Function binding to it by calling +the create_binding method.

+ +
use wasmedge_macro::sys_host_function;
+use wasmedge_sys::{FuncType, Function, WasmValue, CallingFrame};
+use wasmedge_types::{error::HostFuncError, ValType, WasmEdgeResult, NeverType};
+
+#[sys_host_function]
+fn real_add(_frame: CallingFrame, inputs: Vec<WasmValue>) -> Result<Vec<WasmValue>, HostFuncError> {
+    if inputs.len() != 2 {
+        return Err(HostFuncError::User(1));
+    }
+
+    let a = if inputs[0].ty() == ValType::I32 {
+        inputs[0].to_i32()
+    } else {
+        return Err(HostFuncError::User(2));
+    };
+
+    let b = if inputs[1].ty() == ValType::I32 {
+        inputs[1].to_i32()
+    } else {
+        return Err(HostFuncError::User(3));
+    };
+
+    let c = a + b;
+
+    Ok(vec![WasmValue::from_i32(c)])
+}
+
+// create a FuncType
+let func_ty = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]).expect("fail to create a FuncType");
+
+// create a Function instance
+let func = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0).expect("fail to create a Function instance");
+
source

pub unsafe fn create_with_custom_wrapper( + ty: &FuncType, + fn_wrapper: CustomFnWrapper, + real_fn: *mut c_void, + data: *mut c_void, + data_owner: bool, + cost: u64 +) -> WasmEdgeResult<Self>

Creates a host function with the given function type and the custom function wrapper.

+
Arguments
+
    +
  • +

    ty - The types of the arguments and returns of the target function.

    +
  • +
  • +

    fn_wrapper - The custom function wrapper.

    +
  • +
  • +

    real_fn - The pointer to the target function.

    +
  • +
  • +

    data - The pointer to the host context data used in this function.

    +
  • +
  • +

    data_owner - Whether the host context data is owned by the host function.

    +
  • +
  • +

    cost - The function cost in the Statistics. Pass 0 if the calculation is not needed.

    +
  • +
+
Error
+ +
Safety
+

Notice that the caller should guarantee the life cycle of both the real_fn and the data object.

+
source

pub fn ty(&self) -> WasmEdgeResult<FuncType>

Returns the underlying wasm type of this Function.

+
Errors
+

If fail to get the function type, then an error is returned.

+
source

pub fn call<E: Engine>( + &self, + engine: &E, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs this host function and returns the result.

+
Arguments
+
    +
  • +

    engine - The object implementing the Engine trait.

    +
  • +
  • +

    args - The arguments passed to the host function.

    +
  • +
+
Error
+

If fail to run the host function, then an error is returned.

+
source

pub fn as_ref(&self) -> FuncRef

Returns a reference to this Function instance.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_FunctionInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner function context.

+

Trait Implementations§

source§

impl Clone for Function

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Function

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Function

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/function/type.CustomFnWrapper.html b/wasmedge_sys/instance/function/type.CustomFnWrapper.html new file mode 100644 index 000000000..b914afad0 --- /dev/null +++ b/wasmedge_sys/instance/function/type.CustomFnWrapper.html @@ -0,0 +1 @@ +CustomFnWrapper in wasmedge_sys::instance::function - Rust
pub type CustomFnWrapper = unsafe extern "C" fn(key_ptr: *mut c_void, data_ptr: *mut c_void, calling_frame_ctx: *const WasmEdge_CallingFrameContext, params: *const WasmEdge_Value, param_len: u32, returns: *mut WasmEdge_Value, return_len: u32) -> WasmEdge_Result;
\ No newline at end of file diff --git a/wasmedge_sys/instance/global/index.html b/wasmedge_sys/instance/global/index.html new file mode 100644 index 000000000..bcdc71ebc --- /dev/null +++ b/wasmedge_sys/instance/global/index.html @@ -0,0 +1,4 @@ +wasmedge_sys::instance::global - Rust
Expand description

Defines WasmEdge Global and GlobalType structs.

+

A WasmEdge Global defines a global variable, which stores a single value of the given GlobalType. +GlobalType specifies whether a global variable is immutable or mutable.

+

Structs

  • Defines a WebAssembly global variable, which stores a single value of the given type and a flag indicating whether it is mutable or not.
  • Defines the type of a wasm global variable.
\ No newline at end of file diff --git a/wasmedge_sys/instance/global/sidebar-items.js b/wasmedge_sys/instance/global/sidebar-items.js new file mode 100644 index 000000000..e75047ad6 --- /dev/null +++ b/wasmedge_sys/instance/global/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Global","GlobalType"]}; \ No newline at end of file diff --git a/wasmedge_sys/instance/global/struct.Global.html b/wasmedge_sys/instance/global/struct.Global.html new file mode 100644 index 000000000..ff8c79730 --- /dev/null +++ b/wasmedge_sys/instance/global/struct.Global.html @@ -0,0 +1,44 @@ +Global in wasmedge_sys::instance::global - Rust
pub struct Global { /* private fields */ }
Expand description

Defines a WebAssembly global variable, which stores a single value of the given type and a flag indicating whether it is mutable or not.

+

Implementations§

source§

impl Global

source

pub fn create(ty: &GlobalType, val: WasmValue) -> WasmEdgeResult<Self>

Creates a new Global instance to be associated with the given GlobalType and WasmValue.

+

The type of the given WasmValue must be matched with GlobalType; otherwise, it causes a failure. For example, WasmValue::I32(520) conflicts with a GlobalType with a value type defined as ValType::F32.

+
Errors
+
    +
  • If fail to create the Global instance, then WasmEdgeError::Global(GlobalError::Create)(crate::error::GlobalError) is returned.
  • +
+
source

pub fn ty(&self) -> WasmEdgeResult<GlobalType>

Returns the underlying wasm type of a Global instance.

+
Errors
+

If fail to get the type, then an error is returned.

+
source

pub fn get_value(&self) -> WasmValue

Returns the value of the Global instance.

+
source

pub fn set_value(&mut self, val: WasmValue) -> WasmEdgeResult<()>

Sets the value of the Global instance.

+

Notice that only the Global instance of Mutability::Var type can be set a new value. Setting a new value for a Global of Mutability::Const causes a failure.

+
Argument
+
    +
  • val - The new wasm value to be set.
  • +
+
Errors
+

If fail to set value, then an error is returned.

+
Example
+
use wasmedge_sys::{Global, GlobalType, WasmValue};
+use wasmedge_types::{ValType, Mutability};
+
+// create a GlobalType instance
+let ty = GlobalType::create(ValType::F32, Mutability::Var).expect("fail to create a GlobalType");
+// create a Global instance
+let mut global = Global::create(&ty, WasmValue::from_f32(3.1415)).expect("fail to create a Global");
+
+global.set_value(WasmValue::from_f32(314.15)).expect("fail to set a new value for a Global");
+assert_eq!(global.get_value().to_f32(), 314.15);
+
source

pub fn as_ptr(&self) -> *const WasmEdge_GlobalInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner global context.

+

Trait Implementations§

source§

impl Clone for Global

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Global

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Global

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Global

§

impl Send for Global

§

impl Sync for Global

§

impl Unpin for Global

§

impl !UnwindSafe for Global

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/global/struct.GlobalType.html b/wasmedge_sys/instance/global/struct.GlobalType.html new file mode 100644 index 000000000..85a18844a --- /dev/null +++ b/wasmedge_sys/instance/global/struct.GlobalType.html @@ -0,0 +1,29 @@ +GlobalType in wasmedge_sys::instance::global - Rust
pub struct GlobalType { /* private fields */ }
Expand description

Defines the type of a wasm global variable.

+

A GlobalType classifies a global variable that hold a value and can either be mutable or immutable.

+

Implementations§

source§

impl GlobalType

source

pub fn create(val_ty: ValType, mutable: Mutability) -> WasmEdgeResult<Self>

Create a new GlobalType to be associated with the given ValType and Mutability.

+
Arguments
+
    +
  • +

    val_type - The value type of the global variable.

    +
  • +
  • +

    mutability - The mutability of the global variable.

    +
  • +
+
Errors
+

If fail to create a new GlobalType, then an error is returned.

+
source

pub fn value_type(&self) -> ValType

Returns the value type of the GlobalType.

+
source

pub fn mutability(&self) -> Mutability

Returns the Mutability value of the GlobalType.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_GlobalTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner global type context.

+

Trait Implementations§

source§

impl Debug for GlobalType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for GlobalType

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<GlobalType> for GlobalType

source§

fn from(ty: GlobalType) -> Self

Converts to this type from the input type.
source§

impl From<GlobalType> for GlobalType

source§

fn from(ty: GlobalType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/index.html b/wasmedge_sys/instance/index.html new file mode 100644 index 000000000..3be237f18 --- /dev/null +++ b/wasmedge_sys/instance/index.html @@ -0,0 +1,2 @@ +wasmedge_sys::instance - Rust

Module wasmedge_sys::instance

source ·
Expand description

Defines WasmEdge instance structs, including Function, Global, Memory, Table, and etc.

+

Modules

  • Defines WasmEdge Function and FuncType structs.
  • Defines WasmEdge Global and GlobalType structs.
  • Defines WasmEdge Memory and MemType structs.
  • Defines WasmEdge Instance and other relevant types.
  • Defines WasmEdge Table and TableType structs.
\ No newline at end of file diff --git a/wasmedge_sys/instance/memory/index.html b/wasmedge_sys/instance/memory/index.html new file mode 100644 index 000000000..bd6bf2a40 --- /dev/null +++ b/wasmedge_sys/instance/memory/index.html @@ -0,0 +1,6 @@ +wasmedge_sys::instance::memory - Rust
Expand description

Defines WasmEdge Memory and MemType structs.

+

A WasmEdge Memory defines a linear memory as described by MemType. +MemType specifies the limits on the size of a memory by a range. The start of +the limit range specifies min size (initial size) of that memory, while the end +restricts the size to which the memory can grow later.

+

Structs

  • Defines the type of a wasm memory instance
  • Defines a WebAssembly memory instance, which is a linear memory described by its type. Each memory instance consists of a vector of bytes and an optional maximum size, and its size is a multiple of the WebAssembly page size (64KiB of each page).
\ No newline at end of file diff --git a/wasmedge_sys/instance/memory/sidebar-items.js b/wasmedge_sys/instance/memory/sidebar-items.js new file mode 100644 index 000000000..2b4491977 --- /dev/null +++ b/wasmedge_sys/instance/memory/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["MemType","Memory"]}; \ No newline at end of file diff --git a/wasmedge_sys/instance/memory/struct.MemType.html b/wasmedge_sys/instance/memory/struct.MemType.html new file mode 100644 index 000000000..eaae7dcd6 --- /dev/null +++ b/wasmedge_sys/instance/memory/struct.MemType.html @@ -0,0 +1,34 @@ +MemType in wasmedge_sys::instance::memory - Rust
pub struct MemType { /* private fields */ }
Expand description

Defines the type of a wasm memory instance

+

Implementations§

source§

impl MemType

source

pub fn create(min: u32, max: Option<u32>, shared: bool) -> WasmEdgeResult<Self>

Create a new MemType to be associated with the given limit range for the capacity.

+
Arguments
+
    +
  • +

    ‘min’ - The initial size of the linear memory.

    +
  • +
  • +

    ‘max’ - The upper bound of the linear memory size allowed to grow. If ‘max’ is set ‘None’, then the maximum size will be set u32::MAX.

    +
  • +
  • +

    shared - Whether the memory is shared or not. Reference Threading proposal for WebAssembly for details about shared memory. If shared is set true, then max MUST not be None.

    +
  • +
+
Errors
+

If fail to create a MemType, then an error is returned.

+
Example
+
let ty = MemType::create(0, Some(u32::MAX), false);
+
source

pub fn min(&self) -> u32

Returns the initial size of a Memory.

+
source

pub fn max(&self) -> Option<u32>

Returns the maximum size of a Memory allowed to grow.

+
source

pub fn shared(&self) -> bool

Returns whether the memory is shared or not.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_MemoryTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner memory type context.

+

Trait Implementations§

source§

impl Debug for MemType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for MemType

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<MemType> for MemoryType

source§

fn from(ty: MemType) -> Self

Converts to this type from the input type.
source§

impl From<MemoryType> for MemType

source§

fn from(ty: MemoryType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/memory/struct.Memory.html b/wasmedge_sys/instance/memory/struct.Memory.html new file mode 100644 index 000000000..2d92c28cf --- /dev/null +++ b/wasmedge_sys/instance/memory/struct.Memory.html @@ -0,0 +1,141 @@ +Memory in wasmedge_sys::instance::memory - Rust
pub struct Memory { /* private fields */ }
Expand description

Defines a WebAssembly memory instance, which is a linear memory described by its type. Each memory instance consists of a vector of bytes and an optional maximum size, and its size is a multiple of the WebAssembly page size (64KiB of each page).

+

Implementations§

source§

impl Memory

source

pub fn create(ty: &MemType) -> WasmEdgeResult<Self>

Create a new Memory to be associated with the given capacity limit.

+
Arguments
+
    +
  • ty - The type of the new Memory instance.
  • +
+
Errors
+ +
Example
+
use wasmedge_sys::{MemType, Memory};
+
+let ty = MemType::create(10, Some(20), false).expect("fail to create memory type");
+
+let memory = Memory::create(&ty);
+
+
source

pub fn ty(&self) -> WasmEdgeResult<MemType>

Returns the type of the Memory.

+
Errors
+

If fail to get the type from the Memory, then an error is returned.

+
source

pub fn get_data(&self, offset: u32, len: u32) -> WasmEdgeResult<Vec<u8>>

Copies the data from the Memory to the output buffer.

+
Arguments
+
    +
  • +

    offset - The data start offset in the Memory.

    +
  • +
  • +

    len - The requested data length.

    +
  • +
+
Errors
+

If the offset + len is larger than the data size in the Memory, then an error is returned.

+
source

pub fn set_data( + &mut self, + data: impl AsRef<[u8]>, + offset: u32 +) -> WasmEdgeResult<()>

Copies the data from the given input buffer into the Memory.

+
Arguments
+
    +
  • +

    data - The data buffer to copy.

    +
  • +
  • +

    offset - The data start offset in the Memory.

    +
  • +
+
Errors
+

If the sum of the offset and the data length is larger than the size of the Memory, +then an error is returned.

+ +
use wasmedge_sys::{Memory, MemType};
+use wasmedge_types::error::{CoreError, CoreExecutionError, WasmEdgeError};
+
+// create a Memory: the min size 1 and the max size 2
+let ty = MemType::create(1, Some(2), false).expect("fail to create a memory type");
+let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+
+// set data and the data length is larger than the data size in the memory
+let result = mem.set_data(vec![1; 10], u32::pow(2, 16) - 9);
+assert!(result.is_err());
+assert_eq!(result.unwrap_err(), Box::new(WasmEdgeError::Core(CoreError::Execution(CoreExecutionError::MemoryOutOfBounds))));
+
Example
+
use wasmedge_sys::{MemType, Memory};
+
+// create a Memory: the min size 1 and the max size 2
+let ty = MemType::create(1, Some(2), false).expect("fail to create a memory type");
+let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+// page count
+let count = mem.size();
+assert_eq!(count, 1);
+
+// set data
+mem.set_data(vec![1; 10], 10).expect("fail to set data");
+
+// get data
+let data = mem.get_data(10, 10).expect("fail to get data");
+assert_eq!(data, vec![1; 10]);
+
source

pub fn data_pointer(&self, offset: u32, len: u32) -> WasmEdgeResult<*const u8>

Returns the const data pointer to the Memory.

+
Arguments
+
    +
  • +

    offset - The data start offset in the Memory.

    +
  • +
  • +

    len - The requested data length. If the size of offset + len is larger +than the data size in the Memory

    +
  • +
+
Errors
+

If fail to get the data pointer, then an error is returned.

+
source

pub fn data_pointer_mut( + &mut self, + offset: u32, + len: u32 +) -> WasmEdgeResult<*mut u8>

Returns the data pointer to the Memory.

+
Arguments
+
    +
  • +

    offset - The data start offset in the Memory.

    +
  • +
  • +

    len - The requested data length. If the size of offset + len is larger than the data size in the Memory

    +
  • +
+
Errors
+

If fail to get the data pointer, then an error is returned.

+
source

pub fn size(&self) -> u32

Returns the size, in WebAssembly pages (64 KiB of each page), of this wasm memory.

+
source

pub fn grow(&mut self, count: u32) -> WasmEdgeResult<()>

Grows this WebAssembly memory by count pages.

+
Arguments
+
    +
  • count - The page counts to be extended to the Memory.
  • +
+
Errors
+

If fail to grow the page count, then an error is returned.

+
Example
+
use wasmedge_sys::{MemType, Memory};
+
+// create a Memory with a limit range [10, 20]
+let ty = MemType::create(10, Some(20), false).expect("fail to create a memory type");
+let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+// check page count
+let count = mem.size();
+assert_eq!(count, 10);
+
+// grow 5 pages
+mem.grow(10).expect("fail to grow the page count");
+assert_eq!(mem.size(), 20);
+
source

pub fn as_ptr(&self) -> *const WasmEdge_MemoryInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner memory context.

+

Trait Implementations§

source§

impl Clone for Memory

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Memory

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Memory

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Memory

§

impl Send for Memory

§

impl Sync for Memory

§

impl Unpin for Memory

§

impl !UnwindSafe for Memory

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/module/enum.WasiInstance.html b/wasmedge_sys/instance/module/enum.WasiInstance.html new file mode 100644 index 000000000..2b0fec369 --- /dev/null +++ b/wasmedge_sys/instance/module/enum.WasiInstance.html @@ -0,0 +1,19 @@ +WasiInstance in wasmedge_sys::instance::module - Rust
pub enum WasiInstance {
+    Wasi(WasiModule),
+}
Expand description

Defines three types of module instances that can be imported into a WasmEdge Store instance.

+

Variants§

§

Wasi(WasiModule)

Available on non-crate feature async only.

Defines the import module instance of WasiModule type.

+

Implementations§

source§

impl WasiInstance

source

pub fn name(&self) -> &str

Returns the name of the import object.

+
source

pub fn as_raw_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Returns the raw pointer to the inner WasmEdge_ModuleInstanceContext.

+

Trait Implementations§

source§

impl Clone for WasiInstance

source§

fn clone(&self) -> WasiInstance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiInstance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/module/index.html b/wasmedge_sys/instance/module/index.html new file mode 100644 index 000000000..d94fd3086 --- /dev/null +++ b/wasmedge_sys/instance/module/index.html @@ -0,0 +1,2 @@ +wasmedge_sys::instance::module - Rust
Expand description

Defines WasmEdge Instance and other relevant types.

+

Structs

Enums

  • Defines three types of module instances that can be imported into a WasmEdge Store instance.

Traits

\ No newline at end of file diff --git a/wasmedge_sys/instance/module/sidebar-items.js b/wasmedge_sys/instance/module/sidebar-items.js new file mode 100644 index 000000000..49cdc164c --- /dev/null +++ b/wasmedge_sys/instance/module/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["WasiInstance"],"struct":["ImportModule","Instance","WasiModule"],"trait":["AsImport","AsInstance"]}; \ No newline at end of file diff --git a/wasmedge_sys/instance/module/struct.ImportModule.html b/wasmedge_sys/instance/module/struct.ImportModule.html new file mode 100644 index 000000000..6b2d3dbfa --- /dev/null +++ b/wasmedge_sys/instance/module/struct.ImportModule.html @@ -0,0 +1,30 @@ +ImportModule in wasmedge_sys::instance::module - Rust
pub struct ImportModule<T: ?Sized + Send + Sync + Clone> { /* private fields */ }
Expand description

An ImportModule represents a host module with a name. A host module consists of one or more host function, table, memory, and global instances, which are defined outside wasm modules and fed into wasm modules as imports.

+

Implementations§

source§

impl<T: ?Sized + Send + Sync + Clone> ImportModule<T>

source

pub fn create( + name: impl AsRef<str>, + data: Option<Box<T>> +) -> WasmEdgeResult<Self>

Creates a module instance which is used to import host functions, tables, memories, and globals into a wasm module.

+
Argument
+
    +
  • +

    name - The name of the import module instance.

    +
  • +
  • +

    data - The host context data used in this function.

    +
  • +
+
Error
+

If fail to create the import module instance, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner module instance context.

+

Trait Implementations§

source§

impl<T: ?Sized + Send + Sync + Clone> AsImport for ImportModule<T>

source§

fn name(&self) -> &str

Returns the name of the module instance.
source§

fn add_func(&mut self, name: impl AsRef<str>, func: Function)

source§

fn add_table(&mut self, name: impl AsRef<str>, table: Table)

source§

fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)

source§

fn add_global(&mut self, name: impl AsRef<str>, global: Global)

source§

impl<T: Clone + ?Sized + Send + Sync + Clone> Clone for ImportModule<T>

source§

fn clone(&self) -> ImportModule<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + ?Sized + Send + Sync + Clone> Debug for ImportModule<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: ?Sized + Send + Sync + Clone> Drop for ImportModule<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for ImportModule<T>

§

impl<T> Send for ImportModule<T>

§

impl<T> Sync for ImportModule<T>

§

impl<T> Unpin for ImportModule<T>

§

impl<T> !UnwindSafe for ImportModule<T>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/module/struct.Instance.html b/wasmedge_sys/instance/module/struct.Instance.html new file mode 100644 index 000000000..44829e3ef --- /dev/null +++ b/wasmedge_sys/instance/module/struct.Instance.html @@ -0,0 +1,54 @@ +Instance in wasmedge_sys::instance::module - Rust
pub struct Instance { /* private fields */ }
Expand description

An Instance represents an instantiated module. In the instantiation process, An Instance is created from alModule. From an Instance the exported functions, tables, memories, and globals can be fetched.

+

Implementations§

source§

impl Instance

source

pub fn name(&self) -> Option<String>

Returns the name of this exported module instance.

+

If this module instance is an active module instance, then None is returned.

+
source

pub fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>

Returns the exported function instance by name.

+
Argument
+ +
Error
+

If fail to find the target function, then an error is returned.

+
source

pub fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>

Returns the exported table instance by name.

+
Argument
+ +
Error
+

If fail to find the target table instance, then an error is returned.

+
source

pub fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>

Returns the exported memory instance by name.

+
Argument
+ +
Error
+

If fail to find the target memory instance, then an error is returned.

+
source

pub fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>

Returns the exported global instance by name.

+
Argument
+ +
Error
+

If fail to find the target global instance, then an error is returned.

+
source

pub fn func_len(&self) -> u32

Returns the length of the exported function instances in this module instance.

+
source

pub fn func_names(&self) -> Option<Vec<String>>

Returns the names of the exported function instances in this module instance.

+
source

pub fn table_len(&self) -> u32

Returns the length of the exported table instances in this module instance.

+
source

pub fn table_names(&self) -> Option<Vec<String>>

Returns the names of the exported table instances in this module instance.

+
source

pub fn mem_len(&self) -> u32

Returns the length of the exported memory instances in this module instance.

+
source

pub fn mem_names(&self) -> Option<Vec<String>>

Returns the names of all exported memory instances in this module instance.

+
source

pub fn global_len(&self) -> u32

Returns the length of the exported global instances in this module instance.

+
source

pub fn global_names(&self) -> Option<Vec<String>>

Returns the names of the exported global instances in this module instance.

+
source

pub fn host_data<T: Send + Sync + Clone>(&mut self) -> Option<&mut T>

Returns the host data held by the module instance.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner module instance context.

+

Trait Implementations§

source§

impl Clone for Instance

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Instance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Instance

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/module/struct.WasiModule.html b/wasmedge_sys/instance/module/struct.WasiModule.html new file mode 100644 index 000000000..237b139d4 --- /dev/null +++ b/wasmedge_sys/instance/module/struct.WasiModule.html @@ -0,0 +1,62 @@ +WasiModule in wasmedge_sys::instance::module - Rust
pub struct WasiModule { /* private fields */ }
Expand description

A WasiModule is a module instance for the WASI specification.

+

Implementations§

source§

impl WasiModule

source

pub fn create( + args: Option<Vec<&str>>, + envs: Option<Vec<&str>>, + preopens: Option<Vec<&str>> +) -> WasmEdgeResult<Self>

Creates a WASI host module which contains the WASI host functions, and initializes it with the given parameters.

+
Arguments
+
    +
  • +

    args - The commandline arguments. The first argument is the program name.

    +
  • +
  • +

    envs - The environment variables in the format ENV_VAR_NAME=VALUE.

    +
  • +
  • +

    preopens - The directories to pre-open. The required format is GUEST_PATH:HOST_PATH.

    +
  • +
+
Error
+

If fail to create a host module, then an error is returned.

+
source

pub fn name(&self) -> &str

Returns the name of the module instance.

+
source

pub fn init_wasi( + &mut self, + args: Option<Vec<&str>>, + envs: Option<Vec<&str>>, + preopens: Option<Vec<&str>> +)

Initializes the WASI host module with the given parameters.

+
Arguments
+
    +
  • +

    args - The commandline arguments. The first argument is the program name.

    +
  • +
  • +

    envs - The environment variables in the format ENV_VAR_NAME=VALUE.

    +
  • +
  • +

    preopens - The directories to pre-open. The required format is GUEST_PATH:HOST_PATH.

    +
  • +
+
source

pub fn exit_code(&self) -> u32

Returns the WASI exit code.

+

The WASI exit code can be accessed after running the “_start” function of a wasm32-wasi program.

+
source

pub fn get_native_handler(&self, fd: i32) -> WasmEdgeResult<u64>

Returns the native handler from the mapped FD/Handler.

+
Argument
+
    +
  • fd - The WASI mapped Fd.
  • +
+
Error
+

If fail to get the native handler, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner module instance context.

+

Trait Implementations§

source§

impl Clone for WasiModule

source§

fn clone(&self) -> WasiModule

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiModule

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for WasiModule

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/module/trait.AsImport.html b/wasmedge_sys/instance/module/trait.AsImport.html new file mode 100644 index 000000000..b80c35051 --- /dev/null +++ b/wasmedge_sys/instance/module/trait.AsImport.html @@ -0,0 +1,50 @@ +AsImport in wasmedge_sys::instance::module - Rust
pub trait AsImport {
+    // Required methods
+    fn name(&self) -> &str;
+    fn add_func(&mut self, name: impl AsRef<str>, func: Function);
+    fn add_table(&mut self, name: impl AsRef<str>, table: Table);
+    fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory);
+    fn add_global(&mut self, name: impl AsRef<str>, global: Global);
+}
Expand description

The module to be registered via the the Executor::register_import_module function is required to implement this trait.

+

Required Methods§

source

fn name(&self) -> &str

Returns the name of the module instance.

+
source

fn add_func(&mut self, name: impl AsRef<str>, func: Function)

Imports a host function instance.

+
Arguments
+
    +
  • +

    name - The name of the host function instance to import.

    +
  • +
  • +

    func - The host function instance to import.

    +
  • +
+
source

fn add_table(&mut self, name: impl AsRef<str>, table: Table)

Imports a table instance.

+
Arguments
+
    +
  • +

    name - The name of the host table instance to import.

    +
  • +
  • +

    table - The host table instance to import.

    +
  • +
+
source

fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)

Imports a memory instance.

+
Arguments
+
    +
  • +

    name - The name of the host memory instance to import.

    +
  • +
  • +

    memory - The host memory instance to import.

    +
  • +
+
source

fn add_global(&mut self, name: impl AsRef<str>, global: Global)

Imports a global instance.

+
Arguments
+
    +
  • +

    name - The name of the host global instance to import.

    +
  • +
  • +

    global - The host global instance to import.

    +
  • +
+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/wasmedge_sys/instance/module/trait.AsInstance.html b/wasmedge_sys/instance/module/trait.AsInstance.html new file mode 100644 index 000000000..978360fa9 --- /dev/null +++ b/wasmedge_sys/instance/module/trait.AsInstance.html @@ -0,0 +1,52 @@ +AsInstance in wasmedge_sys::instance::module - Rust
pub trait AsInstance {
+    // Required methods
+    fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>;
+    fn func_len(&self) -> u32;
+    fn func_names(&self) -> Option<Vec<String>>;
+    fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>;
+    fn table_len(&self) -> u32;
+    fn table_names(&self) -> Option<Vec<String>>;
+    fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>;
+    fn mem_len(&self) -> u32;
+    fn mem_names(&self) -> Option<Vec<String>>;
+    fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>;
+    fn global_len(&self) -> u32;
+    fn global_names(&self) -> Option<Vec<String>>;
+}
Expand description

The object as an module instance is required to implement this trait.

+

Required Methods§

source

fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>

Returns the exported function instance by name.

+
Argument
+ +
Error
+

If fail to find the target function, then an error is returned.

+
source

fn func_len(&self) -> u32

Returns the length of the exported function instances in this module instance.

+
source

fn func_names(&self) -> Option<Vec<String>>

Returns the names of the exported function instances in this module instance.

+
source

fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>

Returns the exported table instance by name.

+
Argument
+ +
Error
+

If fail to find the target table instance, then an error is returned.

+
source

fn table_len(&self) -> u32

Returns the length of the exported table instances in this module instance.

+
source

fn table_names(&self) -> Option<Vec<String>>

Returns the names of the exported table instances in this module instance.

+
source

fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>

Returns the exported memory instance by name.

+
Argument
+ +
Error
+

If fail to find the target memory instance, then an error is returned.

+
source

fn mem_len(&self) -> u32

Returns the length of the exported memory instances in this module instance.

+
source

fn mem_names(&self) -> Option<Vec<String>>

Returns the names of all exported memory instances in this module instance.

+
source

fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>

Returns the exported global instance by name.

+
Argument
+ +
Error
+

If fail to find the target global instance, then an error is returned.

+
source

fn global_len(&self) -> u32

Returns the length of the exported global instances in this module instance.

+
source

fn global_names(&self) -> Option<Vec<String>>

Returns the names of the exported global instances in this module instance.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/wasmedge_sys/instance/sidebar-items.js b/wasmedge_sys/instance/sidebar-items.js new file mode 100644 index 000000000..6c0d9aa46 --- /dev/null +++ b/wasmedge_sys/instance/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["function","global","memory","module","table"]}; \ No newline at end of file diff --git a/wasmedge_sys/instance/table/index.html b/wasmedge_sys/instance/table/index.html new file mode 100644 index 000000000..055e8a010 --- /dev/null +++ b/wasmedge_sys/instance/table/index.html @@ -0,0 +1,6 @@ +wasmedge_sys::instance::table - Rust
Expand description

Defines WasmEdge Table and TableType structs.

+

A WasmEdge Table defines a WebAssembly table instance described by its TableType. +TableType specifies the limits on the size of a table. The start of +the limit range specifies the lower bound (inclusive) of the size, while +the end resticts the upper bound (inclusive).

+

Structs

  • A WasmEdge Table defines a WebAssembly table instance described by its type. A table is an array-like structure and stores function references.
  • A WasmEdge TableType classifies a Table instance over elements of element types within a size range.
\ No newline at end of file diff --git a/wasmedge_sys/instance/table/sidebar-items.js b/wasmedge_sys/instance/table/sidebar-items.js new file mode 100644 index 000000000..573a729ff --- /dev/null +++ b/wasmedge_sys/instance/table/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Table","TableType"]}; \ No newline at end of file diff --git a/wasmedge_sys/instance/table/struct.Table.html b/wasmedge_sys/instance/table/struct.Table.html new file mode 100644 index 000000000..d38c73140 --- /dev/null +++ b/wasmedge_sys/instance/table/struct.Table.html @@ -0,0 +1,75 @@ +Table in wasmedge_sys::instance::table - Rust
pub struct Table { /* private fields */ }
Expand description

A WasmEdge Table defines a WebAssembly table instance described by its type. A table is an array-like structure and stores function references.

+

This example shows how to use Table to store and retrieve function references.

+

Implementations§

source§

impl Table

source

pub fn create(ty: &TableType) -> WasmEdgeResult<Self>

Creates a new Table to be associated with the given element type and the size.

+
Arguments
+
    +
  • ty specifies the type of the new Table.
  • +
+
Error
+
    +
  • If fail to create the table instance, then WasmEdgeError::Table(TableError::Create)(crate::error::TableError) is returned.
  • +
+
Example
+
use wasmedge_sys::{TableType, Table};
+use wasmedge_types::RefType;
+
+// create a TableType instance
+let ty = TableType::create(RefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+
+// create a Table instance
+let table = Table::create(&ty).expect("fail to create a Table");
+
source

pub fn ty(&self) -> WasmEdgeResult<TableType>

Returns the TableType of the Table.

+
Error
+

If fail to get type, then an error is returned.

+
source

pub fn get_data(&self, idx: u32) -> WasmEdgeResult<WasmValue>

Returns the element value at a specific position in the Table.

+
Arguments
+
    +
  • idx specifies the position in the Table, at which the WasmValue is returned.
  • +
+
Error
+

If fail to get the data, then an error is returned.

+
source

pub fn set_data(&mut self, data: WasmValue, idx: u32) -> WasmEdgeResult<()>

Sets a new element value at a specific position in the Table.

+
Arguments
+
    +
  • +

    data specifies the new data.

    +
  • +
  • +

    idx specifies the position of the new data to be stored in the Table.

    +
  • +
+
Error
+

If fail to set data, then an error is returned.

+
source

pub fn capacity(&self) -> usize

Returns the capacity of the Table.

+
Example
+
use wasmedge_sys::{TableType, Table};
+use wasmedge_types::RefType;
+
+// create a TableType instance and a Table
+let ty = TableType::create(RefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+let table = Table::create(&ty).expect("fail to create a Table");
+
+// check capacity
+assert_eq!(table.capacity(), 10);
+
source

pub fn grow(&mut self, size: u32) -> WasmEdgeResult<()>

Increases the capacity of the Table.

+

After growing, the new capacity must be in the range defined by limit when the table is created.

+
Argument
+
    +
  • size specifies the size to be added to the Table.
  • +
+
Error
+

If fail to increase the size of the Table, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_TableInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner table context.

+

Trait Implementations§

source§

impl Clone for Table

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Table

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Table

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl !UnwindSafe for Table

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/instance/table/struct.TableType.html b/wasmedge_sys/instance/table/struct.TableType.html new file mode 100644 index 000000000..411c35532 --- /dev/null +++ b/wasmedge_sys/instance/table/struct.TableType.html @@ -0,0 +1,38 @@ +TableType in wasmedge_sys::instance::table - Rust
pub struct TableType { /* private fields */ }
Expand description

A WasmEdge TableType classifies a Table instance over elements of element types within a size range.

+

Implementations§

source§

impl TableType

source

pub fn create( + elem_ty: RefType, + min: u32, + max: Option<u32> +) -> WasmEdgeResult<Self>

Creates a new TableType to be associated with the given limit range of the size and the reference type.

+
Arguments
+
    +
  • +

    elem_type - The element type.

    +
  • +
  • +

    min - The initial size of the table to be created.

    +
  • +
  • +

    max - The maximum size of the table to be created.

    +
  • +
+
Error
+

If fail to create a TableType, then an error is returned.

+
Example
+
let ty = TableType::create(WasmRefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+
source

pub fn elem_ty(&self) -> RefType

Returns the element type.

+
source

pub fn min(&self) -> u32

Returns the initial size of the Table.

+
source

pub fn max(&self) -> Option<u32>

Returns the maximum size of the Table.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_TableTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner table type context.

+

Trait Implementations§

source§

impl Debug for TableType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for TableType

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<TableType> for TableType

source§

fn from(ty: TableType) -> Self

Converts to this type from the input type.
source§

impl From<TableType> for TableType

source§

fn from(ty: TableType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/loader/struct.Loader.html b/wasmedge_sys/loader/struct.Loader.html new file mode 100644 index 000000000..613caa617 --- /dev/null +++ b/wasmedge_sys/loader/struct.Loader.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.Loader.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/plugin/enum.ProgramOptionType.html b/wasmedge_sys/plugin/enum.ProgramOptionType.html new file mode 100644 index 000000000..1b192c4ca --- /dev/null +++ b/wasmedge_sys/plugin/enum.ProgramOptionType.html @@ -0,0 +1,30 @@ +ProgramOptionType in wasmedge_sys::plugin - Rust
pub enum ProgramOptionType {
+
Show 13 variants None = 0, + Toggle = 1, + I8 = 2, + I16 = 3, + I32 = 4, + I64 = 5, + U8 = 6, + U16 = 7, + U32 = 8, + U64 = 9, + F32 = 10, + F64 = 11, + String = 12, +
}
Expand description

Defines the type of the program options.

+

Variants§

§

None = 0

§

Toggle = 1

§

I8 = 2

§

I16 = 3

§

I32 = 4

§

I64 = 5

§

U8 = 6

§

U16 = 7

§

U32 = 8

§

U64 = 9

§

F32 = 10

§

F64 = 11

§

String = 12

Trait Implementations§

source§

impl Clone for ProgramOptionType

source§

fn clone(&self) -> ProgramOptionType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProgramOptionType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ProgramOptionType> for WasmEdge_ProgramOptionType

source§

fn from(value: ProgramOptionType) -> Self

Converts to this type from the input type.
source§

impl From<u32> for ProgramOptionType

source§

fn from(ty: WasmEdge_ProgramOptionType) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ProgramOptionType

source§

fn eq(&self, other: &ProgramOptionType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for ProgramOptionType

source§

impl Eq for ProgramOptionType

source§

impl StructuralEq for ProgramOptionType

source§

impl StructuralPartialEq for ProgramOptionType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/plugin/index.html b/wasmedge_sys/plugin/index.html new file mode 100644 index 000000000..ff9194417 --- /dev/null +++ b/wasmedge_sys/plugin/index.html @@ -0,0 +1,2 @@ +wasmedge_sys::plugin - Rust

Module wasmedge_sys::plugin

source ·
Expand description

Defines PluginManager and Plugin structs.

+

Structs

Enums

Type Aliases

\ No newline at end of file diff --git a/wasmedge_sys/plugin/sidebar-items.js b/wasmedge_sys/plugin/sidebar-items.js new file mode 100644 index 000000000..6d18e99bc --- /dev/null +++ b/wasmedge_sys/plugin/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ProgramOptionType"],"struct":["ModuleDescriptor","Plugin","PluginDescriptor","PluginManager","PluginModule","PluginVersion","ProgramOption"],"type":["ModuleInstanceCreateFn"]}; \ No newline at end of file diff --git a/wasmedge_sys/plugin/struct.ModuleDescriptor.html b/wasmedge_sys/plugin/struct.ModuleDescriptor.html new file mode 100644 index 000000000..39be4f3aa --- /dev/null +++ b/wasmedge_sys/plugin/struct.ModuleDescriptor.html @@ -0,0 +1,19 @@ +ModuleDescriptor in wasmedge_sys::plugin - Rust
pub struct ModuleDescriptor { /* private fields */ }
Expand description

Defines the module descriptor for plugins.

+

Implementations§

source§

impl ModuleDescriptor

source

pub fn create( + name: impl AsRef<str>, + desc: impl AsRef<str>, + f: Option<ModuleInstanceCreateFn> +) -> WasmEdgeResult<Self>

Creates a new module descriptor.

+
source

pub fn as_raw_ptr(&self) -> *const WasmEdge_ModuleDescriptor

Available on crate feature ffi only.

Returns the raw pointer to the inner WasmEdge_ModuleDescriptor.

+

Trait Implementations§

source§

impl Debug for ModuleDescriptor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/plugin/struct.Plugin.html b/wasmedge_sys/plugin/struct.Plugin.html new file mode 100644 index 000000000..01b8f111a --- /dev/null +++ b/wasmedge_sys/plugin/struct.Plugin.html @@ -0,0 +1,24 @@ +Plugin in wasmedge_sys::plugin - Rust

Struct wasmedge_sys::plugin::Plugin

source ·
pub struct Plugin { /* private fields */ }
Expand description

Represents a loaded plugin. It provides the APIs for accessing the plugin.

+

Implementations§

source§

impl Plugin

source

pub fn name(&self) -> String

Returns the name of this plugin.

+
source

pub fn mod_count(&self) -> u32

Returns the count of the module instances in this plugin.

+
source

pub fn mod_names(&self) -> Vec<String>

Returns the names of all module instances in this plugin.

+
source

pub fn mod_instance(&self, name: impl AsRef<str>) -> WasmEdgeResult<Instance>

Returns a plugin module instance that is generated from the module with the given name in this plugin.

+
Argument
+
    +
  • name - The name of the target module.
  • +
+
Error
+

If failed to return the plugin module instance, then return PluginError::Create error.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_PluginContext

Available on crate feature ffi only.

Provides a raw pointer to the inner Plugin context.

+

Trait Implementations§

source§

impl Debug for Plugin

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/plugin/struct.PluginDescriptor.html b/wasmedge_sys/plugin/struct.PluginDescriptor.html new file mode 100644 index 000000000..fa144dd00 --- /dev/null +++ b/wasmedge_sys/plugin/struct.PluginDescriptor.html @@ -0,0 +1,28 @@ +PluginDescriptor in wasmedge_sys::plugin - Rust
pub struct PluginDescriptor { /* private fields */ }
Expand description

Represents Plugin descriptor for plugins.

+

Implementations§

source§

impl PluginDescriptor

source

pub fn create( + name: impl AsRef<str>, + desc: impl AsRef<str>, + version: PluginVersion +) -> WasmEdgeResult<Self>

source

pub fn add_module_descriptor( + self, + name: impl AsRef<str>, + desc: impl AsRef<str>, + f: Option<ModuleInstanceCreateFn> +) -> WasmEdgeResult<Self>

source

pub fn add_program_option( + self, + name: impl AsRef<str>, + desc: impl AsRef<str>, + ty: ProgramOptionType +) -> WasmEdgeResult<Self>

source

pub fn as_raw_ptr(&self) -> *const WasmEdge_PluginDescriptor

Available on crate feature ffi only.

Returns the raw pointer to the inner WasmEdge_PluginDescriptor.

+

Trait Implementations§

source§

impl Debug for PluginDescriptor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/plugin/struct.PluginManager.html b/wasmedge_sys/plugin/struct.PluginManager.html new file mode 100644 index 000000000..0c231a3b9 --- /dev/null +++ b/wasmedge_sys/plugin/struct.PluginManager.html @@ -0,0 +1,61 @@ +PluginManager in wasmedge_sys::plugin - Rust
pub struct PluginManager {}
Expand description

Defines the APIs for loading plugins and check the basic information of the loaded plugins.

+

Implementations§

source§

impl PluginManager

source

pub fn load_plugins_from_default_paths()

Load plugins from the default path. The default plugin path could be one of the following:

+
    +
  • +

    The environment variable “WASMEDGE_PLUGIN_PATH”.

    +
  • +
  • +

    The ../plugin/ directory related to the WasmEdge installation path.

    +
  • +
  • +

    The wasmedge/ directory under the library path if the WasmEdge is installed under the “/usr”.

    +
  • +
+
source

pub fn load_plugins(path: impl AsRef<Path>) -> WasmEdgeResult<()>

Load a single or multiple plugins from a given path.

+
    +
  • +

    If the path is pointing at a file , then it indicates that a single plugin will be loaded from the file.

    +
  • +
  • +

    If the path is pointing at a directory, then the method will load plugins from the files in the directory.

    +
  • +
+
Argument
+
    +
  • param - A path to a plugin file or a directory holding plugin files.
  • +
+
Error
+ +
source

pub fn nn_preload(preloads: Vec<&str>)

Available on crate feature wasi_nn only.
source

pub fn count() -> u32

Returns the count of loaded plugins.

+
source

pub fn names() -> Vec<String>

Returns the names of all loaded plugins.

+
source

pub fn find(name: impl AsRef<str>) -> WasmEdgeResult<Plugin>

Returns the target plugin by its name.

+
Argument
+
    +
  • name - The name of the target plugin.
  • +
+
Error
+

If not found the plugin, then return PluginError::NotFound error.

+
source

pub fn init_wasmedge_process(allowed_cmds: Option<Vec<&str>>, allowed: bool)

Available on Linux and crate feature wasmedge_process and non-crate feature static only.

Initializes the wasmedge_process plugin module instance with the parameters.

+
Arguments
+
    +
  • +

    allowed_cmds - A white list of commands.

    +
  • +
  • +

    allowed - Determines if wasmedge_process is allowed to execute all commands on the white list.

    +
  • +
+

Trait Implementations§

source§

impl Debug for PluginManager

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/plugin/struct.PluginModule.html b/wasmedge_sys/plugin/struct.PluginModule.html new file mode 100644 index 000000000..8601b2892 --- /dev/null +++ b/wasmedge_sys/plugin/struct.PluginModule.html @@ -0,0 +1,34 @@ +PluginModule in wasmedge_sys::plugin - Rust
pub struct PluginModule { /* private fields */ }
Expand description

Represents a Plugin module instance.

+

Implementations§

source§

impl PluginModule

source

pub fn create<T>( + name: impl AsRef<str>, + host_data: Option<Box<T>> +) -> WasmEdgeResult<Self>where + T: ?Sized + Send + Sync + Clone,

Creates a module instance which is used to import host functions, tables, memories, and globals into a wasm module.

+
Argument
+
    +
  • +

    name - The name of the import module instance.

    +
  • +
  • +

    host_data - The host context data to be used in the module instance.

    +
  • +
  • +

    finalizer - the function to drop the host data. This argument is only available when host_data is set.

    +
  • +
+
Error
+

If fail to create the import module instance, then an error is returned.

+
source

pub fn as_raw_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner module instance context.

+

Trait Implementations§

source§

impl AsImport for PluginModule

source§

fn name(&self) -> &str

Returns the name of the module instance.
source§

fn add_func(&mut self, name: impl AsRef<str>, func: Function)

source§

fn add_table(&mut self, name: impl AsRef<str>, table: Table)

source§

fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)

source§

fn add_global(&mut self, name: impl AsRef<str>, global: Global)

source§

impl Clone for PluginModule

source§

fn clone(&self) -> PluginModule

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PluginModule

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for PluginModule

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/plugin/struct.PluginVersion.html b/wasmedge_sys/plugin/struct.PluginVersion.html new file mode 100644 index 000000000..fff3344b7 --- /dev/null +++ b/wasmedge_sys/plugin/struct.PluginVersion.html @@ -0,0 +1,19 @@ +PluginVersion in wasmedge_sys::plugin - Rust
pub struct PluginVersion {
+    pub major: u32,
+    pub minor: u32,
+    pub patch: u32,
+    pub build: u32,
+}
Expand description

Defines the version of a plugin.

+

Fields§

§major: u32§minor: u32§patch: u32§build: u32

Implementations§

source§

impl PluginVersion

source

pub fn create(major: u32, minor: u32, patch: u32, build: u32) -> Self

Creates a new plugin version.

+

Trait Implementations§

source§

impl Debug for PluginVersion

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PluginVersion> for WasmEdge_PluginVersionData

source§

fn from(value: PluginVersion) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/plugin/struct.ProgramOption.html b/wasmedge_sys/plugin/struct.ProgramOption.html new file mode 100644 index 000000000..25ea00e19 --- /dev/null +++ b/wasmedge_sys/plugin/struct.ProgramOption.html @@ -0,0 +1,21 @@ +ProgramOption in wasmedge_sys::plugin - Rust
pub struct ProgramOption {
+    pub inner: WasmEdge_ProgramOption,
+    /* private fields */
+}
Expand description

Defines the program option for plugins.

+

Fields§

§inner: WasmEdge_ProgramOption

Implementations§

source§

impl ProgramOption

source

pub fn create( + name: impl AsRef<str>, + desc: impl AsRef<str>, + ty: ProgramOptionType +) -> WasmEdgeResult<Self>

Creates a new program option.

+

Trait Implementations§

source§

impl Debug for ProgramOption

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Send for ProgramOption

source§

impl Sync for ProgramOption

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/plugin/type.ModuleInstanceCreateFn.html b/wasmedge_sys/plugin/type.ModuleInstanceCreateFn.html new file mode 100644 index 000000000..a9edecd47 --- /dev/null +++ b/wasmedge_sys/plugin/type.ModuleInstanceCreateFn.html @@ -0,0 +1,2 @@ +ModuleInstanceCreateFn in wasmedge_sys::plugin - Rust
pub type ModuleInstanceCreateFn = unsafe extern "C" fn(arg1: *const WasmEdge_ModuleDescriptor) -> *mut WasmEdge_ModuleInstanceContext;
Expand description

Defines the type of the function that creates a module instance for a plugin.

+
\ No newline at end of file diff --git a/wasmedge_sys/sidebar-items.js b/wasmedge_sys/sidebar-items.js new file mode 100644 index 000000000..b529a9d95 --- /dev/null +++ b/wasmedge_sys/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["WasiInstance"],"mod":["ffi","frame","instance","plugin","types","utils"],"struct":["CallingFrame","Compiler","Config","Executor","ExportType","FuncRef","FuncType","Function","Global","GlobalType","ImportModule","ImportType","Instance","Loader","MemType","Memory","Module","Statistics","Store","Table","TableType","Validator","WasiModule","WasmValue"],"trait":["AsImport","AsInstance","Engine"]}; \ No newline at end of file diff --git a/wasmedge_sys/statistics/struct.Statistics.html b/wasmedge_sys/statistics/struct.Statistics.html new file mode 100644 index 000000000..40d4957ed --- /dev/null +++ b/wasmedge_sys/statistics/struct.Statistics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.Statistics.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/store/struct.Store.html b/wasmedge_sys/store/struct.Store.html new file mode 100644 index 000000000..009b4b061 --- /dev/null +++ b/wasmedge_sys/store/struct.Store.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.Store.html...

+ + + \ No newline at end of file diff --git a/wasmedge_sys/struct.CallingFrame.html b/wasmedge_sys/struct.CallingFrame.html new file mode 100644 index 000000000..1c8d29bd9 --- /dev/null +++ b/wasmedge_sys/struct.CallingFrame.html @@ -0,0 +1,30 @@ +CallingFrame in wasmedge_sys - Rust
pub struct CallingFrame { /* private fields */ }
Expand description

Represents a calling frame on top of stack.

+

Implementations§

source§

impl CallingFrame

source

pub fn executor_mut(&self) -> Option<Executor>

Returns the executor instance from this calling frame.

+
source

pub fn module_instance(&self) -> Option<Instance>

Returns the module instance in this calling frame.

+

If the executing function instance is a host function and not added into any module instance, then returns None.

+

When a wasm function is executing and trying to call a host function inside, a frame with the module +instance the wasm function belongs to will be pushed onto the stack. And therefore the calling frame +context will record that module instance.

+
source

pub fn memory_mut(&self, idx: u32) -> Option<Memory>

Returns the memory instance by the given index from the module instance of the current +calling frame. If the memory instance is not found, returns None.

+

By default, a WASM module has only one memory instance after instantiation. Therefore, users can pass in 0 as +the index to get the memory instance in host function body. When the MultiMemories +config option is enabled, there would be more than one memory instances in the wasm module. Users can retrieve +the target memory instance by specifying the index of the memory instance in the wasm module instance.

+
Arguments
+
    +
  • idx - The index of the memory instance.
  • +
+
source

pub fn as_ptr(&self) -> *const WasmEdge_CallingFrameContext

Available on crate feature ffi only.

Provides a raw pointer to the inner CallingFrame context.

+

Trait Implementations§

source§

impl Debug for CallingFrame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for CallingFrame

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Compiler.html b/wasmedge_sys/struct.Compiler.html new file mode 100644 index 000000000..e79284279 --- /dev/null +++ b/wasmedge_sys/struct.Compiler.html @@ -0,0 +1,49 @@ +Compiler in wasmedge_sys - Rust

Struct wasmedge_sys::Compiler

source ·
pub struct Compiler { /* private fields */ }
Available on crate feature aot only.
Expand description

Defines WasmEdge ahead-of-time(AOT) compiler and the relevant APIs.

+

Implementations§

source§

impl Compiler

source

pub fn create(config: Option<&Config>) -> WasmEdgeResult<Self>

Creates a new AOT compiler.

+
Error
+

If fail to create a AOT compiler, then an error is returned.

+
source

pub fn compile_from_file( + &self, + wasm_file: impl AsRef<Path>, + aot_file: impl AsRef<Path> +) -> WasmEdgeResult<()>

Compiles the input WASM from the given file path for the AOT mode and stores the result to the output file path.

+
Arguments
+
    +
  • +

    wasm_file - The input wasm file, of which the file extension should be one of wasm orwat.

    +
  • +
  • +

    aot_file - The generated AOT wasm file, of which the file extension should be dylib on macOS, so on Linux or dll on Windows.

    +
  • +
+
Error
+

If fail to compile, then an error is returned.

+
source

pub fn compile_from_bytes( + &self, + wasm_bytes: impl AsRef<[u8]>, + aot_file: impl AsRef<Path> +) -> WasmEdgeResult<()>

Compiles the input WASM from the given bytes for the AOT mode and stores the result to the output file path.

+
Argument
+
    +
  • +

    wasm_bytes - The in-memory WASM bytes.

    +
  • +
  • +

    aot_file - The generated AOT wasm file, of which the file extension should be dylib on macOS, so on Linux or dll on Windows.

    +
  • +
+
Error
+

If fail to compile, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_CompilerContext

Available on crate feature ffi only.

Provides a raw pointer to the inner Compiler context.

+

Trait Implementations§

source§

impl Debug for Compiler

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Compiler

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Config.html b/wasmedge_sys/struct.Config.html new file mode 100644 index 000000000..738ef7592 --- /dev/null +++ b/wasmedge_sys/struct.Config.html @@ -0,0 +1,335 @@ +Config in wasmedge_sys - Rust

Struct wasmedge_sys::Config

source ·
pub struct Config { /* private fields */ }
Expand description

Defines Config struct used to check/set the configuration options.

+

Config manages the configuration options, which are used to initiate Loader, Validator, Executor, and Compiler.

+

The configuration options are categorized into the following four groups:

+
    +
  • +

    WebAssembly Proposals

    +

    This group of options are used to turn on/off the WebAssembly proposals. They are effective to any WasmEdge +context created with Config.

    + +
  • +
  • +

    Host Registrations

    +
      +
    • +

      Wasi turns on the WASI support.

      +
    • +
    • +

      WasmEdgeProcess turns on the wasmedge_process support.

      +
    • +
    +
  • +
  • +

    Memory Management

    +
      +
    • maximum_memory_page limits the page size of Memory.
    • +
    +
  • +
  • +

    AOT Compilation

    +

    The AOT compiler options configure the behavior about optimization level, output format, dump IR, +and generic binary.

    +
      +
    • +

      Compiler Optimization Levels

      +
        +
      • +

        O0 performs as many optimizations as possible.

        +
      • +
      • +

        O1 optimizes quickly without destroying debuggability.

        +
      • +
      • +

        02 optimizes for fast execution as much as possible without triggering significant incremental +compile time or code size growth.

        +
      • +
      • +

        O3 optimizes for fast execution as much as possible.

        +
      • +
      • +

        Os optimizes for small code size as much as possible without triggering significant incremental +compile time or execution time slowdowns.

        +
      • +
      • +

        Oz optimizes for small code size as much as possible.

        +
      • +
      +
    • +
    • +

      Compiler Output Formats

      +
        +
      • +

        Native specifies the output format is native dynamic library (*.wasm.so).

        +
      • +
      • +

        Wasm specifies the output format is WebAssembly with AOT compiled codes in custom section (*.wasm).

        +
      • +
      +
    • +
    • +

      dump_ir determines if AOT compiler generates IR or not.

      +
    • +
    • +

      generic_binary determines if AOT compiler generates the generic binary or not.

      +
    • +
    • +

      interruptible determines if AOT compiler generates interruptible binary or not.

      +
    • +
    +

    The configuration options above are only effective to Compiler.

    +
  • +
  • +

    Runtime Statistics

    +
      +
    • +

      instr_counting determines if measuring the count of instructions when running a compiled or pure WASM.

      +
    • +
    • +

      cost_measuring determines if measuring the instruction costs when running a compiled or pure WASM.

      +
    • +
    • +

      time_measuring determines if measuring the running time when running a compiled or pure WASM.

      +
    • +
    +
  • +
+

API users can first set the options of interest, such as those related to the WebAssembly proposals, +host registrations, AOT compiler options, and etc., then apply the configuration +to create other WasmEdge runtime structs.

+

Implementations§

source§

impl Config

source

pub fn create() -> WasmEdgeResult<Self>

Creates a new Config.

+
Error
+

If fail to create, then an error is returned.

+
source

pub fn wasi(&mut self, enable: bool)

Enables or disables host registration wasi. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn wasi_enabled(&self) -> bool

Checks if host registration wasi turns on or not.

+
source

pub fn set_max_memory_pages(&mut self, count: u32)

Sets the maximum number of the memory pages available.

+
Argument
+
    +
  • count - The page count (64KB per page).
  • +
+
source

pub fn get_max_memory_pages(&self) -> u32

Returns the number of the memory pages available.

+
source

pub fn mutable_globals(&mut self, enable: bool)

Enables or disables the ImportExportMutGlobals option. By default, the option is enabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn mutable_globals_enabled(&self) -> bool

Checks if the ImportExportMutGlobals option turns on or not.

+
source

pub fn non_trap_conversions(&mut self, enable: bool)

Enables or disables the NonTrapFloatToIntConversions option. By default, the option is enabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn non_trap_conversions_enabled(&self) -> bool

Checks if the NonTrapFloatToIntConversions option turns on or not.

+
source

pub fn sign_extension_operators(&mut self, enable: bool)

Enables or disables the SignExtensionOperators option. By default, the option is enabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn sign_extension_operators_enabled(&self) -> bool

Checks if the SignExtensionOperators option turns on or not.

+
source

pub fn multi_value(&mut self, enable: bool)

Enables or disables the MultiValue option. By default, the option is enabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn multi_value_enabled(&self) -> bool

Checks if the MultiValue option turns on or not.

+
source

pub fn bulk_memory_operations(&mut self, enable: bool)

Enables or disables the BulkMemoryOperations option. By default, the option is enabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn bulk_memory_operations_enabled(&self) -> bool

Checks if the BulkMemoryOperations option turns on or not.

+
source

pub fn reference_types(&mut self, enable: bool)

Enables or disables the ReferenceTypes option. By default, the option is enabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn reference_types_enabled(&self) -> bool

Checks if the ReferenceTypes option turns on or not.

+
source

pub fn simd(&mut self, enable: bool)

Enables or disables the SIMD option. By default, the option is enabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn simd_enabled(&self) -> bool

Checks if the SIMD option turns on or not.

+
source

pub fn tail_call(&mut self, enable: bool)

Enables or disables the TailCall option. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn tail_call_enabled(&self) -> bool

Checks if the TailCall option turns on or not.

+
source

pub fn annotations(&mut self, enable: bool)

Enables or disables the Annotations option. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn annotations_enabled(&self) -> bool

Checks if the Annotations option turns on or not.

+
source

pub fn memory64(&mut self, enable: bool)

Enables or disables the Memory64 option. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn memory64_enabled(&self) -> bool

Checks if the Memory64 option turns on or not.

+
source

pub fn threads(&mut self, enable: bool)

Enables or disables the Threads option. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn threads_enabled(&self) -> bool

Checks if the Threads option turns on or not.

+
source

pub fn exception_handling(&mut self, enable: bool)

Enables or disables the ExceptionHandling option. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn exception_handling_enabled(&self) -> bool

Checks if the ExceptionHandling option turns on or not.

+
source

pub fn function_references(&mut self, enable: bool)

Enables or disables the FunctionReferences option. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn function_references_enabled(&self) -> bool

Checks if the FunctionReferences option turns on or not.

+
source

pub fn multi_memories(&mut self, enable: bool)

Enables or disables the MultiMemories option. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn multi_memories_enabled(&self) -> bool

Checks if the MultiMemories option turns on or not.

+
source

pub fn interpreter_mode(&mut self, enable: bool)

Enables or disables the ForceInterpreter option. By default, the option is disabled.

+
Argument
+
    +
  • enable - Whether the option turns on or not.
  • +
+
source

pub fn interpreter_mode_enabled(&self) -> bool

Checks if the ForceInterpreter option turns on or not.

+
source

pub fn set_aot_optimization_level( + &mut self, + opt_level: CompilerOptimizationLevel +)

Available on crate feature aot only.

Sets the optimization level of AOT compiler. By default, the optimization level is O3.

+

Notice that this function is only available when the aot feature is enabled.

+
Argument
+
    +
  • opt_level - The optimization level of AOT compiler.
  • +
+
source

pub fn get_aot_optimization_level(&self) -> CompilerOptimizationLevel

Available on crate feature aot only.

Returns the optimization level of AOT compiler.

+

Notice that this function is only available when the aot feature is enabled.

+
source

pub fn set_aot_compiler_output_format(&mut self, format: CompilerOutputFormat)

Available on crate feature aot only.

Sets the output binary format of AOT compiler. By default, the compiler output format is Wasm.

+

Notice that this function is only available when the aot feature is enabled.

+
Argument
+
    +
  • format - The format of the output binary.
  • +
+
source

pub fn get_aot_compiler_output_format(&self) -> CompilerOutputFormat

Available on crate feature aot only.

Returns the output binary format of AOT compiler.

+

Notice that this function is only available when the aot feature is enabled.

+
source

pub fn dump_ir(&mut self, flag: bool)

Available on crate feature aot only.

Sets the dump IR option of AOT compiler. By default, the option is disabled.

+

Notice that this function is only available when the aot feature is enabled.

+
Argument
+
    +
  • flag - Whether dump ir or not.
  • +
+
source

pub fn dump_ir_enabled(&self) -> bool

Available on crate feature aot only.

Checks if the dump IR option turns on or not.

+

Notice that this function is only available when the aot feature is enabled.

+
source

pub fn generic_binary(&mut self, flag: bool)

Available on crate feature aot only.

Sets the generic binary option of AOT compiler. By default, the option is disabled.

+

Notice that this function is only available when the aot feature is enabled.

+
Argument
+
    +
  • flag - Whether generate the generic binary or not when perform AOT compilation.
  • +
+
source

pub fn generic_binary_enabled(&self) -> bool

Available on crate feature aot only.

Checks if the generic binary option of AOT compiler turns on or not.

+

Notice that this function is only available when the aot feature is enabled.

+
source

pub fn interruptible(&mut self, enable: bool)

Available on crate feature aot only.

Enables or Disables the Interruptible option of AOT compiler. This option determines to generate interruptible binary or not when compilation in AOT compiler. By default, the option is disabled.

+

Notice that this function is only available when the aot feature is enabled.

+
Argument
+
    +
  • enable - Whether turn on the Interruptible option.
  • +
+
source

pub fn interruptible_enabled(&self) -> bool

Available on crate feature aot only.

Checks if the Interruptible option of AOT Compiler turns on or not.

+

Notice that this function is only available when the aot feature is enabled.

+
source

pub fn count_instructions(&mut self, flag: bool)

Sets the instruction counting option. By default, the option is disabled.

+
Argument
+
    +
  • flag - Whether support instruction counting or not when execution after AOT compilation.
  • +
+
source

pub fn is_instruction_counting(&self) -> bool

Checks if the instruction counting option turns on or not.

+
source

pub fn measure_cost(&mut self, flag: bool)

Sets the cost measuring option. By default, the option is disabled.

+
Argument
+
    +
  • flag - Whether support cost measuring or not when execution after AOT compilation.
  • +
+
source

pub fn is_cost_measuring(&self) -> bool

Checks if the cost measuring option turns on or not.

+
source

pub fn measure_time(&mut self, flag: bool)

Sets the time measuring option. By default, the option is disabled.

+
Argument
+
    +
  • flag - Whether support time measuring or not when execution after AOT compilation.
  • +
+
source

pub fn is_time_measuring(&self) -> bool

Checks if the time measuring option turns on or not.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ConfigureContext

Available on crate feature ffi only.

Provides a raw pointer to the inner Configure context.

+

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Config

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Executor.html b/wasmedge_sys/struct.Executor.html new file mode 100644 index 000000000..7cac14a4c --- /dev/null +++ b/wasmedge_sys/struct.Executor.html @@ -0,0 +1,179 @@ +Executor in wasmedge_sys - Rust

Struct wasmedge_sys::Executor

source ·
pub struct Executor { /* private fields */ }
Expand description

Defines an execution environment for both pure WASM and compiled WASM.

+

Implementations§

source§

impl Executor

source

pub fn create( + config: Option<&Config>, + stat: Option<&mut Statistics> +) -> WasmEdgeResult<Self>

Creates a new executor to be associated with the given config and statistics.

+
Arguments
+ +
Error
+

If fail to create a executor, then an error is returned.

+
source

pub fn register_wasi_instance( + &mut self, + store: &Store, + instance: &WasiInstance +) -> WasmEdgeResult<()>

Registers and instantiates the given WASI instance into a store.

+
Arguments
+
    +
  • +

    store - The target store, into which the given [wasi instance] is registered.

    +
  • +
  • +

    instance - The WASI instance to be registered.

    +
  • +
+
Error
+

If fail to register the given WASI instance, then an error is returned.

+
source

pub fn register_import_module<T>( + &mut self, + store: &Store, + import: &ImportModule<T> +) -> WasmEdgeResult<()>where + T: ?Sized + Send + Sync + Clone,

Registers and instantiates a import module into a store.

+
Arguments
+ +
Error
+

If fail to register the given import module, then an error is returned.

+
source

pub fn register_named_module( + &mut self, + store: &Store, + module: &Module, + name: impl AsRef<str> +) -> WasmEdgeResult<Instance>

Registers and instantiates a WasmEdge module into a store.

+

Instantiates the given WasmEdge module, including the functions, memories, tables, and globals it hosts; and then, registers the module instance into the store with the given name.

+
Arguments
+
    +
  • +

    store - The target store, into which the given module is registered.

    +
  • +
  • +

    module - A validated module to be registered.

    +
  • +
  • +

    name - The exported name of the registered module.

    +
  • +
+
Error
+

If fail to register the given module, then an error is returned.

+
source

pub fn register_active_module( + &mut self, + store: &Store, + module: &Module +) -> WasmEdgeResult<Instance>

Registers and instantiates a WasmEdge module into a store as an anonymous module.

+

Notice that when a new module is instantiated into the store, the old instantiated module is removed; in addition, ensure that the imports the module depends on are already registered into the store.

+
Arguments
+
    +
  • +

    store - The store, in which the module to be instantiated +is stored.

    +
  • +
  • +

    ast_mod - The target module to be instantiated.

    +
  • +
+
Error
+

If fail to instantiate the given module, then an error is returned.

+
source

pub fn register_plugin_instance( + &mut self, + store: &Store, + instance: &Instance +) -> WasmEdgeResult<()>

Registers plugin module instance into a store.

+
Arguments
+
    +
  • +

    store - The store, in which the module to be instantiated +is stored.

    +
  • +
  • +

    instance - The plugin module instance to be registered.

    +
  • +
+
Error
+

If fail to register the given plugin module instance, then an error is returned.

+
source

pub fn call_func( + &self, + func: &Function, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance and returns the results.

+
Arguments
+
    +
  • +

    func - The function instance to run.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
+
Errors
+

If fail to run the host function, then an error is returned.

+
source

pub fn call_func_with_timeout( + &self, + func: &Function, + params: impl IntoIterator<Item = WasmValue>, + timeout: Duration +) -> WasmEdgeResult<Vec<WasmValue>>

Available on Linux and non-musl only.

Run a host function instance and return the results or timeout.

+
Arguments
+
    +
  • +

    func - The function instance to run.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
  • +

    timeout - The maximum execution time of the function to be run.

    +
  • +
+
Errors
+

If fail to run the host function, then an error is returned.

+
source

pub fn call_func_ref( + &self, + func_ref: &FuncRef, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function reference instance and returns the results.

+
Arguments
+
    +
  • +

    func_ref - The function reference instance to run.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
+
Errors
+

If fail to run the host function reference instance, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ExecutorContext

Available on crate feature ffi only.

Provides a raw pointer to the inner Executor context.

+

Trait Implementations§

source§

impl Clone for Executor

source§

fn clone(&self) -> Executor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Executor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Executor

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Engine for Executor

source§

fn run_func( + &self, + func: &Function, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance and returns the results. Read more
source§

fn run_func_ref( + &self, + func_ref: &FuncRef, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance by calling its reference and returns the results. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.ExportType.html b/wasmedge_sys/struct.ExportType.html new file mode 100644 index 000000000..36b469680 --- /dev/null +++ b/wasmedge_sys/struct.ExportType.html @@ -0,0 +1,16 @@ +ExportType in wasmedge_sys - Rust
pub struct ExportType<'module> { /* private fields */ }
Expand description

Defines the types of the exported wasm values.

+

Implementations§

source§

impl<'module> ExportType<'module>

source

pub fn ty(&self) -> WasmEdgeResult<ExternalInstanceType>

Returns the type of this export.

+
source

pub fn name(&self) -> Cow<'_, str>

Returns the name by which this export is known by.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ExportTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner ExportType context.

+

Trait Implementations§

source§

impl<'module> Debug for ExportType<'module>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'module> Drop for ExportType<'module>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'module> RefUnwindSafe for ExportType<'module>

§

impl<'module> Send for ExportType<'module>

§

impl<'module> Sync for ExportType<'module>

§

impl<'module> Unpin for ExportType<'module>

§

impl<'module> UnwindSafe for ExportType<'module>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.FuncRef.html b/wasmedge_sys/struct.FuncRef.html new file mode 100644 index 000000000..1611a3416 --- /dev/null +++ b/wasmedge_sys/struct.FuncRef.html @@ -0,0 +1,33 @@ +FuncRef in wasmedge_sys - Rust

Struct wasmedge_sys::FuncRef

source ·
pub struct FuncRef { /* private fields */ }
Expand description

Defines a reference to a host function.

+

Implementations§

source§

impl FuncRef

source

pub fn ty(&self) -> WasmEdgeResult<FuncType>

Returns the underlying wasm type of the host function this FuncRef points to.

+
Errors
+

If fail to get the function type, then an error is returned.

+
source

pub fn call<E: Engine>( + &self, + engine: &E, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs this host function the reference refers to.

+
Arguments
+
    +
  • +

    engine - The object implementing the Engine trait.

    +
  • +
  • +

    args - The arguments passed to the host function.

    +
  • +
+
Error
+

If fail to run the host function, then an error is returned.

+

Trait Implementations§

source§

impl Clone for FuncRef

source§

fn clone(&self) -> FuncRef

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FuncRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FuncRef

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.FuncType.html b/wasmedge_sys/struct.FuncType.html new file mode 100644 index 000000000..244e406c1 --- /dev/null +++ b/wasmedge_sys/struct.FuncType.html @@ -0,0 +1,39 @@ +FuncType in wasmedge_sys - Rust

Struct wasmedge_sys::FuncType

source ·
pub struct FuncType { /* private fields */ }
Expand description

Defines the type of a host function.

+

A WasmEdge FuncType classifies the signature of a Function, including the type information of both the arguments and the returns.

+

Implementations§

source§

impl FuncType

source

pub fn create<I: IntoIterator<Item = ValType>, R: IntoIterator<Item = ValType>>( + args: I, + returns: R +) -> WasmEdgeResult<Self>

Create a new FuncType to be associated with the given arguments and returns.

+
Arguments
+
    +
  • +

    args - The argument types of a Function.

    +
  • +
  • +

    returns - The types of the returns of a Function.

    +
  • +
+
Error
+

If fail to create a FuncType, then an error is returned.

+
Example
+
use wasmedge_sys::FuncType;
+use wasmedge_types::ValType;
+
+let func_ty = FuncType::create(vec![ValType::I32;2], vec![ValType::I32]).expect("fail to create a FuncType");
+
source

pub fn params_len(&self) -> u32

Returns the number of the arguments of a Function.

+
source

pub fn params_type_iter(&self) -> impl Iterator<Item = ValType>

Returns an Iterator of the arguments of a Function.

+
source

pub fn returns_len(&self) -> u32

Returns the number of the returns of a Function.

+
source

pub fn returns_type_iter(&self) -> impl Iterator<Item = ValType>

Returns an Iterator of the return types of a Function.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_FunctionTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner function type context.

+

Trait Implementations§

source§

impl Debug for FuncType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FuncType

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<FuncType> for FuncType

source§

fn from(ty: FuncType) -> Self

Converts to this type from the input type.
source§

impl From<FuncType> for FuncType

source§

fn from(ty: FuncType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Function.html b/wasmedge_sys/struct.Function.html new file mode 100644 index 000000000..27ff46eed --- /dev/null +++ b/wasmedge_sys/struct.Function.html @@ -0,0 +1,133 @@ +Function in wasmedge_sys - Rust

Struct wasmedge_sys::Function

source ·
pub struct Function { /* private fields */ }
Expand description

Defines a host function.

+

A WasmEdge Function defines a WebAssembly host function described by its type. A host function is a closure of the original function defined in either the host or the WebAssembly module.

+

Implementations§

source§

impl Function

source

pub fn create_sync_func<T>( + ty: &FuncType, + real_fn: Box<dyn Fn(CallingFrame, Vec<WasmValue>, *mut c_void) -> Result<Vec<WasmValue>, HostFuncError> + Send + Sync>, + data: Option<Box<T>>, + cost: u64 +) -> WasmEdgeResult<Self>

Creates a host function with the given function type.

+

N.B. that this function is used for thread-safe scenarios.

+
Arguments
+
    +
  • +

    ty - The types of the arguments and returns of the target function.

    +
  • +
  • +

    real_fn - The pointer to the target function.

    +
  • +
  • +

    data - The host context data used in this function.

    +
  • +
  • +

    cost - The function cost in the Statistics. Pass 0 if the calculation is not needed.

    +
  • +
+
Error
+ +
Example
+

The example defines a host function real_add, and creates a Function binding to it by calling +the create_binding method.

+ +
use wasmedge_macro::sys_host_function;
+use wasmedge_sys::{FuncType, Function, WasmValue, CallingFrame};
+use wasmedge_types::{error::HostFuncError, ValType, WasmEdgeResult, NeverType};
+
+#[sys_host_function]
+fn real_add(_frame: CallingFrame, inputs: Vec<WasmValue>) -> Result<Vec<WasmValue>, HostFuncError> {
+    if inputs.len() != 2 {
+        return Err(HostFuncError::User(1));
+    }
+
+    let a = if inputs[0].ty() == ValType::I32 {
+        inputs[0].to_i32()
+    } else {
+        return Err(HostFuncError::User(2));
+    };
+
+    let b = if inputs[1].ty() == ValType::I32 {
+        inputs[1].to_i32()
+    } else {
+        return Err(HostFuncError::User(3));
+    };
+
+    let c = a + b;
+
+    Ok(vec![WasmValue::from_i32(c)])
+}
+
+// create a FuncType
+let func_ty = FuncType::create(vec![ValType::I32; 2], vec![ValType::I32]).expect("fail to create a FuncType");
+
+// create a Function instance
+let func = Function::create_sync_func::<NeverType>(&func_ty, Box::new(real_add), None, 0).expect("fail to create a Function instance");
+
source

pub unsafe fn create_with_custom_wrapper( + ty: &FuncType, + fn_wrapper: CustomFnWrapper, + real_fn: *mut c_void, + data: *mut c_void, + data_owner: bool, + cost: u64 +) -> WasmEdgeResult<Self>

Creates a host function with the given function type and the custom function wrapper.

+
Arguments
+
    +
  • +

    ty - The types of the arguments and returns of the target function.

    +
  • +
  • +

    fn_wrapper - The custom function wrapper.

    +
  • +
  • +

    real_fn - The pointer to the target function.

    +
  • +
  • +

    data - The pointer to the host context data used in this function.

    +
  • +
  • +

    data_owner - Whether the host context data is owned by the host function.

    +
  • +
  • +

    cost - The function cost in the Statistics. Pass 0 if the calculation is not needed.

    +
  • +
+
Error
+ +
Safety
+

Notice that the caller should guarantee the life cycle of both the real_fn and the data object.

+
source

pub fn ty(&self) -> WasmEdgeResult<FuncType>

Returns the underlying wasm type of this Function.

+
Errors
+

If fail to get the function type, then an error is returned.

+
source

pub fn call<E: Engine>( + &self, + engine: &E, + args: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs this host function and returns the result.

+
Arguments
+
    +
  • +

    engine - The object implementing the Engine trait.

    +
  • +
  • +

    args - The arguments passed to the host function.

    +
  • +
+
Error
+

If fail to run the host function, then an error is returned.

+
source

pub fn as_ref(&self) -> FuncRef

Returns a reference to this Function instance.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_FunctionInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner function context.

+

Trait Implementations§

source§

impl Clone for Function

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Function

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Function

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Global.html b/wasmedge_sys/struct.Global.html new file mode 100644 index 000000000..30ab7b4fb --- /dev/null +++ b/wasmedge_sys/struct.Global.html @@ -0,0 +1,44 @@ +Global in wasmedge_sys - Rust

Struct wasmedge_sys::Global

source ·
pub struct Global { /* private fields */ }
Expand description

Defines a WebAssembly global variable, which stores a single value of the given type and a flag indicating whether it is mutable or not.

+

Implementations§

source§

impl Global

source

pub fn create(ty: &GlobalType, val: WasmValue) -> WasmEdgeResult<Self>

Creates a new Global instance to be associated with the given GlobalType and WasmValue.

+

The type of the given WasmValue must be matched with GlobalType; otherwise, it causes a failure. For example, WasmValue::I32(520) conflicts with a GlobalType with a value type defined as ValType::F32.

+
Errors
+
    +
  • If fail to create the Global instance, then WasmEdgeError::Global(GlobalError::Create)(crate::error::GlobalError) is returned.
  • +
+
source

pub fn ty(&self) -> WasmEdgeResult<GlobalType>

Returns the underlying wasm type of a Global instance.

+
Errors
+

If fail to get the type, then an error is returned.

+
source

pub fn get_value(&self) -> WasmValue

Returns the value of the Global instance.

+
source

pub fn set_value(&mut self, val: WasmValue) -> WasmEdgeResult<()>

Sets the value of the Global instance.

+

Notice that only the Global instance of Mutability::Var type can be set a new value. Setting a new value for a Global of Mutability::Const causes a failure.

+
Argument
+
    +
  • val - The new wasm value to be set.
  • +
+
Errors
+

If fail to set value, then an error is returned.

+
Example
+
use wasmedge_sys::{Global, GlobalType, WasmValue};
+use wasmedge_types::{ValType, Mutability};
+
+// create a GlobalType instance
+let ty = GlobalType::create(ValType::F32, Mutability::Var).expect("fail to create a GlobalType");
+// create a Global instance
+let mut global = Global::create(&ty, WasmValue::from_f32(3.1415)).expect("fail to create a Global");
+
+global.set_value(WasmValue::from_f32(314.15)).expect("fail to set a new value for a Global");
+assert_eq!(global.get_value().to_f32(), 314.15);
+
source

pub fn as_ptr(&self) -> *const WasmEdge_GlobalInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner global context.

+

Trait Implementations§

source§

impl Clone for Global

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Global

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Global

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Global

§

impl Send for Global

§

impl Sync for Global

§

impl Unpin for Global

§

impl !UnwindSafe for Global

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.GlobalType.html b/wasmedge_sys/struct.GlobalType.html new file mode 100644 index 000000000..09b724f4a --- /dev/null +++ b/wasmedge_sys/struct.GlobalType.html @@ -0,0 +1,29 @@ +GlobalType in wasmedge_sys - Rust
pub struct GlobalType { /* private fields */ }
Expand description

Defines the type of a wasm global variable.

+

A GlobalType classifies a global variable that hold a value and can either be mutable or immutable.

+

Implementations§

source§

impl GlobalType

source

pub fn create(val_ty: ValType, mutable: Mutability) -> WasmEdgeResult<Self>

Create a new GlobalType to be associated with the given ValType and Mutability.

+
Arguments
+
    +
  • +

    val_type - The value type of the global variable.

    +
  • +
  • +

    mutability - The mutability of the global variable.

    +
  • +
+
Errors
+

If fail to create a new GlobalType, then an error is returned.

+
source

pub fn value_type(&self) -> ValType

Returns the value type of the GlobalType.

+
source

pub fn mutability(&self) -> Mutability

Returns the Mutability value of the GlobalType.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_GlobalTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner global type context.

+

Trait Implementations§

source§

impl Debug for GlobalType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for GlobalType

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<GlobalType> for GlobalType

source§

fn from(ty: GlobalType) -> Self

Converts to this type from the input type.
source§

impl From<GlobalType> for GlobalType

source§

fn from(ty: GlobalType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.ImportModule.html b/wasmedge_sys/struct.ImportModule.html new file mode 100644 index 000000000..bd3c2c6df --- /dev/null +++ b/wasmedge_sys/struct.ImportModule.html @@ -0,0 +1,30 @@ +ImportModule in wasmedge_sys - Rust
pub struct ImportModule<T: ?Sized + Send + Sync + Clone> { /* private fields */ }
Expand description

An ImportModule represents a host module with a name. A host module consists of one or more host function, table, memory, and global instances, which are defined outside wasm modules and fed into wasm modules as imports.

+

Implementations§

source§

impl<T: ?Sized + Send + Sync + Clone> ImportModule<T>

source

pub fn create( + name: impl AsRef<str>, + data: Option<Box<T>> +) -> WasmEdgeResult<Self>

Creates a module instance which is used to import host functions, tables, memories, and globals into a wasm module.

+
Argument
+
    +
  • +

    name - The name of the import module instance.

    +
  • +
  • +

    data - The host context data used in this function.

    +
  • +
+
Error
+

If fail to create the import module instance, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner module instance context.

+

Trait Implementations§

source§

impl<T: ?Sized + Send + Sync + Clone> AsImport for ImportModule<T>

source§

fn name(&self) -> &str

Returns the name of the module instance.
source§

fn add_func(&mut self, name: impl AsRef<str>, func: Function)

source§

fn add_table(&mut self, name: impl AsRef<str>, table: Table)

source§

fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)

source§

fn add_global(&mut self, name: impl AsRef<str>, global: Global)

source§

impl<T: Clone + ?Sized + Send + Sync + Clone> Clone for ImportModule<T>

source§

fn clone(&self) -> ImportModule<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + ?Sized + Send + Sync + Clone> Debug for ImportModule<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: ?Sized + Send + Sync + Clone> Drop for ImportModule<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for ImportModule<T>

§

impl<T> Send for ImportModule<T>

§

impl<T> Sync for ImportModule<T>

§

impl<T> Unpin for ImportModule<T>

§

impl<T> !UnwindSafe for ImportModule<T>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.ImportType.html b/wasmedge_sys/struct.ImportType.html new file mode 100644 index 000000000..14a29cda5 --- /dev/null +++ b/wasmedge_sys/struct.ImportType.html @@ -0,0 +1,17 @@ +ImportType in wasmedge_sys - Rust
pub struct ImportType<'module> { /* private fields */ }
Expand description

Defines the types of the imported wasm value.

+

Implementations§

source§

impl<'module> ImportType<'module>

source

pub fn ty(&self) -> WasmEdgeResult<ExternalInstanceType>

Returns the type of this import.

+
source

pub fn name(&self) -> Cow<'_, str>

Returns the field name of the module that this import is expected to come from.

+
source

pub fn module_name(&self) -> Cow<'_, str>

Returns the module name that this import is expected to come from.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ImportTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner ImportType context.

+

Trait Implementations§

source§

impl<'module> Debug for ImportType<'module>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'module> Drop for ImportType<'module>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'module> RefUnwindSafe for ImportType<'module>

§

impl<'module> Send for ImportType<'module>

§

impl<'module> Sync for ImportType<'module>

§

impl<'module> Unpin for ImportType<'module>

§

impl<'module> UnwindSafe for ImportType<'module>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Instance.html b/wasmedge_sys/struct.Instance.html new file mode 100644 index 000000000..e84531b8e --- /dev/null +++ b/wasmedge_sys/struct.Instance.html @@ -0,0 +1,54 @@ +Instance in wasmedge_sys - Rust

Struct wasmedge_sys::Instance

source ·
pub struct Instance { /* private fields */ }
Expand description

An Instance represents an instantiated module. In the instantiation process, An Instance is created from alModule. From an Instance the exported functions, tables, memories, and globals can be fetched.

+

Implementations§

source§

impl Instance

source

pub fn name(&self) -> Option<String>

Returns the name of this exported module instance.

+

If this module instance is an active module instance, then None is returned.

+
source

pub fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>

Returns the exported function instance by name.

+
Argument
+ +
Error
+

If fail to find the target function, then an error is returned.

+
source

pub fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>

Returns the exported table instance by name.

+
Argument
+ +
Error
+

If fail to find the target table instance, then an error is returned.

+
source

pub fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>

Returns the exported memory instance by name.

+
Argument
+ +
Error
+

If fail to find the target memory instance, then an error is returned.

+
source

pub fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>

Returns the exported global instance by name.

+
Argument
+ +
Error
+

If fail to find the target global instance, then an error is returned.

+
source

pub fn func_len(&self) -> u32

Returns the length of the exported function instances in this module instance.

+
source

pub fn func_names(&self) -> Option<Vec<String>>

Returns the names of the exported function instances in this module instance.

+
source

pub fn table_len(&self) -> u32

Returns the length of the exported table instances in this module instance.

+
source

pub fn table_names(&self) -> Option<Vec<String>>

Returns the names of the exported table instances in this module instance.

+
source

pub fn mem_len(&self) -> u32

Returns the length of the exported memory instances in this module instance.

+
source

pub fn mem_names(&self) -> Option<Vec<String>>

Returns the names of all exported memory instances in this module instance.

+
source

pub fn global_len(&self) -> u32

Returns the length of the exported global instances in this module instance.

+
source

pub fn global_names(&self) -> Option<Vec<String>>

Returns the names of the exported global instances in this module instance.

+
source

pub fn host_data<T: Send + Sync + Clone>(&mut self) -> Option<&mut T>

Returns the host data held by the module instance.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner module instance context.

+

Trait Implementations§

source§

impl Clone for Instance

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Instance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Instance

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Loader.html b/wasmedge_sys/struct.Loader.html new file mode 100644 index 000000000..24320769f --- /dev/null +++ b/wasmedge_sys/struct.Loader.html @@ -0,0 +1,44 @@ +Loader in wasmedge_sys - Rust

Struct wasmedge_sys::Loader

source ·
pub struct Loader { /* private fields */ }
Expand description

Loader is used to load WASM modules from the given WASM files or buffers.

+

Implementations§

source§

impl Loader

source

pub fn create(config: Option<&Config>) -> WasmEdgeResult<Self>

Create a new Loader to be associated with the given global configuration.

+
Arguments
+
    +
  • config - A global configuration.
  • +
+
Error
+

If fail to create a Loader, then an error is returned.

+
source

pub fn from_file(&self, file: impl AsRef<Path>) -> WasmEdgeResult<Module>

Loads a WASM module from a WASM file.

+
Arguments
+
    +
  • file - A wasm file or an AOT wasm file.
  • +
+
Error
+

If fail to load, then an error is returned.

+
Example
+
let file = "path/to/foo.wasm"
+let module = loader.from_file(file)?;
+
source

pub fn from_bytes(&self, bytes: impl AsRef<[u8]>) -> WasmEdgeResult<Module>

Loads a WASM module from a in-memory bytes.

+
Arguments
+
    +
  • bytes - A in-memory WASM bytes.
  • +
+
Error
+

If fail to load, then an error is returned.

+
Example
+
let bytes = b"\0asm\x01\0\0\0";
+let module = loader.from_bytes(&bytes)?;
+

Note that the text format is not accepted:

+ +
assert!(loader.from_bytes(b"(module)").is_err());
+
source

pub fn as_ptr(&self) -> *const WasmEdge_LoaderContext

Available on crate feature ffi only.

Provides a raw pointer to the inner Loader context.

+

Trait Implementations§

source§

impl Debug for Loader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Loader

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.MemType.html b/wasmedge_sys/struct.MemType.html new file mode 100644 index 000000000..3b930730a --- /dev/null +++ b/wasmedge_sys/struct.MemType.html @@ -0,0 +1,34 @@ +MemType in wasmedge_sys - Rust

Struct wasmedge_sys::MemType

source ·
pub struct MemType { /* private fields */ }
Expand description

Defines the type of a wasm memory instance

+

Implementations§

source§

impl MemType

source

pub fn create(min: u32, max: Option<u32>, shared: bool) -> WasmEdgeResult<Self>

Create a new MemType to be associated with the given limit range for the capacity.

+
Arguments
+
    +
  • +

    ‘min’ - The initial size of the linear memory.

    +
  • +
  • +

    ‘max’ - The upper bound of the linear memory size allowed to grow. If ‘max’ is set ‘None’, then the maximum size will be set u32::MAX.

    +
  • +
  • +

    shared - Whether the memory is shared or not. Reference Threading proposal for WebAssembly for details about shared memory. If shared is set true, then max MUST not be None.

    +
  • +
+
Errors
+

If fail to create a MemType, then an error is returned.

+
Example
+
let ty = MemType::create(0, Some(u32::MAX), false);
+
source

pub fn min(&self) -> u32

Returns the initial size of a Memory.

+
source

pub fn max(&self) -> Option<u32>

Returns the maximum size of a Memory allowed to grow.

+
source

pub fn shared(&self) -> bool

Returns whether the memory is shared or not.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_MemoryTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner memory type context.

+

Trait Implementations§

source§

impl Debug for MemType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for MemType

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<MemType> for MemoryType

source§

fn from(ty: MemType) -> Self

Converts to this type from the input type.
source§

impl From<MemoryType> for MemType

source§

fn from(ty: MemoryType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Memory.html b/wasmedge_sys/struct.Memory.html new file mode 100644 index 000000000..be6e94719 --- /dev/null +++ b/wasmedge_sys/struct.Memory.html @@ -0,0 +1,141 @@ +Memory in wasmedge_sys - Rust

Struct wasmedge_sys::Memory

source ·
pub struct Memory { /* private fields */ }
Expand description

Defines a WebAssembly memory instance, which is a linear memory described by its type. Each memory instance consists of a vector of bytes and an optional maximum size, and its size is a multiple of the WebAssembly page size (64KiB of each page).

+

Implementations§

source§

impl Memory

source

pub fn create(ty: &MemType) -> WasmEdgeResult<Self>

Create a new Memory to be associated with the given capacity limit.

+
Arguments
+
    +
  • ty - The type of the new Memory instance.
  • +
+
Errors
+ +
Example
+
use wasmedge_sys::{MemType, Memory};
+
+let ty = MemType::create(10, Some(20), false).expect("fail to create memory type");
+
+let memory = Memory::create(&ty);
+
+
source

pub fn ty(&self) -> WasmEdgeResult<MemType>

Returns the type of the Memory.

+
Errors
+

If fail to get the type from the Memory, then an error is returned.

+
source

pub fn get_data(&self, offset: u32, len: u32) -> WasmEdgeResult<Vec<u8>>

Copies the data from the Memory to the output buffer.

+
Arguments
+
    +
  • +

    offset - The data start offset in the Memory.

    +
  • +
  • +

    len - The requested data length.

    +
  • +
+
Errors
+

If the offset + len is larger than the data size in the Memory, then an error is returned.

+
source

pub fn set_data( + &mut self, + data: impl AsRef<[u8]>, + offset: u32 +) -> WasmEdgeResult<()>

Copies the data from the given input buffer into the Memory.

+
Arguments
+
    +
  • +

    data - The data buffer to copy.

    +
  • +
  • +

    offset - The data start offset in the Memory.

    +
  • +
+
Errors
+

If the sum of the offset and the data length is larger than the size of the Memory, +then an error is returned.

+ +
use wasmedge_sys::{Memory, MemType};
+use wasmedge_types::error::{CoreError, CoreExecutionError, WasmEdgeError};
+
+// create a Memory: the min size 1 and the max size 2
+let ty = MemType::create(1, Some(2), false).expect("fail to create a memory type");
+let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+
+// set data and the data length is larger than the data size in the memory
+let result = mem.set_data(vec![1; 10], u32::pow(2, 16) - 9);
+assert!(result.is_err());
+assert_eq!(result.unwrap_err(), Box::new(WasmEdgeError::Core(CoreError::Execution(CoreExecutionError::MemoryOutOfBounds))));
+
Example
+
use wasmedge_sys::{MemType, Memory};
+
+// create a Memory: the min size 1 and the max size 2
+let ty = MemType::create(1, Some(2), false).expect("fail to create a memory type");
+let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+// page count
+let count = mem.size();
+assert_eq!(count, 1);
+
+// set data
+mem.set_data(vec![1; 10], 10).expect("fail to set data");
+
+// get data
+let data = mem.get_data(10, 10).expect("fail to get data");
+assert_eq!(data, vec![1; 10]);
+
source

pub fn data_pointer(&self, offset: u32, len: u32) -> WasmEdgeResult<*const u8>

Returns the const data pointer to the Memory.

+
Arguments
+
    +
  • +

    offset - The data start offset in the Memory.

    +
  • +
  • +

    len - The requested data length. If the size of offset + len is larger +than the data size in the Memory

    +
  • +
+
Errors
+

If fail to get the data pointer, then an error is returned.

+
source

pub fn data_pointer_mut( + &mut self, + offset: u32, + len: u32 +) -> WasmEdgeResult<*mut u8>

Returns the data pointer to the Memory.

+
Arguments
+
    +
  • +

    offset - The data start offset in the Memory.

    +
  • +
  • +

    len - The requested data length. If the size of offset + len is larger than the data size in the Memory

    +
  • +
+
Errors
+

If fail to get the data pointer, then an error is returned.

+
source

pub fn size(&self) -> u32

Returns the size, in WebAssembly pages (64 KiB of each page), of this wasm memory.

+
source

pub fn grow(&mut self, count: u32) -> WasmEdgeResult<()>

Grows this WebAssembly memory by count pages.

+
Arguments
+
    +
  • count - The page counts to be extended to the Memory.
  • +
+
Errors
+

If fail to grow the page count, then an error is returned.

+
Example
+
use wasmedge_sys::{MemType, Memory};
+
+// create a Memory with a limit range [10, 20]
+let ty = MemType::create(10, Some(20), false).expect("fail to create a memory type");
+let mut mem = Memory::create(&ty).expect("fail to create a Memory");
+// check page count
+let count = mem.size();
+assert_eq!(count, 10);
+
+// grow 5 pages
+mem.grow(10).expect("fail to grow the page count");
+assert_eq!(mem.size(), 20);
+
source

pub fn as_ptr(&self) -> *const WasmEdge_MemoryInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner memory context.

+

Trait Implementations§

source§

impl Clone for Memory

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Memory

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Memory

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Memory

§

impl Send for Memory

§

impl Sync for Memory

§

impl Unpin for Memory

§

impl !UnwindSafe for Memory

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Module.html b/wasmedge_sys/struct.Module.html new file mode 100644 index 000000000..c8bee90392 --- /dev/null +++ b/wasmedge_sys/struct.Module.html @@ -0,0 +1,23 @@ +Module in wasmedge_sys - Rust

Struct wasmedge_sys::Module

source ·
pub struct Module { /* private fields */ }
Expand description

Defines compiled in-memory representation of an input WASM binary.

+

Module is also called AST Module in WasmEdge terminology. A Module is a compiled in-memory +representation of an input WebAssembly binary. In the instantiation process, a Module is used to create a +module stance, from which the exported functions, tables, +memories, and globals can be fetched.

+

Implementations§

source§

impl Module

source

pub fn count_of_imports(&self) -> u32

Returns the number of wasm imports in the Module.

+
source

pub fn imports(&self) -> Vec<ImportType<'_>>

Returns the types of wasm imports in the Module.

+
source

pub fn count_of_exports(&self) -> u32

Returns the count of wasm exports in the Module.

+
source

pub fn exports(&self) -> Vec<ExportType<'_>>

Returns the types of wasm exports in the Module.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_FunctionTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner ASTModule context.

+

Trait Implementations§

source§

impl Clone for Module

source§

fn clone(&self) -> Module

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Module

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Module

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Statistics.html b/wasmedge_sys/struct.Statistics.html new file mode 100644 index 000000000..82e3b29f8 --- /dev/null +++ b/wasmedge_sys/struct.Statistics.html @@ -0,0 +1,49 @@ +Statistics in wasmedge_sys - Rust
pub struct Statistics { /* private fields */ }
Expand description

Struct of WasmEdge Statistics.

+

Implementations§

source§

impl Statistics

source

pub fn create() -> WasmEdgeResult<Self>

Creates a new Statistics.

+
Error
+

If fail to create a Statistics, then an error is returned.

+
source

pub fn instr_count(&self) -> u64

Returns the instruction count in execution.

+
source

pub fn instr_per_sec(&self) -> f64

Returns the instruction count per second in execution.

+
Notice
+

For the following cases,

+
    +
  • Statistics is not enabled, or
  • +
  • the total execution time is 0
  • +
+

The instructions per second could be NaN, which represents divided-by-zero. +Use the is_nan function of F64 to check the return value before use it, +for example,

+ +
use wasmedge_sys::Statistics;
+
+// create a Statistics instance
+let stat = Statistics::create().expect("fail to create a Statistics");
+
+// check instruction count per second
+assert!(stat.instr_per_sec().is_nan());
+
source

pub fn cost_in_total(&self) -> u64

Returns the total cost in execution.

+
source

pub fn set_cost_table(&mut self, cost_table: impl AsRef<[u64]>)

Sets the cost of instructions.

+
Arguments
+
    +
  • cost_table - The slice of cost table.
  • +
+
source

pub fn set_cost_limit(&mut self, limit: u64)

Sets the cost limit in execution.

+
Arguments
+
    +
  • limit - The cost limit.
  • +
+
source

pub fn clear(&mut self)

Clears the data in this statistics.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_StatisticsContext

Available on crate feature ffi only.

Provides a raw pointer to the inner Statistics context.

+

Trait Implementations§

source§

impl Clone for Statistics

source§

fn clone(&self) -> Statistics

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Statistics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Statistics

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Store.html b/wasmedge_sys/struct.Store.html new file mode 100644 index 000000000..15e7c44cb --- /dev/null +++ b/wasmedge_sys/struct.Store.html @@ -0,0 +1,32 @@ +Store in wasmedge_sys - Rust

Struct wasmedge_sys::Store

source ·
pub struct Store { /* private fields */ }
Expand description

A Store represents all global state that can be manipulated by WebAssembly programs. It consists of the runtime representation of all instances of functions, tables, memories, and globals.

+

Implementations§

source§

impl Store

source

pub fn create() -> WasmEdgeResult<Self>

Creates a new Store.

+
Error
+

If fail to create, then an error is returned.

+
source

pub fn module_len(&self) -> u32

Returns the length of the registered modules.

+
source

pub fn module_names(&self) -> Option<Vec<String>>

Returns the names of all registered modules.

+
source

pub fn module(&self, name: impl AsRef<str>) -> WasmEdgeResult<Instance>

Returns the module instance by the module name.

+
Argument
+
    +
  • name - The name of the module instance to get.
  • +
+
Error
+

If fail to find the target module instance, then an error is returned.

+
source

pub fn contains(&self, name: impl AsRef<str>) -> bool

Checks if the Store contains a module of which the name matches the given name.

+
Argument
+
    +
  • name - The name of the module to search.
  • +
+
source

pub fn as_ptr(&self) -> *const WasmEdge_StoreContext

Available on crate feature ffi only.

Provides a raw pointer to the inner Store context.

+

Trait Implementations§

source§

impl Clone for Store

source§

fn clone(&self) -> Store

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Store

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Store

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnwindSafe for Store

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Table.html b/wasmedge_sys/struct.Table.html new file mode 100644 index 000000000..ce5ba6285 --- /dev/null +++ b/wasmedge_sys/struct.Table.html @@ -0,0 +1,75 @@ +Table in wasmedge_sys - Rust

Struct wasmedge_sys::Table

source ·
pub struct Table { /* private fields */ }
Expand description

A WasmEdge Table defines a WebAssembly table instance described by its type. A table is an array-like structure and stores function references.

+

This example shows how to use Table to store and retrieve function references.

+

Implementations§

source§

impl Table

source

pub fn create(ty: &TableType) -> WasmEdgeResult<Self>

Creates a new Table to be associated with the given element type and the size.

+
Arguments
+
    +
  • ty specifies the type of the new Table.
  • +
+
Error
+
    +
  • If fail to create the table instance, then WasmEdgeError::Table(TableError::Create)(crate::error::TableError) is returned.
  • +
+
Example
+
use wasmedge_sys::{TableType, Table};
+use wasmedge_types::RefType;
+
+// create a TableType instance
+let ty = TableType::create(RefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+
+// create a Table instance
+let table = Table::create(&ty).expect("fail to create a Table");
+
source

pub fn ty(&self) -> WasmEdgeResult<TableType>

Returns the TableType of the Table.

+
Error
+

If fail to get type, then an error is returned.

+
source

pub fn get_data(&self, idx: u32) -> WasmEdgeResult<WasmValue>

Returns the element value at a specific position in the Table.

+
Arguments
+
    +
  • idx specifies the position in the Table, at which the WasmValue is returned.
  • +
+
Error
+

If fail to get the data, then an error is returned.

+
source

pub fn set_data(&mut self, data: WasmValue, idx: u32) -> WasmEdgeResult<()>

Sets a new element value at a specific position in the Table.

+
Arguments
+
    +
  • +

    data specifies the new data.

    +
  • +
  • +

    idx specifies the position of the new data to be stored in the Table.

    +
  • +
+
Error
+

If fail to set data, then an error is returned.

+
source

pub fn capacity(&self) -> usize

Returns the capacity of the Table.

+
Example
+
use wasmedge_sys::{TableType, Table};
+use wasmedge_types::RefType;
+
+// create a TableType instance and a Table
+let ty = TableType::create(RefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+let table = Table::create(&ty).expect("fail to create a Table");
+
+// check capacity
+assert_eq!(table.capacity(), 10);
+
source

pub fn grow(&mut self, size: u32) -> WasmEdgeResult<()>

Increases the capacity of the Table.

+

After growing, the new capacity must be in the range defined by limit when the table is created.

+
Argument
+
    +
  • size specifies the size to be added to the Table.
  • +
+
Error
+

If fail to increase the size of the Table, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_TableInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner table context.

+

Trait Implementations§

source§

impl Clone for Table

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Table

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Table

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl !UnwindSafe for Table

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.TableType.html b/wasmedge_sys/struct.TableType.html new file mode 100644 index 000000000..1aea4b40c --- /dev/null +++ b/wasmedge_sys/struct.TableType.html @@ -0,0 +1,38 @@ +TableType in wasmedge_sys - Rust

Struct wasmedge_sys::TableType

source ·
pub struct TableType { /* private fields */ }
Expand description

A WasmEdge TableType classifies a Table instance over elements of element types within a size range.

+

Implementations§

source§

impl TableType

source

pub fn create( + elem_ty: RefType, + min: u32, + max: Option<u32> +) -> WasmEdgeResult<Self>

Creates a new TableType to be associated with the given limit range of the size and the reference type.

+
Arguments
+
    +
  • +

    elem_type - The element type.

    +
  • +
  • +

    min - The initial size of the table to be created.

    +
  • +
  • +

    max - The maximum size of the table to be created.

    +
  • +
+
Error
+

If fail to create a TableType, then an error is returned.

+
Example
+
let ty = TableType::create(WasmRefType::FuncRef, 10, Some(20)).expect("fail to create a TableType");
+
source

pub fn elem_ty(&self) -> RefType

Returns the element type.

+
source

pub fn min(&self) -> u32

Returns the initial size of the Table.

+
source

pub fn max(&self) -> Option<u32>

Returns the maximum size of the Table.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_TableTypeContext

Available on crate feature ffi only.

Provides a raw pointer to the inner table type context.

+

Trait Implementations§

source§

impl Debug for TableType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for TableType

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<TableType> for TableType

source§

fn from(ty: TableType) -> Self

Converts to this type from the input type.
source§

impl From<TableType> for TableType

source§

fn from(ty: TableType) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.Validator.html b/wasmedge_sys/struct.Validator.html new file mode 100644 index 000000000..f02dbfa69 --- /dev/null +++ b/wasmedge_sys/struct.Validator.html @@ -0,0 +1,29 @@ +Validator in wasmedge_sys - Rust

Struct wasmedge_sys::Validator

source ·
pub struct Validator { /* private fields */ }
Expand description

Struct of WasmEdge Validator.

+

Implementations§

source§

impl Validator

source

pub fn create(config: Option<&Config>) -> WasmEdgeResult<Self>

Creates a new Validator to be associated with the given global configuration.

+
Arguments
+
    +
  • config - The global environment configuration.
  • +
+
Error
+

If fail to create a Validator, then an error is returned.

+
source

pub fn validate(&self, module: &Module) -> WasmEdgeResult<()>

Validates a given WasmEdge Module.

+

Modules are valid when all components they contain are valid. Furthermore, most definitions are themselves classified with a suitable type.

+
Arguments
+
    +
  • module - The Module to be validated.
  • +
+
Error
+

If the validation fails, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ValidatorContext

Available on crate feature ffi only.

Provides a raw pointer to the inner Validator context.

+

Trait Implementations§

source§

impl Debug for Validator

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Validator

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.WasiModule.html b/wasmedge_sys/struct.WasiModule.html new file mode 100644 index 000000000..c7c515875 --- /dev/null +++ b/wasmedge_sys/struct.WasiModule.html @@ -0,0 +1,62 @@ +WasiModule in wasmedge_sys - Rust
pub struct WasiModule { /* private fields */ }
Expand description

A WasiModule is a module instance for the WASI specification.

+

Implementations§

source§

impl WasiModule

source

pub fn create( + args: Option<Vec<&str>>, + envs: Option<Vec<&str>>, + preopens: Option<Vec<&str>> +) -> WasmEdgeResult<Self>

Creates a WASI host module which contains the WASI host functions, and initializes it with the given parameters.

+
Arguments
+
    +
  • +

    args - The commandline arguments. The first argument is the program name.

    +
  • +
  • +

    envs - The environment variables in the format ENV_VAR_NAME=VALUE.

    +
  • +
  • +

    preopens - The directories to pre-open. The required format is GUEST_PATH:HOST_PATH.

    +
  • +
+
Error
+

If fail to create a host module, then an error is returned.

+
source

pub fn name(&self) -> &str

Returns the name of the module instance.

+
source

pub fn init_wasi( + &mut self, + args: Option<Vec<&str>>, + envs: Option<Vec<&str>>, + preopens: Option<Vec<&str>> +)

Initializes the WASI host module with the given parameters.

+
Arguments
+
    +
  • +

    args - The commandline arguments. The first argument is the program name.

    +
  • +
  • +

    envs - The environment variables in the format ENV_VAR_NAME=VALUE.

    +
  • +
  • +

    preopens - The directories to pre-open. The required format is GUEST_PATH:HOST_PATH.

    +
  • +
+
source

pub fn exit_code(&self) -> u32

Returns the WASI exit code.

+

The WASI exit code can be accessed after running the “_start” function of a wasm32-wasi program.

+
source

pub fn get_native_handler(&self, fd: i32) -> WasmEdgeResult<u64>

Returns the native handler from the mapped FD/Handler.

+
Argument
+
    +
  • fd - The WASI mapped Fd.
  • +
+
Error
+

If fail to get the native handler, then an error is returned.

+
source

pub fn as_ptr(&self) -> *const WasmEdge_ModuleInstanceContext

Available on crate feature ffi only.

Provides a raw pointer to the inner module instance context.

+

Trait Implementations§

source§

impl Clone for WasiModule

source§

fn clone(&self) -> WasiModule

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasiModule

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for WasiModule

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/struct.WasmValue.html b/wasmedge_sys/struct.WasmValue.html new file mode 100644 index 000000000..6a8abc180 --- /dev/null +++ b/wasmedge_sys/struct.WasmValue.html @@ -0,0 +1,69 @@ +WasmValue in wasmedge_sys - Rust

Struct wasmedge_sys::WasmValue

source ·
pub struct WasmValue { /* private fields */ }
Expand description

Defines a WebAssembly value.

+

Implementations§

source§

impl WasmValue

source

pub fn as_raw(&self) -> WasmEdge_Value

Returns the raw WasmEdge_Value.

+
source

pub fn ty(&self) -> ValType

Returns the type of a WasmValue.

+
source

pub fn from_i32(val: i32) -> Self

Creates a WasmValue from a i32 value.

+
Argument
+
    +
  • val - The source i32 value.
  • +
+
source

pub fn to_i32(&self) -> i32

Generates a i32 value from a WasmValue.

+
source

pub fn from_i64(val: i64) -> Self

Creates a WasmValue from a i64 value.

+
Argument
+
    +
  • val - The source i64 value.
  • +
+
source

pub fn to_i64(&self) -> i64

Generates a i64 value from a WasmValue.

+
source

pub fn from_f32(val: f32) -> Self

Creates a WasmValue from a f32 value.

+
Argument
+
    +
  • val - The source f32 value.
  • +
+
source

pub fn to_f32(&self) -> f32

Generates a f32 value from a WasmValue.

+
source

pub fn from_f64(val: f64) -> Self

Creates a WasmValue from a f64 value.

+
Argument
+
    +
  • val - The source f64 value.
  • +
+
source

pub fn to_f64(&self) -> f64

Generates a f64 value from a WasmValue.

+
source

pub fn from_v128(val: i128) -> Self

Creates a WasmValue from a i128 value.

+
Argument
+
    +
  • val - The source i128 value.
  • +
+
source

pub fn to_v128(&self) -> i128

Generates a v128 value from a WasmValue.

+
source

pub fn from_null_ref(ref_ty: RefType) -> Self

Creates a WasmValue from a RefType value.

+
Argument
+
    +
  • val - The [RefType`] value.
  • +
+
source

pub fn is_null_ref(&self) -> bool

Checks if a WasmValue is NullRef or not.

+
source

pub fn from_func_ref(func_ref: FuncRef) -> Self

Creates a WasmValue from a FuncRef.

+

Notice that the WasmValues generated from FuncRefs are only meaningful when the bulk_memory_operations or reference_types option is enabled in the Config.

+
Argument
+ +
source

pub fn func_ref(&self) -> Option<FuncRef>

Returns the FuncRef(crate::FuncRef).

+

If the WasmValue is a NullRef, then None is returned.

+
source

pub fn from_extern_ref<T>(extern_obj: &mut T) -> Self

Creates a WasmValue from a reference to an external object.

+

The WasmValues generated by this function are only meaningful when the reference_types option is enabled in +the Config.

+
Argument
+
    +
  • extern_obj - The reference to an external object.
  • +
+
source

pub fn extern_ref<T>(&self) -> Option<&T>

Returns the reference to an external object.

+

If the WasmValue is a NullRef, then None is returned.

+

Trait Implementations§

source§

impl Clone for WasmValue

source§

fn clone(&self) -> WasmValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<WasmEdge_Value> for WasmValue

source§

fn from(raw_val: WasmEdge_Value) -> Self

Converts to this type from the input type.
source§

impl Copy for WasmValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/trait.AsImport.html b/wasmedge_sys/trait.AsImport.html new file mode 100644 index 000000000..978c25876 --- /dev/null +++ b/wasmedge_sys/trait.AsImport.html @@ -0,0 +1,50 @@ +AsImport in wasmedge_sys - Rust
pub trait AsImport {
+    // Required methods
+    fn name(&self) -> &str;
+    fn add_func(&mut self, name: impl AsRef<str>, func: Function);
+    fn add_table(&mut self, name: impl AsRef<str>, table: Table);
+    fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory);
+    fn add_global(&mut self, name: impl AsRef<str>, global: Global);
+}
Expand description

The module to be registered via the the Executor::register_import_module function is required to implement this trait.

+

Required Methods§

source

fn name(&self) -> &str

Returns the name of the module instance.

+
source

fn add_func(&mut self, name: impl AsRef<str>, func: Function)

Imports a host function instance.

+
Arguments
+
    +
  • +

    name - The name of the host function instance to import.

    +
  • +
  • +

    func - The host function instance to import.

    +
  • +
+
source

fn add_table(&mut self, name: impl AsRef<str>, table: Table)

Imports a table instance.

+
Arguments
+
    +
  • +

    name - The name of the host table instance to import.

    +
  • +
  • +

    table - The host table instance to import.

    +
  • +
+
source

fn add_memory(&mut self, name: impl AsRef<str>, memory: Memory)

Imports a memory instance.

+
Arguments
+
    +
  • +

    name - The name of the host memory instance to import.

    +
  • +
  • +

    memory - The host memory instance to import.

    +
  • +
+
source

fn add_global(&mut self, name: impl AsRef<str>, global: Global)

Imports a global instance.

+
Arguments
+
    +
  • +

    name - The name of the host global instance to import.

    +
  • +
  • +

    global - The host global instance to import.

    +
  • +
+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/wasmedge_sys/trait.AsInstance.html b/wasmedge_sys/trait.AsInstance.html new file mode 100644 index 000000000..c7fa0bd3c --- /dev/null +++ b/wasmedge_sys/trait.AsInstance.html @@ -0,0 +1,52 @@ +AsInstance in wasmedge_sys - Rust
pub trait AsInstance {
+    // Required methods
+    fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>;
+    fn func_len(&self) -> u32;
+    fn func_names(&self) -> Option<Vec<String>>;
+    fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>;
+    fn table_len(&self) -> u32;
+    fn table_names(&self) -> Option<Vec<String>>;
+    fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>;
+    fn mem_len(&self) -> u32;
+    fn mem_names(&self) -> Option<Vec<String>>;
+    fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>;
+    fn global_len(&self) -> u32;
+    fn global_names(&self) -> Option<Vec<String>>;
+}
Expand description

The object as an module instance is required to implement this trait.

+

Required Methods§

source

fn get_func(&self, name: impl AsRef<str>) -> WasmEdgeResult<Function>

Returns the exported function instance by name.

+
Argument
+ +
Error
+

If fail to find the target function, then an error is returned.

+
source

fn func_len(&self) -> u32

Returns the length of the exported function instances in this module instance.

+
source

fn func_names(&self) -> Option<Vec<String>>

Returns the names of the exported function instances in this module instance.

+
source

fn get_table(&self, name: impl AsRef<str>) -> WasmEdgeResult<Table>

Returns the exported table instance by name.

+
Argument
+ +
Error
+

If fail to find the target table instance, then an error is returned.

+
source

fn table_len(&self) -> u32

Returns the length of the exported table instances in this module instance.

+
source

fn table_names(&self) -> Option<Vec<String>>

Returns the names of the exported table instances in this module instance.

+
source

fn get_memory(&self, name: impl AsRef<str>) -> WasmEdgeResult<Memory>

Returns the exported memory instance by name.

+
Argument
+ +
Error
+

If fail to find the target memory instance, then an error is returned.

+
source

fn mem_len(&self) -> u32

Returns the length of the exported memory instances in this module instance.

+
source

fn mem_names(&self) -> Option<Vec<String>>

Returns the names of all exported memory instances in this module instance.

+
source

fn get_global(&self, name: impl AsRef<str>) -> WasmEdgeResult<Global>

Returns the exported global instance by name.

+
Argument
+ +
Error
+

If fail to find the target global instance, then an error is returned.

+
source

fn global_len(&self) -> u32

Returns the length of the exported global instances in this module instance.

+
source

fn global_names(&self) -> Option<Vec<String>>

Returns the names of the exported global instances in this module instance.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/wasmedge_sys/trait.Engine.html b/wasmedge_sys/trait.Engine.html new file mode 100644 index 000000000..6baac8267 --- /dev/null +++ b/wasmedge_sys/trait.Engine.html @@ -0,0 +1,46 @@ +Engine in wasmedge_sys - Rust

Trait wasmedge_sys::Engine

source ·
pub trait Engine {
+    // Required methods
+    fn run_func(
+        &self,
+        func: &Function,
+        params: impl IntoIterator<Item = WasmValue>
+    ) -> WasmEdgeResult<Vec<WasmValue>>;
+    fn run_func_ref(
+        &self,
+        func_ref: &FuncRef,
+        params: impl IntoIterator<Item = WasmValue>
+    ) -> WasmEdgeResult<Vec<WasmValue>>;
+}
Expand description

The object that is used to perform a host function is required to implement this trait.

+

Required Methods§

source

fn run_func( + &self, + func: &Function, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance and returns the results.

+
Arguments
+
    +
  • +

    func - The function instance to run.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
+
Errors
+

If fail to run the host function, then an error is returned.

+
source

fn run_func_ref( + &self, + func_ref: &FuncRef, + params: impl IntoIterator<Item = WasmValue> +) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance by calling its reference and returns the results.

+
Arguments
+
    +
  • +

    func_ref - A reference to the target host function instance.

    +
  • +
  • +

    params - The arguments to pass to the function.

    +
  • +
+
Errors
+

If fail to run the host function, then an error is returned.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/wasmedge_sys/types/index.html b/wasmedge_sys/types/index.html new file mode 100644 index 000000000..11fcf785c --- /dev/null +++ b/wasmedge_sys/types/index.html @@ -0,0 +1,2 @@ +wasmedge_sys::types - Rust

Module wasmedge_sys::types

source ·
Expand description

Defines the WebAssembly primitive types.

+

Structs

\ No newline at end of file diff --git a/wasmedge_sys/types/sidebar-items.js b/wasmedge_sys/types/sidebar-items.js new file mode 100644 index 000000000..69d7d1dad --- /dev/null +++ b/wasmedge_sys/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["WasmValue"]}; \ No newline at end of file diff --git a/wasmedge_sys/types/struct.WasmValue.html b/wasmedge_sys/types/struct.WasmValue.html new file mode 100644 index 000000000..d776ed184 --- /dev/null +++ b/wasmedge_sys/types/struct.WasmValue.html @@ -0,0 +1,69 @@ +WasmValue in wasmedge_sys::types - Rust
pub struct WasmValue { /* private fields */ }
Expand description

Defines a WebAssembly value.

+

Implementations§

source§

impl WasmValue

source

pub fn as_raw(&self) -> WasmEdge_Value

Returns the raw WasmEdge_Value.

+
source

pub fn ty(&self) -> ValType

Returns the type of a WasmValue.

+
source

pub fn from_i32(val: i32) -> Self

Creates a WasmValue from a i32 value.

+
Argument
+
    +
  • val - The source i32 value.
  • +
+
source

pub fn to_i32(&self) -> i32

Generates a i32 value from a WasmValue.

+
source

pub fn from_i64(val: i64) -> Self

Creates a WasmValue from a i64 value.

+
Argument
+
    +
  • val - The source i64 value.
  • +
+
source

pub fn to_i64(&self) -> i64

Generates a i64 value from a WasmValue.

+
source

pub fn from_f32(val: f32) -> Self

Creates a WasmValue from a f32 value.

+
Argument
+
    +
  • val - The source f32 value.
  • +
+
source

pub fn to_f32(&self) -> f32

Generates a f32 value from a WasmValue.

+
source

pub fn from_f64(val: f64) -> Self

Creates a WasmValue from a f64 value.

+
Argument
+
    +
  • val - The source f64 value.
  • +
+
source

pub fn to_f64(&self) -> f64

Generates a f64 value from a WasmValue.

+
source

pub fn from_v128(val: i128) -> Self

Creates a WasmValue from a i128 value.

+
Argument
+
    +
  • val - The source i128 value.
  • +
+
source

pub fn to_v128(&self) -> i128

Generates a v128 value from a WasmValue.

+
source

pub fn from_null_ref(ref_ty: RefType) -> Self

Creates a WasmValue from a RefType value.

+
Argument
+
    +
  • val - The [RefType`] value.
  • +
+
source

pub fn is_null_ref(&self) -> bool

Checks if a WasmValue is NullRef or not.

+
source

pub fn from_func_ref(func_ref: FuncRef) -> Self

Creates a WasmValue from a FuncRef.

+

Notice that the WasmValues generated from FuncRefs are only meaningful when the bulk_memory_operations or reference_types option is enabled in the Config.

+
Argument
+ +
source

pub fn func_ref(&self) -> Option<FuncRef>

Returns the FuncRef(crate::FuncRef).

+

If the WasmValue is a NullRef, then None is returned.

+
source

pub fn from_extern_ref<T>(extern_obj: &mut T) -> Self

Creates a WasmValue from a reference to an external object.

+

The WasmValues generated by this function are only meaningful when the reference_types option is enabled in +the Config.

+
Argument
+
    +
  • extern_obj - The reference to an external object.
  • +
+
source

pub fn extern_ref<T>(&self) -> Option<&T>

Returns the reference to an external object.

+

If the WasmValue is a NullRef, then None is returned.

+

Trait Implementations§

source§

impl Clone for WasmValue

source§

fn clone(&self) -> WasmValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<WasmEdge_Value> for WasmValue

source§

fn from(raw_val: WasmEdge_Value) -> Self

Converts to this type from the input type.
source§

impl Copy for WasmValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.driver_aot_compiler.html b/wasmedge_sys/utils/fn.driver_aot_compiler.html new file mode 100644 index 000000000..1db811a09 --- /dev/null +++ b/wasmedge_sys/utils/fn.driver_aot_compiler.html @@ -0,0 +1,4 @@ +driver_aot_compiler in wasmedge_sys::utils - Rust
pub fn driver_aot_compiler<I, V>(args: I) -> i32where
+    I: IntoIterator<Item = V>,
+    V: AsRef<str>,
Expand description

Triggers the WasmEdge AOT compiler tool

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.driver_runtime_tool.html b/wasmedge_sys/utils/fn.driver_runtime_tool.html new file mode 100644 index 000000000..202ebb809 --- /dev/null +++ b/wasmedge_sys/utils/fn.driver_runtime_tool.html @@ -0,0 +1,4 @@ +driver_runtime_tool in wasmedge_sys::utils - Rust
pub fn driver_runtime_tool<I, V>(args: I) -> i32where
+    I: IntoIterator<Item = V>,
+    V: AsRef<str>,
Expand description

Triggers the WasmEdge runtime tool

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.driver_unified_tool.html b/wasmedge_sys/utils/fn.driver_unified_tool.html new file mode 100644 index 000000000..275ded849 --- /dev/null +++ b/wasmedge_sys/utils/fn.driver_unified_tool.html @@ -0,0 +1,4 @@ +driver_unified_tool in wasmedge_sys::utils - Rust
pub fn driver_unified_tool<I, V>(args: I) -> i32where
+    I: IntoIterator<Item = V>,
+    V: AsRef<str>,
Expand description

Triggers the WasmEdge unified tool

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.log_debug_info.html b/wasmedge_sys/utils/fn.log_debug_info.html new file mode 100644 index 000000000..f440073df --- /dev/null +++ b/wasmedge_sys/utils/fn.log_debug_info.html @@ -0,0 +1,2 @@ +log_debug_info in wasmedge_sys::utils - Rust
pub fn log_debug_info()
Expand description

Logs the debug information.

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.log_error_info.html b/wasmedge_sys/utils/fn.log_error_info.html new file mode 100644 index 000000000..9d88ba04d --- /dev/null +++ b/wasmedge_sys/utils/fn.log_error_info.html @@ -0,0 +1,2 @@ +log_error_info in wasmedge_sys::utils - Rust
pub fn log_error_info()
Expand description

Logs the error information.

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.log_off.html b/wasmedge_sys/utils/fn.log_off.html new file mode 100644 index 000000000..b944f4867 --- /dev/null +++ b/wasmedge_sys/utils/fn.log_off.html @@ -0,0 +1,2 @@ +log_off in wasmedge_sys::utils - Rust

Function wasmedge_sys::utils::log_off

source ·
pub fn log_off()
Expand description

Sets the logging system off.

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.version_major_value.html b/wasmedge_sys/utils/fn.version_major_value.html new file mode 100644 index 000000000..1cad13387 --- /dev/null +++ b/wasmedge_sys/utils/fn.version_major_value.html @@ -0,0 +1,2 @@ +version_major_value in wasmedge_sys::utils - Rust
pub fn version_major_value() -> u32
Expand description

Returns the major version value.

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.version_minor_value.html b/wasmedge_sys/utils/fn.version_minor_value.html new file mode 100644 index 000000000..ad97e9259 --- /dev/null +++ b/wasmedge_sys/utils/fn.version_minor_value.html @@ -0,0 +1,2 @@ +version_minor_value in wasmedge_sys::utils - Rust
pub fn version_minor_value() -> u32
Expand description

Returns the minor version value.

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.version_patch_value.html b/wasmedge_sys/utils/fn.version_patch_value.html new file mode 100644 index 000000000..ee7676b9d --- /dev/null +++ b/wasmedge_sys/utils/fn.version_patch_value.html @@ -0,0 +1,2 @@ +version_patch_value in wasmedge_sys::utils - Rust
pub fn version_patch_value() -> u32
Expand description

Returns the patch version value.

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/fn.version_string.html b/wasmedge_sys/utils/fn.version_string.html new file mode 100644 index 000000000..0796a1442 --- /dev/null +++ b/wasmedge_sys/utils/fn.version_string.html @@ -0,0 +1,2 @@ +version_string in wasmedge_sys::utils - Rust
pub fn version_string() -> String
Expand description

Returns the version string.

+
\ No newline at end of file diff --git a/wasmedge_sys/utils/index.html b/wasmedge_sys/utils/index.html new file mode 100644 index 000000000..b9b2467c1 --- /dev/null +++ b/wasmedge_sys/utils/index.html @@ -0,0 +1,2 @@ +wasmedge_sys::utils - Rust

Module wasmedge_sys::utils

source ·
Expand description

Defines the versioning and logging functions.

+

Functions

\ No newline at end of file diff --git a/wasmedge_sys/utils/sidebar-items.js b/wasmedge_sys/utils/sidebar-items.js new file mode 100644 index 000000000..de7e04bcb --- /dev/null +++ b/wasmedge_sys/utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["driver_aot_compiler","driver_runtime_tool","driver_unified_tool","log_debug_info","log_error_info","log_off","version_major_value","version_minor_value","version_patch_value","version_string"]}; \ No newline at end of file diff --git a/wasmedge_sys/validator/struct.Validator.html b/wasmedge_sys/validator/struct.Validator.html new file mode 100644 index 000000000..ce2ac9fee --- /dev/null +++ b/wasmedge_sys/validator/struct.Validator.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../wasmedge_sys/struct.Validator.html...

+ + + \ No newline at end of file diff --git a/wasmedge_types/all.html b/wasmedge_types/all.html new file mode 100644 index 000000000..e04c1e765 --- /dev/null +++ b/wasmedge_types/all.html @@ -0,0 +1 @@ +List of all items in this crate
\ No newline at end of file diff --git a/wasmedge_types/enum.CompilerOptimizationLevel.html b/wasmedge_types/enum.CompilerOptimizationLevel.html new file mode 100644 index 000000000..ec65a0dd1 --- /dev/null +++ b/wasmedge_types/enum.CompilerOptimizationLevel.html @@ -0,0 +1,29 @@ +CompilerOptimizationLevel in wasmedge_types - Rust
pub enum CompilerOptimizationLevel {
+    O0,
+    O1,
+    O2,
+    O3,
+    Os,
+    Oz,
+}
Expand description

Defines WasmEdge AOT compiler optimization level.

+

Variants§

§

O0

Disable as many optimizations as possible.

+
§

O1

Optimize quickly without destroying debuggability.

+
§

O2

Optimize for fast execution as much as possible without triggering significant incremental compile time or code size growth.

+
§

O3

Optimize for fast execution as much as possible.

+
§

Os

Optimize for small code size as much as possible without triggering +significant incremental compile time or execution time slowdowns.

+
§

Oz

Optimize for small code size as much as possible.

+

Trait Implementations§

source§

impl Clone for CompilerOptimizationLevel

source§

fn clone(&self) -> CompilerOptimizationLevel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CompilerOptimizationLevel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<CompilerOptimizationLevel> for i32

source§

fn from(val: CompilerOptimizationLevel) -> i32

Converts to this type from the input type.
source§

impl From<CompilerOptimizationLevel> for u32

source§

fn from(val: CompilerOptimizationLevel) -> u32

Converts to this type from the input type.
source§

impl From<i32> for CompilerOptimizationLevel

source§

fn from(val: i32) -> CompilerOptimizationLevel

Converts to this type from the input type.
source§

impl From<u32> for CompilerOptimizationLevel

source§

fn from(val: u32) -> CompilerOptimizationLevel

Converts to this type from the input type.
source§

impl PartialEq for CompilerOptimizationLevel

source§

fn eq(&self, other: &CompilerOptimizationLevel) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for CompilerOptimizationLevel

source§

impl Eq for CompilerOptimizationLevel

source§

impl StructuralEq for CompilerOptimizationLevel

source§

impl StructuralPartialEq for CompilerOptimizationLevel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/enum.CompilerOutputFormat.html b/wasmedge_types/enum.CompilerOutputFormat.html new file mode 100644 index 000000000..b42fc8547 --- /dev/null +++ b/wasmedge_types/enum.CompilerOutputFormat.html @@ -0,0 +1,20 @@ +CompilerOutputFormat in wasmedge_types - Rust
pub enum CompilerOutputFormat {
+    Native,
+    Wasm,
+}
Expand description

Defines WasmEdge AOT compiler output binary format.

+

Variants§

§

Native

Native dynamic library format.

+
§

Wasm

WebAssembly with AOT compiled codes in custom sections.

+

Trait Implementations§

source§

impl Clone for CompilerOutputFormat

source§

fn clone(&self) -> CompilerOutputFormat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CompilerOutputFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<CompilerOutputFormat> for i32

source§

fn from(val: CompilerOutputFormat) -> i32

Converts to this type from the input type.
source§

impl From<CompilerOutputFormat> for u32

source§

fn from(val: CompilerOutputFormat) -> u32

Converts to this type from the input type.
source§

impl From<i32> for CompilerOutputFormat

source§

fn from(val: i32) -> CompilerOutputFormat

Converts to this type from the input type.
source§

impl From<u32> for CompilerOutputFormat

source§

fn from(val: u32) -> CompilerOutputFormat

Converts to this type from the input type.
source§

impl PartialEq for CompilerOutputFormat

source§

fn eq(&self, other: &CompilerOutputFormat) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for CompilerOutputFormat

source§

impl Eq for CompilerOutputFormat

source§

impl StructuralEq for CompilerOutputFormat

source§

impl StructuralPartialEq for CompilerOutputFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/enum.ExternalInstanceType.html b/wasmedge_types/enum.ExternalInstanceType.html new file mode 100644 index 000000000..655f42888 --- /dev/null +++ b/wasmedge_types/enum.ExternalInstanceType.html @@ -0,0 +1,25 @@ +ExternalInstanceType in wasmedge_types - Rust
pub enum ExternalInstanceType {
+    Func(FuncType),
+    Table(TableType),
+    Memory(MemoryType),
+    Global(GlobalType),
+}
Expand description

Defines the type of external WasmEdge instances.

+

Variants§

§

Func(FuncType)

A WasmEdge instance that is a WasmEdge Func.

+
§

Table(TableType)

A WasmEdge instance that is a WasmEdge Table.

+
§

Memory(MemoryType)

A WasmEdge instance that is a WasmEdge Memory.

+
§

Global(GlobalType)

A WasmEdge instance that is a WasmEdge Global.

+

Trait Implementations§

source§

impl Clone for ExternalInstanceType

source§

fn clone(&self) -> ExternalInstanceType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExternalInstanceType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ExternalInstanceType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<i32> for ExternalInstanceType

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<u32> for ExternalInstanceType

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ExternalInstanceType

source§

fn eq(&self, other: &ExternalInstanceType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ExternalInstanceType

source§

impl StructuralEq for ExternalInstanceType

source§

impl StructuralPartialEq for ExternalInstanceType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/enum.HostRegistration.html b/wasmedge_types/enum.HostRegistration.html new file mode 100644 index 000000000..afe94fbba --- /dev/null +++ b/wasmedge_types/enum.HostRegistration.html @@ -0,0 +1,26 @@ +HostRegistration in wasmedge_types - Rust
pub enum HostRegistration {
+    Wasi,
+    WasmEdgeProcess,
+    WasiNn,
+    WasiCryptoCommon,
+    WasiCryptoAsymmetricCommon,
+    WasiCryptoKx,
+    WasiCryptoSignatures,
+    WasiCryptoSymmetric,
+}
Expand description

Defines WasmEdge host module registration enum.

+

Variants§

§

Wasi

§

WasmEdgeProcess

§

WasiNn

§

WasiCryptoCommon

§

WasiCryptoAsymmetricCommon

§

WasiCryptoKx

§

WasiCryptoSignatures

§

WasiCryptoSymmetric

Trait Implementations§

source§

impl Clone for HostRegistration

source§

fn clone(&self) -> HostRegistration

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HostRegistration

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<HostRegistration> for u32

source§

fn from(val: HostRegistration) -> u32

Converts to this type from the input type.
source§

impl From<u32> for HostRegistration

source§

fn from(val: u32) -> Self

Converts to this type from the input type.
source§

impl Hash for HostRegistration

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for HostRegistration

source§

fn eq(&self, other: &HostRegistration) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for HostRegistration

source§

impl Eq for HostRegistration

source§

impl StructuralEq for HostRegistration

source§

impl StructuralPartialEq for HostRegistration

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/enum.Mutability.html b/wasmedge_types/enum.Mutability.html new file mode 100644 index 000000000..16de8c99e --- /dev/null +++ b/wasmedge_types/enum.Mutability.html @@ -0,0 +1,21 @@ +Mutability in wasmedge_types - Rust
pub enum Mutability {
+    Const,
+    Var,
+}
Expand description

Defines the mutability property of WasmEdge Global variables.

+

Mutability determines the mutability property of a WasmEdge Global variable is either mutable or immutable.

+

Variants§

§

Const

Identifies an immutable global variable.

+
§

Var

Identifies a mutable global variable.

+

Trait Implementations§

source§

impl Clone for Mutability

source§

fn clone(&self) -> Mutability

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mutability

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Mutability> for i32

source§

fn from(value: Mutability) -> Self

Converts to this type from the input type.
source§

impl From<Mutability> for u32

source§

fn from(value: Mutability) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Mutability

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Mutability

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Mutability

source§

fn eq(&self, other: &Mutability) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Mutability

source§

impl Eq for Mutability

source§

impl StructuralEq for Mutability

source§

impl StructuralPartialEq for Mutability

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/enum.NeverType.html b/wasmedge_types/enum.NeverType.html new file mode 100644 index 000000000..5f9621a0b --- /dev/null +++ b/wasmedge_types/enum.NeverType.html @@ -0,0 +1,13 @@ +NeverType in wasmedge_types - Rust
pub enum NeverType {}
Expand description

This is a workaround solution to the never type in Rust. It will be replaced by ! once it is stable.

+

Trait Implementations§

source§

impl Clone for NeverType

source§

fn clone(&self) -> NeverType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NeverType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Send for NeverType

source§

impl Sync for NeverType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/enum.RefType.html b/wasmedge_types/enum.RefType.html new file mode 100644 index 000000000..cf20dac2f --- /dev/null +++ b/wasmedge_types/enum.RefType.html @@ -0,0 +1,20 @@ +RefType in wasmedge_types - Rust
pub enum RefType {
+    FuncRef,
+    ExternRef,
+}
Expand description

Defines WasmEdge reference types.

+

Variants§

§

FuncRef

Refers to the infinite union of all references to host functions, regardless of their function types.

+
§

ExternRef

Refers to the infinite union of all references to objects and that can be passed into WebAssembly under this type.

+

Trait Implementations§

source§

impl Clone for RefType

source§

fn clone(&self) -> RefType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RefType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<RefType> for i32

source§

fn from(value: RefType) -> Self

Converts to this type from the input type.
source§

impl From<RefType> for u32

source§

fn from(value: RefType) -> Self

Converts to this type from the input type.
source§

impl From<i32> for RefType

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<u32> for RefType

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl PartialEq for RefType

source§

fn eq(&self, other: &RefType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for RefType

source§

impl Eq for RefType

source§

impl StructuralEq for RefType

source§

impl StructuralPartialEq for RefType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/enum.ValType.html b/wasmedge_types/enum.ValType.html new file mode 100644 index 000000000..7fe001ce7 --- /dev/null +++ b/wasmedge_types/enum.ValType.html @@ -0,0 +1,34 @@ +ValType in wasmedge_types - Rust
pub enum ValType {
+    I32,
+    I64,
+    F32,
+    F64,
+    V128,
+    FuncRef,
+    ExternRef,
+}
Expand description

Defines WasmEdge value types.

+

Variants§

§

I32

32-bit integer.

+

Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.

+
§

I64

64-bit integer.

+

Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.

+
§

F32

32-bit floating-point data as defined by the IEEE 754-2019.

+
§

F64

64-bit floating-point data as defined by the IEEE 754-2019.

+
§

V128

128-bit vector of packed integer or floating-point data.

+

The packed data can be interpreted as signed or unsigned integers, single or double precision floating-point +values, or a single 128 bit type. The interpretation is determined by individual operations.

+
§

FuncRef

A reference to a host function.

+
§

ExternRef

A reference to object.

+

Trait Implementations§

source§

impl Clone for ValType

source§

fn clone(&self) -> ValType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ValType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ValType> for i32

source§

fn from(value: ValType) -> Self

Converts to this type from the input type.
source§

impl From<ValType> for u32

source§

fn from(value: ValType) -> Self

Converts to this type from the input type.
source§

impl From<i32> for ValType

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<u32> for ValType

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ValType

source§

fn eq(&self, other: &ValType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for ValType

source§

impl Eq for ValType

source§

impl StructuralEq for ValType

source§

impl StructuralPartialEq for ValType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.CoreCommonError.html b/wasmedge_types/error/enum.CoreCommonError.html new file mode 100644 index 000000000..da7985370 --- /dev/null +++ b/wasmedge_types/error/enum.CoreCommonError.html @@ -0,0 +1,25 @@ +CoreCommonError in wasmedge_types::error - Rust
pub enum CoreCommonError {
+    RuntimeError,
+    CostLimitExceeded,
+    WrongVMWorkflow,
+    FuncNotFound,
+    AOTDisabled,
+    Interrupted,
+    UserDefError,
+    NotValidated,
+}
Expand description

The error type for the common errors from WasmEdge Core.

+

Variants§

§

RuntimeError

§

CostLimitExceeded

§

WrongVMWorkflow

§

FuncNotFound

§

AOTDisabled

§

Interrupted

§

UserDefError

§

NotValidated

Trait Implementations§

source§

impl Clone for CoreCommonError

source§

fn clone(&self) -> CoreCommonError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoreCommonError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CoreCommonError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CoreCommonError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for CoreCommonError

source§

fn eq(&self, other: &CoreCommonError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CoreCommonError

source§

impl StructuralEq for CoreCommonError

source§

impl StructuralPartialEq for CoreCommonError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.CoreError.html b/wasmedge_types/error/enum.CoreError.html new file mode 100644 index 000000000..5c5acff62 --- /dev/null +++ b/wasmedge_types/error/enum.CoreError.html @@ -0,0 +1,22 @@ +CoreError in wasmedge_types::error - Rust
pub enum CoreError {
+    Common(CoreCommonError),
+    Load(CoreLoadError),
+    Validation(CoreValidationError),
+    Instantiation(CoreInstantiationError),
+    Execution(CoreExecutionError),
+}
Expand description

The error types raised by WasmEdge Core.

+

Variants§

Trait Implementations§

source§

impl Clone for CoreError

source§

fn clone(&self) -> CoreError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoreError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CoreError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CoreError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for CoreError

source§

fn eq(&self, other: &CoreError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CoreError

source§

impl StructuralEq for CoreError

source§

impl StructuralPartialEq for CoreError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.CoreExecutionError.html b/wasmedge_types/error/enum.CoreExecutionError.html new file mode 100644 index 000000000..b94e3f8fb --- /dev/null +++ b/wasmedge_types/error/enum.CoreExecutionError.html @@ -0,0 +1,34 @@ +CoreExecutionError in wasmedge_types::error - Rust
pub enum CoreExecutionError {
+
Show 17 variants WrongInstanceAddress, + WrongInstanceIndex, + InstrTypeMismatch, + FuncTypeMismatch, + DivideByZero, + IntegerOverflow, + InvalidConvToInt, + TableOutOfBounds, + MemoryOutOfBounds, + Unreachable, + UninitializedElement, + UndefinedElement, + IndirectCallTypeMismatch, + HostFuncFailed, + RefTypeMismatch, + UnalignedAtomicAccess, + ExpectSharedMemory, +
}
Expand description

The error type for the execution phase from WasmEdge Core.

+

Variants§

§

WrongInstanceAddress

§

WrongInstanceIndex

§

InstrTypeMismatch

§

FuncTypeMismatch

§

DivideByZero

§

IntegerOverflow

§

InvalidConvToInt

§

TableOutOfBounds

§

MemoryOutOfBounds

§

Unreachable

§

UninitializedElement

§

UndefinedElement

§

IndirectCallTypeMismatch

§

HostFuncFailed

§

RefTypeMismatch

§

UnalignedAtomicAccess

§

ExpectSharedMemory

Trait Implementations§

source§

impl Clone for CoreExecutionError

source§

fn clone(&self) -> CoreExecutionError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoreExecutionError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CoreExecutionError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CoreExecutionError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for CoreExecutionError

source§

fn eq(&self, other: &CoreExecutionError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CoreExecutionError

source§

impl StructuralEq for CoreExecutionError

source§

impl StructuralPartialEq for CoreExecutionError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.CoreInstantiationError.html b/wasmedge_types/error/enum.CoreInstantiationError.html new file mode 100644 index 000000000..0b7599a2b --- /dev/null +++ b/wasmedge_types/error/enum.CoreInstantiationError.html @@ -0,0 +1,22 @@ +CoreInstantiationError in wasmedge_types::error - Rust
pub enum CoreInstantiationError {
+    ModuleNameConflict,
+    IncompatibleImportType,
+    UnknownImport,
+    DataSegDoesNotFit,
+    ElemSegDoesNotFit,
+}
Expand description

The error type for the instantiation phase from WasmEdge Core.

+

Variants§

§

ModuleNameConflict

§

IncompatibleImportType

§

UnknownImport

§

DataSegDoesNotFit

§

ElemSegDoesNotFit

Trait Implementations§

source§

impl Clone for CoreInstantiationError

source§

fn clone(&self) -> CoreInstantiationError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoreInstantiationError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CoreInstantiationError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CoreInstantiationError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for CoreInstantiationError

source§

fn eq(&self, other: &CoreInstantiationError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CoreInstantiationError

source§

impl StructuralEq for CoreInstantiationError

source§

impl StructuralPartialEq for CoreInstantiationError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.CoreLoadError.html b/wasmedge_types/error/enum.CoreLoadError.html new file mode 100644 index 000000000..ef136d15c --- /dev/null +++ b/wasmedge_types/error/enum.CoreLoadError.html @@ -0,0 +1,42 @@ +CoreLoadError in wasmedge_types::error - Rust
pub enum CoreLoadError {
+
Show 25 variants IllegalPath, + ReadError, + UnexpectedEnd, + MalformedMagic, + MalformedVersion, + MalformedSection, + SectionSizeMismatch, + NameSizeOutOfBounds, + JunkSection, + IncompatibleFuncCode, + IncompatibleDataCount, + DataCountRequired, + MalformedImportKind, + MalformedExportKind, + ExpectedZeroByte, + InvalidMut, + TooManyLocals, + MalformedValType, + MalformedElemType, + MalformedRefType, + MalformedUTF8, + IntegerTooLarge, + IntegerTooLong, + IllegalOpCode, + IllegalGrammar, +
}
Expand description

The error type for the load phase from WasmEdge Core.

+

Variants§

§

IllegalPath

§

ReadError

§

UnexpectedEnd

§

MalformedMagic

§

MalformedVersion

§

MalformedSection

§

SectionSizeMismatch

§

NameSizeOutOfBounds

§

JunkSection

§

IncompatibleFuncCode

§

IncompatibleDataCount

§

DataCountRequired

§

MalformedImportKind

§

MalformedExportKind

§

ExpectedZeroByte

§

InvalidMut

§

TooManyLocals

§

MalformedValType

§

MalformedElemType

§

MalformedRefType

§

MalformedUTF8

§

IntegerTooLarge

§

IntegerTooLong

§

IllegalOpCode

§

IllegalGrammar

Trait Implementations§

source§

impl Clone for CoreLoadError

source§

fn clone(&self) -> CoreLoadError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoreLoadError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CoreLoadError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CoreLoadError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for CoreLoadError

source§

fn eq(&self, other: &CoreLoadError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CoreLoadError

source§

impl StructuralEq for CoreLoadError

source§

impl StructuralPartialEq for CoreLoadError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.CoreValidationError.html b/wasmedge_types/error/enum.CoreValidationError.html new file mode 100644 index 000000000..39eaccc48 --- /dev/null +++ b/wasmedge_types/error/enum.CoreValidationError.html @@ -0,0 +1,39 @@ +CoreValidationError in wasmedge_types::error - Rust
pub enum CoreValidationError {
+
Show 22 variants InvalidAlignment, + TypeCheckFailed, + InvalidLabelIdx, + InvalidLocalIdx, + InvalidFuncTypeIdx, + InvalidFuncIdx, + InvalidTableIdx, + InvalidMemoryIdx, + InvalidGlobalIdx, + InvalidElemIdx, + InvalidDataIdx, + InvalidRefIdx, + ConstExprRequired, + DupExportName, + ImmutableGlobal, + InvalidResultArity, + MultiTables, + MultiMemories, + InvalidLimit, + InvalidMemPages, + InvalidStartFunc, + InvalidLaneIdx, +
}
Expand description

The error type for the validation phase from WasmEdge Core.

+

Variants§

§

InvalidAlignment

§

TypeCheckFailed

§

InvalidLabelIdx

§

InvalidLocalIdx

§

InvalidFuncTypeIdx

§

InvalidFuncIdx

§

InvalidTableIdx

§

InvalidMemoryIdx

§

InvalidGlobalIdx

§

InvalidElemIdx

§

InvalidDataIdx

§

InvalidRefIdx

§

ConstExprRequired

§

DupExportName

§

ImmutableGlobal

§

InvalidResultArity

§

MultiTables

§

MultiMemories

§

InvalidLimit

§

InvalidMemPages

§

InvalidStartFunc

§

InvalidLaneIdx

Trait Implementations§

source§

impl Clone for CoreValidationError

source§

fn clone(&self) -> CoreValidationError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoreValidationError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CoreValidationError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CoreValidationError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for CoreValidationError

source§

fn eq(&self, other: &CoreValidationError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CoreValidationError

source§

impl StructuralEq for CoreValidationError

source§

impl StructuralPartialEq for CoreValidationError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.ExportError.html b/wasmedge_types/error/enum.ExportError.html new file mode 100644 index 000000000..9a216507d --- /dev/null +++ b/wasmedge_types/error/enum.ExportError.html @@ -0,0 +1,25 @@ +ExportError in wasmedge_types::error - Rust
pub enum ExportError {
+    Type {
+        expected: ExternalInstanceType,
+        actual: ExternalInstanceType,
+    },
+    FuncType(String),
+    TableType(String),
+    MemType(String),
+    GlobalType(String),
+}
Expand description

The error types for WasmEdge ExportType.

+

Variants§

§

Type

§

FuncType(String)

§

TableType(String)

§

MemType(String)

§

GlobalType(String)

Trait Implementations§

source§

impl Clone for ExportError

source§

fn clone(&self) -> ExportError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExportError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ExportError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ExportError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for ExportError

source§

fn eq(&self, other: &ExportError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ExportError

source§

impl StructuralEq for ExportError

source§

impl StructuralPartialEq for ExportError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.FuncError.html b/wasmedge_types/error/enum.FuncError.html new file mode 100644 index 000000000..67215e104 --- /dev/null +++ b/wasmedge_types/error/enum.FuncError.html @@ -0,0 +1,20 @@ +FuncError in wasmedge_types::error - Rust
pub enum FuncError {
+    Create,
+    CreateBinding(String),
+    Type,
+}
Expand description

The error types for WasmEdge Function.

+

Variants§

§

Create

§

CreateBinding(String)

§

Type

Trait Implementations§

source§

impl Clone for FuncError

source§

fn clone(&self) -> FuncError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FuncError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for FuncError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for FuncError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for FuncError

source§

fn eq(&self, other: &FuncError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for FuncError

source§

impl StructuralEq for FuncError

source§

impl StructuralPartialEq for FuncError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.GlobalError.html b/wasmedge_types/error/enum.GlobalError.html new file mode 100644 index 000000000..9b22eb44d --- /dev/null +++ b/wasmedge_types/error/enum.GlobalError.html @@ -0,0 +1,21 @@ +GlobalError in wasmedge_types::error - Rust
pub enum GlobalError {
+    Create,
+    Type,
+    ModifyConst,
+    UnmatchedValType,
+}
Expand description

The error types for WasmEdge Global.

+

Variants§

§

Create

§

Type

§

ModifyConst

§

UnmatchedValType

Trait Implementations§

source§

impl Clone for GlobalError

source§

fn clone(&self) -> GlobalError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GlobalError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for GlobalError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for GlobalError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for GlobalError

source§

fn eq(&self, other: &GlobalError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for GlobalError

source§

impl StructuralEq for GlobalError

source§

impl StructuralPartialEq for GlobalError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.HostFuncError.html b/wasmedge_types/error/enum.HostFuncError.html new file mode 100644 index 000000000..a1b61eed8 --- /dev/null +++ b/wasmedge_types/error/enum.HostFuncError.html @@ -0,0 +1,19 @@ +HostFuncError in wasmedge_types::error - Rust
pub enum HostFuncError {
+    User(u32),
+    Runtime(u32),
+}
Expand description

The error type for the host function definition.

+

Variants§

§

User(u32)

§

Runtime(u32)

Trait Implementations§

source§

impl Clone for HostFuncError

source§

fn clone(&self) -> HostFuncError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HostFuncError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for HostFuncError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for HostFuncError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for HostFuncError

source§

fn eq(&self, other: &HostFuncError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for HostFuncError

source§

impl StructuralEq for HostFuncError

source§

impl StructuralPartialEq for HostFuncError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.ImportError.html b/wasmedge_types/error/enum.ImportError.html new file mode 100644 index 000000000..c7bc80928 --- /dev/null +++ b/wasmedge_types/error/enum.ImportError.html @@ -0,0 +1,25 @@ +ImportError in wasmedge_types::error - Rust
pub enum ImportError {
+    Type {
+        expected: ExternalInstanceType,
+        actual: ExternalInstanceType,
+    },
+    FuncType(String),
+    TableType(String),
+    MemType(String),
+    GlobalType(String),
+}
Expand description

The error types for WasmEdge ImportType.

+

Variants§

§

Type

§

FuncType(String)

§

TableType(String)

§

MemType(String)

§

GlobalType(String)

Trait Implementations§

source§

impl Clone for ImportError

source§

fn clone(&self) -> ImportError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ImportError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ImportError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ImportError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for ImportError

source§

fn eq(&self, other: &ImportError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ImportError

source§

impl StructuralEq for ImportError

source§

impl StructuralPartialEq for ImportError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.InstanceError.html b/wasmedge_types/error/enum.InstanceError.html new file mode 100644 index 000000000..80135df1b --- /dev/null +++ b/wasmedge_types/error/enum.InstanceError.html @@ -0,0 +1,26 @@ +InstanceError in wasmedge_types::error - Rust
pub enum InstanceError {
+    Create,
+    CreateWasi,
+    CreateWasmEdgeProcess,
+    CreateImportModule,
+    NotFoundFunc(String),
+    NotFoundTable(String),
+    NotFoundMem(String),
+    NotFoundGlobal(String),
+    NotFoundMappedFdHandler,
+}
Expand description

The error types for WasmEdge Instance.

+

Variants§

§

Create

§

CreateWasi

§

CreateWasmEdgeProcess

§

CreateImportModule

§

NotFoundFunc(String)

§

NotFoundTable(String)

§

NotFoundMem(String)

§

NotFoundGlobal(String)

§

NotFoundMappedFdHandler

Trait Implementations§

source§

impl Clone for InstanceError

source§

fn clone(&self) -> InstanceError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for InstanceError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for InstanceError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for InstanceError

source§

fn eq(&self, other: &InstanceError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for InstanceError

source§

impl StructuralEq for InstanceError

source§

impl StructuralPartialEq for InstanceError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.MemError.html b/wasmedge_types/error/enum.MemError.html new file mode 100644 index 000000000..8de61792b --- /dev/null +++ b/wasmedge_types/error/enum.MemError.html @@ -0,0 +1,23 @@ +MemError in wasmedge_types::error - Rust
pub enum MemError {
+    Create,
+    CreateSharedType,
+    Type,
+    ConstPtr,
+    MutPtr,
+    Ptr2Ref,
+}
Expand description

The error types for WasmEdge Memory.

+

Variants§

§

Create

§

CreateSharedType

§

Type

§

ConstPtr

§

MutPtr

§

Ptr2Ref

Trait Implementations§

source§

impl Clone for MemError

source§

fn clone(&self) -> MemError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MemError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for MemError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for MemError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for MemError

source§

fn eq(&self, other: &MemError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for MemError

source§

impl StructuralEq for MemError

source§

impl StructuralPartialEq for MemError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.PluginError.html b/wasmedge_types/error/enum.PluginError.html new file mode 100644 index 000000000..9f9c59272 --- /dev/null +++ b/wasmedge_types/error/enum.PluginError.html @@ -0,0 +1,19 @@ +PluginError in wasmedge_types::error - Rust
pub enum PluginError {
+    Create(String),
+    NotFound(String),
+}
Expand description

The error types for WasmEdge plugin.

+

Variants§

§

Create(String)

§

NotFound(String)

Trait Implementations§

source§

impl Clone for PluginError

source§

fn clone(&self) -> PluginError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PluginError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for PluginError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for PluginError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for PluginError

source§

fn eq(&self, other: &PluginError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for PluginError

source§

impl StructuralEq for PluginError

source§

impl StructuralPartialEq for PluginError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.StoreError.html b/wasmedge_types/error/enum.StoreError.html new file mode 100644 index 000000000..7df8eab76 --- /dev/null +++ b/wasmedge_types/error/enum.StoreError.html @@ -0,0 +1,40 @@ +StoreError in wasmedge_types::error - Rust
pub enum StoreError {
+    Create,
+    NotFoundFunc(String),
+    NotFoundFuncRegistered {
+        func_name: String,
+        mod_name: String,
+    },
+    NotFoundTable(String),
+    NotFoundTableRegistered {
+        table_name: String,
+        mod_name: String,
+    },
+    NotFoundMem(String),
+    NotFoundMemRegistered {
+        mem_name: String,
+        mod_name: String,
+    },
+    NotFoundGlobal(String),
+    NotFoundGlobalRegistered {
+        global_name: String,
+        mod_name: String,
+    },
+    NotFoundModule(String),
+    NotFoundActiveModule,
+}
Expand description

The error types for WasmEdge Store.

+

Variants§

§

Create

§

NotFoundFunc(String)

§

NotFoundFuncRegistered

Fields

§func_name: String
§mod_name: String
§

NotFoundTable(String)

§

NotFoundTableRegistered

Fields

§table_name: String
§mod_name: String
§

NotFoundMem(String)

§

NotFoundMemRegistered

Fields

§mem_name: String
§mod_name: String
§

NotFoundGlobal(String)

§

NotFoundGlobalRegistered

Fields

§global_name: String
§mod_name: String
§

NotFoundModule(String)

§

NotFoundActiveModule

Trait Implementations§

source§

impl Clone for StoreError

source§

fn clone(&self) -> StoreError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StoreError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for StoreError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for StoreError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for StoreError

source§

fn eq(&self, other: &StoreError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for StoreError

source§

impl StructuralEq for StoreError

source§

impl StructuralPartialEq for StoreError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.TableError.html b/wasmedge_types/error/enum.TableError.html new file mode 100644 index 000000000..63d736668 --- /dev/null +++ b/wasmedge_types/error/enum.TableError.html @@ -0,0 +1,19 @@ +TableError in wasmedge_types::error - Rust
pub enum TableError {
+    Create,
+    Type,
+}
Expand description

The error types for WasmEdge Table.

+

Variants§

§

Create

§

Type

Trait Implementations§

source§

impl Clone for TableError

source§

fn clone(&self) -> TableError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TableError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for TableError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for TableError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for TableError

source§

fn eq(&self, other: &TableError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TableError

source§

impl StructuralEq for TableError

source§

impl StructuralPartialEq for TableError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.VmError.html b/wasmedge_types/error/enum.VmError.html new file mode 100644 index 000000000..2f4b9eb3c --- /dev/null +++ b/wasmedge_types/error/enum.VmError.html @@ -0,0 +1,39 @@ +VmError in wasmedge_types::error - Rust
pub enum VmError {
+
Show 22 variants Create, + CreateWithWasiContext, + NotFoundFuncType(String), + NotFoundModule(String), + NotFoundWasiModule, + NotFoundWasmEdgeProcessModule, + NotFoundWasiNnModule, + NotFoundWasiCryptoCommonModule, + NotFoundWasiCryptoAsymmetricCommonModule, + NotFoundWasiCryptoSymmetricModule, + NotFoundWasiCryptoKxModule, + NotFoundWasiCryptoSignaturesModule, + NotFoundStore, + NotFoundStatistics, + NotFoundImportModule(String), + DuplicateImportModule(String), + DuplicateModuleInstance(String), + NotFoundLoader, + NotFoundValidator, + NotFoundExecutor, + InvalidImportModule, + NotFoundActiveModule, +
}
Expand description

The error types for WasmEdge Vm.

+

Variants§

§

Create

§

CreateWithWasiContext

§

NotFoundFuncType(String)

§

NotFoundModule(String)

§

NotFoundWasiModule

§

NotFoundWasmEdgeProcessModule

§

NotFoundWasiNnModule

§

NotFoundWasiCryptoCommonModule

§

NotFoundWasiCryptoAsymmetricCommonModule

§

NotFoundWasiCryptoSymmetricModule

§

NotFoundWasiCryptoKxModule

§

NotFoundWasiCryptoSignaturesModule

§

NotFoundStore

§

NotFoundStatistics

§

NotFoundImportModule(String)

§

DuplicateImportModule(String)

§

DuplicateModuleInstance(String)

§

NotFoundLoader

§

NotFoundValidator

§

NotFoundExecutor

§

InvalidImportModule

§

NotFoundActiveModule

Trait Implementations§

source§

impl Clone for VmError

source§

fn clone(&self) -> VmError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VmError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VmError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for VmError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq for VmError

source§

fn eq(&self, other: &VmError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for VmError

source§

impl StructuralEq for VmError

source§

impl StructuralPartialEq for VmError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/enum.WasmEdgeError.html b/wasmedge_types/error/enum.WasmEdgeError.html new file mode 100644 index 000000000..66fd8a83c --- /dev/null +++ b/wasmedge_types/error/enum.WasmEdgeError.html @@ -0,0 +1,49 @@ +WasmEdgeError in wasmedge_types::error - Rust
pub enum WasmEdgeError {
+
Show 31 variants Operation(String), + User(u32), + Core(CoreError), + ImportObjCreate, + ExecutorCreate, + Store(StoreError), + StatisticsCreate, + ModuleCreate, + LoaderCreate, + ConfigCreate, + CompilerCreate, + ValidatorCreate, + Vm(VmError), + Func(FuncError), + FuncTypeCreate, + ExecuteTimeout, + Mem(MemError), + MemTypeCreate, + Global(GlobalError), + GlobalTypeCreate, + Table(TableError), + TableTypeCreate, + Import(ImportError), + Export(ExportError), + Instance(InstanceError), + Plugin(PluginError), + FoundNulByte(NulError), + NotFoundNulByte(FromBytesWithNulError), + Utf8(Utf8Error), + FromUtf8(FromUtf8Error), + WindowsPathConversion(String), +
}
Expand description

The error types used by both wasmedge-sys and wasmedge crates.

+

Variants§

§

Operation(String)

§

User(u32)

§

Core(CoreError)

Errors raised by WasmEdge Core.

+
§

ImportObjCreate

§

ExecutorCreate

§

Store(StoreError)

§

StatisticsCreate

§

ModuleCreate

§

LoaderCreate

§

ConfigCreate

§

CompilerCreate

§

ValidatorCreate

§

Vm(VmError)

§

Func(FuncError)

§

FuncTypeCreate

§

ExecuteTimeout

§

Mem(MemError)

§

MemTypeCreate

§

Global(GlobalError)

§

GlobalTypeCreate

§

Table(TableError)

§

TableTypeCreate

§

Import(ImportError)

§

Export(ExportError)

§

Instance(InstanceError)

§

Plugin(PluginError)

§

FoundNulByte(NulError)

§

NotFoundNulByte(FromBytesWithNulError)

§

Utf8(Utf8Error)

§

FromUtf8(FromUtf8Error)

§

WindowsPathConversion(String)

Trait Implementations§

source§

impl Clone for WasmEdgeError

source§

fn clone(&self) -> WasmEdgeError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WasmEdgeError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for WasmEdgeError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for WasmEdgeError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<FromBytesWithNulError> for WasmEdgeError

source§

fn from(source: FromBytesWithNulError) -> Self

Converts to this type from the input type.
source§

impl From<FromUtf8Error> for WasmEdgeError

source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
source§

impl From<NulError> for WasmEdgeError

source§

fn from(source: NulError) -> Self

Converts to this type from the input type.
source§

impl From<Utf8Error> for WasmEdgeError

source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.
source§

impl PartialEq for WasmEdgeError

source§

fn eq(&self, other: &WasmEdgeError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for WasmEdgeError

source§

impl StructuralEq for WasmEdgeError

source§

impl StructuralPartialEq for WasmEdgeError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/error/index.html b/wasmedge_types/error/index.html new file mode 100644 index 000000000..1b6dbd717 --- /dev/null +++ b/wasmedge_types/error/index.html @@ -0,0 +1,2 @@ +wasmedge_types::error - Rust

Module wasmedge_types::error

source ·
Expand description

Defines WasmEdge error types.

+

Enums

\ No newline at end of file diff --git a/wasmedge_types/error/sidebar-items.js b/wasmedge_types/error/sidebar-items.js new file mode 100644 index 000000000..bc753e2ef --- /dev/null +++ b/wasmedge_types/error/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CoreCommonError","CoreError","CoreExecutionError","CoreInstantiationError","CoreLoadError","CoreValidationError","ExportError","FuncError","GlobalError","HostFuncError","ImportError","InstanceError","MemError","PluginError","StoreError","TableError","VmError","WasmEdgeError"]}; \ No newline at end of file diff --git a/wasmedge_types/fn.wat2wasm.html b/wasmedge_types/fn.wat2wasm.html new file mode 100644 index 000000000..bdb33c19d --- /dev/null +++ b/wasmedge_types/fn.wat2wasm.html @@ -0,0 +1,28 @@ +wat2wasm in wasmedge_types - Rust

Function wasmedge_types::wat2wasm

pub fn wat2wasm(bytes: &[u8]) -> Result<Cow<'_, [u8]>, Error>
Expand description

Parses in-memory bytes as either the WebAssembly Text format, or a binary WebAssembly module. +Parses in-memory bytes as either the WebAssembly Text format, or a +binary WebAssembly module.

+

This function will attempt to interpret the given bytes as one of two +options:

+
    +
  • A utf-8 string which is a *.wat file to be parsed.
  • +
  • A binary WebAssembly file starting with b"\0asm"
  • +
+

If the input is a string then it will be parsed as *.wat, and then after +parsing it will be encoded back into a WebAssembly binary module. If the +input is a binary that starts with b"\0asm" it will be returned verbatim. +Everything that doesn’t start with b"\0asm" will be parsed as a utf-8 +*.wat file, returning errors as appropriate.

+

For more information about parsing wat files, see [parse_str].

+

Errors

+

In addition to all of the errors that can be returned from [parse_str], +this function will also return an error if the input does not start with +b"\0asm" and is invalid utf-8. (failed to even try to call [parse_str]).

+

Examples

+
// Parsing bytes that are actually `*.wat` files
+assert_eq!(&*wat::parse_bytes(b"(module)")?, b"\0asm\x01\0\0\0");
+assert!(wat::parse_bytes(b"module").is_err());
+assert!(wat::parse_bytes(b"binary\0file\0\that\0is\0not\0wat").is_err());
+
+// Pass through binaries that look like real wasm files
+assert_eq!(&*wat::parse_bytes(b"\0asm\x01\0\0\0")?, b"\0asm\x01\0\0\0");
+
\ No newline at end of file diff --git a/wasmedge_types/index.html b/wasmedge_types/index.html new file mode 100644 index 000000000..ea915a79a --- /dev/null +++ b/wasmedge_types/index.html @@ -0,0 +1,9 @@ +wasmedge_types - Rust

Crate wasmedge_types

source ·
Expand description

The wasmedge-types crate defines a group of common data structures used by both wasmedge-sdk and wasmedge-sys crates.

+

See also

+ +

Modules

  • Defines WasmEdge error types.

Structs

Enums

Functions

Type Aliases

\ No newline at end of file diff --git a/wasmedge_types/sidebar-items.js b/wasmedge_types/sidebar-items.js new file mode 100644 index 000000000..cee3992fa --- /dev/null +++ b/wasmedge_types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CompilerOptimizationLevel","CompilerOutputFormat","ExternalInstanceType","HostRegistration","Mutability","NeverType","RefType","ValType"],"fn":["wat2wasm"],"mod":["error"],"struct":["FuncType","GlobalType","MemoryType","TableType"],"type":["WasmEdgeResult"]}; \ No newline at end of file diff --git a/wasmedge_types/struct.FuncType.html b/wasmedge_types/struct.FuncType.html new file mode 100644 index 000000000..7e73d1e39 --- /dev/null +++ b/wasmedge_types/struct.FuncType.html @@ -0,0 +1,30 @@ +FuncType in wasmedge_types - Rust
pub struct FuncType { /* private fields */ }
Expand description

Struct of WasmEdge FuncType.

+

A FuncType is used to declare the types of the parameters and return values of a WasmEdge Func to be created.

+

Implementations§

source§

impl FuncType

source

pub fn new(args: Option<Vec<ValType>>, returns: Option<Vec<ValType>>) -> Self

Creates a new FuncType with the given types of arguments and returns.

+
Arguments
+
    +
  • +

    args - A vector of ValTypes that represent the types of the arguments.

    +
  • +
  • +

    returns - A vector of ValTypes that represent the types of the returns.

    +
  • +
+
source

pub fn args(&self) -> Option<&[ValType]>

Returns the types of the arguments of a host function.

+
source

pub fn args_len(&self) -> u32

Returns the number of the arguments of a host function.

+
source

pub fn returns(&self) -> Option<&[ValType]>

Returns the types of the returns of a host function.

+
source

pub fn returns_len(&self) -> u32

Returns the number of the returns of a host function.

+

Trait Implementations§

source§

impl Clone for FuncType

source§

fn clone(&self) -> FuncType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FuncType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for FuncType

source§

fn default() -> FuncType

Returns the “default value” for a type. Read more
source§

impl PartialEq for FuncType

source§

fn eq(&self, other: &FuncType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for FuncType

source§

impl StructuralEq for FuncType

source§

impl StructuralPartialEq for FuncType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/struct.GlobalType.html b/wasmedge_types/struct.GlobalType.html new file mode 100644 index 000000000..f33628681 --- /dev/null +++ b/wasmedge_types/struct.GlobalType.html @@ -0,0 +1,28 @@ +GlobalType in wasmedge_types - Rust
pub struct GlobalType { /* private fields */ }
Expand description

Struct of WasmEdge GlobalType.

+

A GlobalType is used to declare the type of a WasmEdge Global to be created.

+

Implementations§

source§

impl GlobalType

source

pub fn new(ty: ValType, mutability: Mutability) -> Self

Creates a new GlobalType with the given value type and mutability.

+
Arguments
+
    +
  • +

    ty - The value type of the global to be created.

    +
  • +
  • +

    mutability - The value mutability property of the global to be created.

    +
  • +
+
source

pub fn value_ty(&self) -> ValType

Returns the value type defined in the GlobalType.

+
source

pub fn mutability(&self) -> Mutability

Returns the value mutability property defined in the GlobalType.

+

Trait Implementations§

source§

impl Clone for GlobalType

source§

fn clone(&self) -> GlobalType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GlobalType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for GlobalType

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for GlobalType

source§

fn eq(&self, other: &GlobalType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for GlobalType

source§

impl StructuralEq for GlobalType

source§

impl StructuralPartialEq for GlobalType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/struct.MemoryType.html b/wasmedge_types/struct.MemoryType.html new file mode 100644 index 000000000..26eb461b5 --- /dev/null +++ b/wasmedge_types/struct.MemoryType.html @@ -0,0 +1,32 @@ +MemoryType in wasmedge_types - Rust
pub struct MemoryType { /* private fields */ }
Expand description

Struct of WasmEdge MemoryType.

+

A MemoryType is used to declare the size range of a WasmEdge Memory to be created.

+

Implementations§

source§

impl MemoryType

source

pub fn new(min: u32, max: Option<u32>, shared: bool) -> WasmEdgeResult<Self>

Creates a new MemoryType with the given size range.

+
Arguments
+
    +
  • +

    min - The minimum size of the memory to be created.

    +
  • +
  • +

    max - The maximum size of the memory to be created. If shared is set to true, max must be set.

    +
  • +
  • +

    shared - Enables shared memory if true.

    +
  • +
+
source

pub fn minimum(&self) -> u32

Returns the minimum size defined in the MemoryType.

+
source

pub fn maximum(&self) -> Option<u32>

Returns the maximum size defined in the MemoryType.

+
source

pub fn shared(&self) -> bool

Returns whether the memory is shared.

+

Trait Implementations§

source§

impl Clone for MemoryType

source§

fn clone(&self) -> MemoryType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MemoryType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MemoryType

source§

fn default() -> MemoryType

Returns the “default value” for a type. Read more
source§

impl PartialEq for MemoryType

source§

fn eq(&self, other: &MemoryType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for MemoryType

source§

impl StructuralEq for MemoryType

source§

impl StructuralPartialEq for MemoryType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/struct.TableType.html b/wasmedge_types/struct.TableType.html new file mode 100644 index 000000000..463e9a967 --- /dev/null +++ b/wasmedge_types/struct.TableType.html @@ -0,0 +1,32 @@ +TableType in wasmedge_types - Rust
pub struct TableType { /* private fields */ }
Expand description

Struct of WasmEdge TableType.

+

A TableType is used to declare the element type and the size range of a WasmEdge Table to be created.

+

Implementations§

source§

impl TableType

source

pub fn new(elem_ty: RefType, min: u32, max: Option<u32>) -> Self

Creates a new TableType with the given element type and the size range.

+
Arguments
+
    +
  • +

    elem_ty - The element type of the table to be created.

    +
  • +
  • +

    min - The minimum size of the table to be created.

    +
  • +
  • +

    max - The maximum size of the table to be created.

    +
  • +
+
source

pub fn elem_ty(&self) -> RefType

Returns the element type defined in the TableType.

+
source

pub fn minimum(&self) -> u32

Returns the minimum size defined in the TableType.

+
source

pub fn maximum(&self) -> Option<u32>

Returns the maximum size defined in the TableType.

+

Trait Implementations§

source§

impl Clone for TableType

source§

fn clone(&self) -> TableType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TableType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TableType

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for TableType

source§

fn eq(&self, other: &TableType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TableType

source§

impl StructuralEq for TableType

source§

impl StructuralPartialEq for TableType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/wasmedge_types/type.WasmEdgeResult.html b/wasmedge_types/type.WasmEdgeResult.html new file mode 100644 index 000000000..bce73fb0a --- /dev/null +++ b/wasmedge_types/type.WasmEdgeResult.html @@ -0,0 +1,7 @@ +WasmEdgeResult in wasmedge_types - Rust
pub type WasmEdgeResult<T> = Result<T, Box<WasmEdgeError>>;
Expand description

The WasmEdge result type.

+

Aliased Type§

enum WasmEdgeResult<T> {
+    Ok(T),
+    Err(Box<WasmEdgeError>),
+}

Variants§

§1.0.0

Ok(T)

Contains the success value

+
§1.0.0

Err(Box<WasmEdgeError>)

Contains the error value

+
\ No newline at end of file