pub struct Program { /* private fields */ }Implementations§
Source§impl Program
impl Program
Sourcepub fn instantiate<T>(
store: impl AsContextMut<Data = T>,
component: &Component,
linker: &Linker<T>,
) -> Result<(Self, Instance)>
pub fn instantiate<T>( store: impl AsContextMut<Data = T>, component: &Component, linker: &Linker<T>, ) -> Result<(Self, Instance)>
Instantiates the provided module using the specified
parameters, wrapping up the result in a structure that
translates between wasm and the host.
Sourcepub fn instantiate_pre<T>(
store: impl AsContextMut<Data = T>,
instance_pre: &InstancePre<T>,
) -> Result<(Self, Instance)>
pub fn instantiate_pre<T>( store: impl AsContextMut<Data = T>, instance_pre: &InstancePre<T>, ) -> Result<(Self, Instance)>
Instantiates a pre-instantiated module using the specified parameters, wrapping up the result in a structure that translates between wasm and the host.
Sourcepub fn new(store: impl AsContextMut, instance: &Instance) -> Result<Self>
pub fn new(store: impl AsContextMut, instance: &Instance) -> Result<Self>
Low-level creation wrapper for wrapping up the exports
of the instance provided in this structure of wasm
exports.
This function will extract exports from the instance
defined within store and wrap them all up in the
returned structure which can be used to interact with
the wasm module.
Sourcepub fn call_evaluate<S: AsContextMut>(
&self,
store: S,
arg0: &SignatureRequest,
arg1: Option<&[u8]>,
arg2: Option<&[Vec<u8>]>,
) -> Result<Result<(), Error>>
pub fn call_evaluate<S: AsContextMut>( &self, store: S, arg0: &SignatureRequest, arg1: Option<&[u8]>, arg2: Option<&[Vec<u8>]>, ) -> Result<Result<(), Error>>
Evaluates the program given the user’s signature request and the program’s configuration.
Sourcepub fn call_custom_hash<S: AsContextMut>(
&self,
store: S,
arg0: &[u8],
) -> Result<Option<Vec<u8>>>
pub fn call_custom_hash<S: AsContextMut>( &self, store: S, arg0: &[u8], ) -> Result<Option<Vec<u8>>>
Programs that use custom hash functions can a custom 32-byte curve point to be signed.
Auto Trait Implementations§
impl Freeze for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more