Struct marine_rs_sdk_test::internal::AppService
source · [−]pub struct AppService { /* private fields */ }
Implementations
sourceimpl AppService
impl AppService
sourcepub fn new<C, S>(
config: C,
service_id: S,
envs: HashMap<Vec<u8, Global>, Vec<u8, Global>, RandomState>
) -> Result<AppService, AppServiceError> where
S: Into<String>,
C: TryInto<AppServiceConfig>,
AppServiceError: From<<C as TryInto<AppServiceConfig>>::Error>,
pub fn new<C, S>(
config: C,
service_id: S,
envs: HashMap<Vec<u8, Global>, Vec<u8, Global>, RandomState>
) -> Result<AppService, AppServiceError> where
S: Into<String>,
C: TryInto<AppServiceConfig>,
AppServiceError: From<<C as TryInto<AppServiceConfig>>::Error>,
Create Service with given modules and service id.
sourcepub fn call(
&mut self,
func_name: impl AsRef<str>,
arguments: Value,
call_parameters: CallParameters
) -> Result<Value, AppServiceError>
pub fn call(
&mut self,
func_name: impl AsRef<str>,
arguments: Value,
call_parameters: CallParameters
) -> Result<Value, AppServiceError>
Call a specified function of loaded module by its name with arguments in json format.
sourcepub fn call_with_ivalues(
&mut self,
func_name: impl AsRef<str>,
arguments: &[IValue],
call_parameters: CallParameters
) -> Result<Vec<IValue, Global>, AppServiceError>
pub fn call_with_ivalues(
&mut self,
func_name: impl AsRef<str>,
arguments: &[IValue],
call_parameters: CallParameters
) -> Result<Vec<IValue, Global>, AppServiceError>
Call a specified function of loaded module by its name with arguments in IValue format.
sourcepub fn get_interface(&self) -> ServiceInterface
pub fn get_interface(&self) -> ServiceInterface
Return interface (function signatures and record types) of this service.
sourcepub fn module_memory_stats(&self) -> MemoryStats<'_>
pub fn module_memory_stats(&self) -> MemoryStats<'_>
Return statistics of Wasm modules heap footprint. This operation is cheap.
sourceimpl AppService
impl AppService
pub fn new_with_empty_facade<C, S>(
config: C,
service_id: S,
envs: HashMap<Vec<u8, Global>, Vec<u8, Global>, RandomState>
) -> Result<AppService, AppServiceError> where
S: Into<String>,
C: TryInto<AppServiceConfig>,
AppServiceError: From<<C as TryInto<AppServiceConfig>>::Error>,
pub fn call_module(
&mut self,
module_name: impl AsRef<str>,
func_name: impl AsRef<str>,
arguments: Value,
call_parameters: CallParameters
) -> Result<Value, AppServiceError>
pub fn load_module<C, S>(
&mut self,
name: S,
wasm_bytes: &[u8],
config: Option<C>
) -> Result<(), AppServiceError> where
S: Into<String>,
C: TryInto<MarineModuleConfig>,
MarineError: From<<C as TryInto<MarineModuleConfig>>::Error>,
pub fn unload_module(
&mut self,
module_name: impl AsRef<str>
) -> Result<(), AppServiceError>
sourcepub fn get_full_interface(&self) -> MarineInterface<'_>
pub fn get_full_interface(&self) -> MarineInterface<'_>
Return raw interface of the underlying [[Marine]] instance
sourcepub fn get_wasi_state(
&mut self,
module_name: impl AsRef<str>
) -> Result<&WasiState, AppServiceError>
pub fn get_wasi_state(
&mut self,
module_name: impl AsRef<str>
) -> Result<&WasiState, AppServiceError>
Return
Auto Trait Implementations
impl !RefUnwindSafe for AppService
impl Send for AppService
impl !Sync for AppService
impl Unpin for AppService
impl !UnwindSafe for AppService
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more