pub struct Marine { /* private fields */ }Expand description
The base struct of Marine, the Fluence compute runtime.
Implementations
sourceimpl Marine
impl Marine
pub fn new() -> Self
sourcepub fn call<MN: AsRef<str>, FN: AsRef<str>>(
&mut self,
module_name: MN,
func_name: FN,
arguments: &[IValue]
) -> Result<Vec<IValue>, MError>
pub fn call<MN: AsRef<str>, FN: AsRef<str>>(
&mut self,
module_name: MN,
func_name: FN,
arguments: &[IValue]
) -> Result<Vec<IValue>, MError>
Invoke a function of a module inside Marine by given function name with given arguments.
sourcepub fn load_module<S: Into<String>>(
&mut self,
name: S,
wasm_bytes: &[u8],
config: MModuleConfig
) -> Result<(), MError>
pub fn load_module<S: Into<String>>(
&mut self,
name: S,
wasm_bytes: &[u8],
config: MModuleConfig
) -> Result<(), MError>
Load a new module inside Marine.
sourcepub fn unload_module<S: AsRef<str>>(&mut self, name: S) -> Result<(), MError>
pub fn unload_module<S: AsRef<str>>(&mut self, name: S) -> Result<(), MError>
Unload previously loaded module.
pub fn module_wasi_state<S: AsRef<str>>(
&mut self,
module_name: S
) -> Option<&WasiState>
sourcepub fn interface(&self) -> impl Iterator<Item = (&str, MModuleInterface<'_>)>
pub fn interface(&self) -> impl Iterator<Item = (&str, MModuleInterface<'_>)>
Return function signatures of all loaded info Marine modules with their names.
sourcepub fn module_interface<S: AsRef<str>>(
&self,
module_name: S
) -> Option<MModuleInterface<'_>>
pub fn module_interface<S: AsRef<str>>(
&self,
module_name: S
) -> Option<MModuleInterface<'_>>
Return function signatures exported by module with given name.
sourcepub fn module_record_types<S: AsRef<str>>(
&self,
module_name: S
) -> Option<&MRecordTypes>
pub fn module_record_types<S: AsRef<str>>(
&self,
module_name: S
) -> Option<&MRecordTypes>
Return record types exported by module with given name.
sourcepub fn module_record_type_by_id<S: AsRef<str>>(
&self,
module_name: S,
record_id: u64
) -> Option<&Rc<IRecordType>>
pub fn module_record_type_by_id<S: AsRef<str>>(
&self,
module_name: S,
record_id: u64
) -> Option<&Rc<IRecordType>>
Return record type for supplied record id exported by module with given name.
sourcepub fn module_memory_stats(&self) -> MemoryStats<'_>
pub fn module_memory_stats(&self) -> MemoryStats<'_>
Returns a heap size that all modules consume in bytes.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Marine
impl !Send for Marine
impl !Sync for Marine
impl Unpin for Marine
impl !UnwindSafe for Marine
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