Browse Source

use tokio's File with a cap-std Dir

pull/2832/head
Pat Hickey 4 years ago
parent
commit
33dbd4388c
  1. 7
      Cargo.lock
  2. 12
      crates/wasi-common/tokio/Cargo.toml
  3. 10
      crates/wasi-common/tokio/src/lib.rs

7
Cargo.lock

@ -3138,7 +3138,14 @@ dependencies = [
name = "wasi-tokio"
version = "0.26.0"
dependencies = [
"cap-fs-ext",
"cap-std",
"cap-time-ext",
"fs-set-times",
"system-interface",
"tempfile",
"tokio",
"unsafe-io",
"wasi-cap-std-sync",
"wasi-common",
"wiggle",

12
crates/wasi-common/tokio/Cargo.toml

@ -15,4 +15,14 @@ include = ["src/**/*", "LICENSE" ]
wasi-common = { path = "../", version = "0.26.0" }
wasi-cap-std-sync = { path = "../cap-std-sync", version = "0.26.0" }
wiggle = { path = "../../wiggle", version = "0.26.0" }
tokio = { version = "1.5.0", features = [ "rt", "time" ] }
tokio = { version = "1.5.0", features = [ "rt", "fs", "time" ] }
cap-std = "0.13.7"
cap-fs-ext = "0.13.7"
cap-time-ext = "0.13.7"
fs-set-times = "0.3.1"
unsafe-io = "0.6.2"
system-interface = { version = "0.6.3", features = ["cap_std_impls"] }
[dev-dependencies]
tempfile = "3.1.0"
tokio = { features = [ "macros" ] }

10
crates/wasi-common/tokio/src/lib.rs

@ -1,14 +1,14 @@
mod dir;
mod file;
use std::cell::RefCell;
use std::path::Path;
use std::rc::Rc;
pub use wasi_cap_std_sync::{clocks_ctx, random_ctx, Dir};
use wasi_common::{Table, WasiCtx};
use wasi_common::{Error, Table, WasiCtx};
pub fn sched_ctx() -> Box<dyn wasi_common::WasiSched> {
use wasi_common::{
sched::{Duration, Poll, WasiSched},
Error,
};
use wasi_common::sched::{Duration, Poll, WasiSched};
struct AsyncSched;
#[wiggle::async_trait]

Loading…
Cancel
Save