Skip to main content

Marine API

FaaS layer is based on the runtime Marine component significantly expanding it by providing a few ways of its instantiation as well as calling with JSON values.

Instantiation

rust
fn with_raw_config<C>(config: C) -> FaaSResult<Self>
where
C: TryInto<FaaSConfig>,
FaaSError: From<C::Error>,
rust
fn with_raw_config<C>(config: C) -> FaaSResult<Self>
where
C: TryInto<FaaSConfig>,
FaaSError: From<C::Error>,

Creates a FaaS instance from the provided config and modules or just module names.

Calling a module

rust
fn call_with_ivalues(
&mut self,
module_name: impl AsRef<str>,
func_name: impl AsRef<str>,
args: &[IValue],
call_parameters: marine_rs_sdk::CallParameters,
) -> FaaSResult<Vec<IValue>>
rust
fn call_with_ivalues(
&mut self,
module_name: impl AsRef<str>,
func_name: impl AsRef<str>,
args: &[IValue],
call_parameters: marine_rs_sdk::CallParameters,
) -> FaaSResult<Vec<IValue>>

Invokes a function of a module inside Marine by given function name with given arguments. For more info about IValue take a look to this chapter.

Getting a module interface

rust
fn get_interface(&self) -> FaaSInterface<'_>
rust
fn get_interface(&self) -> FaaSInterface<'_>

This method returns a public interface of a module, i.e. a set of all public functions and records.

Getting module memory stats

rust
fn module_memory_stats(&self) -> MemoryStats<'_>
rust
fn module_memory_stats(&self) -> MemoryStats<'_>

Returns a statistics of memory usage for all loaded modules.