mirror of
https://github.com/fluencelabs/marine.git
synced 2025-06-24 20:21:39 +00:00
feat(wasm-backend, app-service)!: use String for wasi env vars + require Clone for Function trait (#333)
* use String instead of Vec<u8> for wasi envs * require Clone for Function trait * fmt * pr fixes
This commit is contained in:
@ -21,6 +21,7 @@ use crate::DelayedContextLifetime;
|
||||
use crate::WasmBackend;
|
||||
|
||||
/// Contains Wasm exports necessary for internal usage.
|
||||
#[derive(Clone)]
|
||||
pub enum Export<WB: WasmBackend> {
|
||||
Memory(<WB as WasmBackend>::Memory),
|
||||
Function(<WB as WasmBackend>::Function),
|
||||
|
@ -23,7 +23,7 @@ use crate::WValue;
|
||||
|
||||
/// A Wasm function handle, it can be either a function from a host or an export from an `Instance`.
|
||||
/// As it is only a handle to an object in `Store`, cloning is cheap
|
||||
pub trait Function<WB: WasmBackend>: Send + Sync {
|
||||
pub trait Function<WB: WasmBackend>: Send + Sync + Clone {
|
||||
/// Creates a new function with dynamic signature.
|
||||
/// The signature check is performed at runtime.
|
||||
fn new<F>(store: &mut impl AsContextMut<WB>, sig: FuncSig, func: F) -> Self
|
||||
|
@ -41,8 +41,8 @@ pub trait WasiImplementation<WB: WasmBackend> {
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct WasiParameters {
|
||||
pub args: Vec<Vec<u8>>,
|
||||
pub envs: HashMap<Vec<u8>, Vec<u8>>,
|
||||
pub args: Vec<String>,
|
||||
pub envs: HashMap<String, String>,
|
||||
pub preopened_files: HashSet<PathBuf>,
|
||||
pub mapped_dirs: HashMap<String, PathBuf>,
|
||||
}
|
||||
|
Reference in New Issue
Block a user