1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::bindings::cli::environment;
use crate::{WasiImpl, WasiView};

impl<T> environment::Host for WasiImpl<T>
where
    T: WasiView,
{
    fn get_environment(&mut self) -> anyhow::Result<Vec<(String, String)>> {
        Ok(self.ctx().env.clone())
    }
    fn get_arguments(&mut self) -> anyhow::Result<Vec<String>> {
        Ok(self.ctx().args.clone())
    }
    fn initial_cwd(&mut self) -> anyhow::Result<Option<String>> {
        // FIXME: expose cwd in builder and save in ctx
        Ok(None)
    }
}