use tokio's File with a cap-std Dir
This commit is contained in:
7
Cargo.lock
generated
7
Cargo.lock
generated
@@ -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",
|
||||
|
||||
@@ -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" ] }
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user