mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-05 02:20:19 +00:00
Clean up and add another example
This commit is contained in:
parent
19ea53b86e
commit
4862828165
@ -2,7 +2,7 @@
|
||||
|
||||
## **[Unreleased]**
|
||||
|
||||
- [#1170](https://github.com/wasmerio/wasmer/pull/1170) Improve the WasiFs builder API with convenience methods for overriding stdin, stdout, and stderr as well as a new sub-builder for controlling the permissions and properties of preopened directories.
|
||||
- [#1170](https://github.com/wasmerio/wasmer/pull/1170) Improve the WasiFs builder API with convenience methods for overriding stdin, stdout, and stderr as well as a new sub-builder for controlling the permissions and properties of preopened directories. Also breaks that implementations of `WasiFile` must be `Send` -- please file an issue if this change causes you any issues.
|
||||
- [#1161](https://github.com/wasmerio/wasmer/pull/1161) Require imported functions to be `Send`. This is a breaking change that fixes a soundness issue in the API.
|
||||
- [#1129](https://github.com/wasmerio/wasmer/pull/1129) Standard exception types for singlepass backend.
|
||||
- [#1140](https://github.com/wasmerio/wasmer/pull/1140) Use [`blake3`](https://github.com/BLAKE3-team/BLAKE3) as default hashing algorithm for caching.
|
||||
|
@ -173,7 +173,6 @@ impl WasiStateBuilder {
|
||||
/// Preopen a directory
|
||||
/// This opens the given directory at the virtual root, `/`, and allows
|
||||
/// the WASI module to read and write to the given directory.
|
||||
// TODO: design a simple API for passing in permissions here (i.e. read-only)
|
||||
pub fn preopen_dir<FilePath>(
|
||||
&mut self,
|
||||
po_dir: FilePath,
|
||||
@ -191,12 +190,22 @@ impl WasiStateBuilder {
|
||||
Ok(self)
|
||||
}
|
||||
|
||||
/// Preopen TODO:
|
||||
/// Preopen a directory and configure it.
|
||||
///
|
||||
/// Usage:
|
||||
///
|
||||
/// ```no_run
|
||||
/// # use wasmer_wasi::state::{WasiState, WasiStateCreationError};
|
||||
/// # fn main() -> Result<(), WasiStateCreationError> {
|
||||
/// WasiState::new("program_name")
|
||||
/// .preopen(|p| p.directory("src").read(true).write(true).create(true))?
|
||||
/// .preopen(|p| p.directory(".").alias("dot").read(true))?
|
||||
/// .build()?;
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// ```
|
||||
/// ```
|
||||
pub fn preopen<FilePath, F>(&mut self, inner: F) -> Result<&mut Self, WasiStateCreationError>
|
||||
pub fn preopen<F>(&mut self, inner: F) -> Result<&mut Self, WasiStateCreationError>
|
||||
where
|
||||
FilePath: AsRef<Path>,
|
||||
F: Fn(&mut PreopenDirBuilder) -> &mut PreopenDirBuilder,
|
||||
{
|
||||
let mut pdb = PreopenDirBuilder::new();
|
||||
|
Loading…
Reference in New Issue
Block a user