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
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 with_wasi_context(self, wasi_ctx: WasiContext) -> Self

Available on crate feature async and Linux only.

Sets the WasiContext for the Vm to build.

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