filesystem example (#2236)
This commit is contained in:
@@ -127,16 +127,20 @@ impl FileContents for VecFileContents {
|
||||
}
|
||||
}
|
||||
|
||||
struct VecFileContents {
|
||||
pub struct VecFileContents {
|
||||
content: Vec<u8>,
|
||||
}
|
||||
|
||||
impl VecFileContents {
|
||||
fn new() -> Self {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
content: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_content(content: Vec<u8>) -> Self {
|
||||
Self { content }
|
||||
}
|
||||
}
|
||||
|
||||
/// An `InMemoryFile` is a shared handle to some underlying data. The relationship is analagous to
|
||||
|
||||
@@ -2,6 +2,7 @@ use wasmtime::Trap;
|
||||
|
||||
pub mod old;
|
||||
|
||||
pub use wasi_common::virtfs;
|
||||
pub use wasi_common::{WasiCtx, WasiCtxBuilder};
|
||||
|
||||
// Defines a `struct Wasi` with member fields and appropriate APIs for dealing
|
||||
|
||||
Reference in New Issue
Block a user