Valery Antopol 13cf85ba36
feat!: move to async execution (#396)
* wip

* WIP

* WIP

* compiles, async mrepl works

* add Send

* Updating marine-js

* FuncGetter compiles

* wow it compiles

* marine-js compiles but does not work

* marine-js tests almost pass

* marine-runtime and marine-core tests pass

* fmt

* epoch interruption works in mrepl

* WIP: switching from async_trait to box_future

* move from async_trait to BoxFuture

* self-review fixes

* self-review fixes

* merge memory limits

* pr fixes

* pr fixes

* pr fixes

* pr fixes

* update cargo lock

* use published interface-types

* remove patch deps

* fix factory and make AppService generic

* fix marine-js

* try locking deps

* add debug prints to workflow

* fix workflow

* update workflow

* make marine-js bindings patcher update all __wbg_adapter_* functions

* remove debug prints from workflows

* self-review fixes

* self-review fixes

* self-review fixes

* final fixes

* fix mrepl

* fix pr comments, fmt and clippy

* fix Cargo.toml and Cargo.lock after merge

* test fixes after merge

* update rust toolchain to match one in no

* fixes for nox integration

* reexport MError

* update js bindings

* fix warning

* fmt
2024-04-11 00:34:34 +04:00

38 lines
1.3 KiB
Rust

/*
* Copyright 2023 Fluence Labs Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
use crate::AsContextMut;
use crate::FuncGetter;
use crate::WasmBackend;
/// `ImportCallContext` is a structure used to pass context to imports.
/// It serves as a handle to `Store`, and also provides access to `Memory` and export functions
/// from the caller instance, if there is one.
pub trait ImportCallContext<WB: WasmBackend>:
FuncGetter<WB, (i32, i32), i32>
+ FuncGetter<WB, (i32, i32), ()>
+ FuncGetter<WB, i32, i32>
+ FuncGetter<WB, i32, ()>
+ FuncGetter<WB, (), i32>
+ FuncGetter<WB, (), ()>
+ AsContextMut<WB>
+ Sync
{
/// Gets the `Memory` from the caller instance.
/// Returns `None` if function was called directly from host.
fn memory(&mut self, memory_index: u32) -> Option<<WB as WasmBackend>::Memory>;
}