pub trait Host {
// Required methods
fn get(&mut self, name: String) -> Result<Option<String>, ErrorCode>;
fn set(&mut self, name: String, value: String) -> Result<(), ErrorCode>;
fn export_env(
&mut self,
name: String,
value: String,
) -> Result<(), ErrorCode>;
}Required Methods§
Sourcefn get(&mut self, name: String) -> Result<Option<String>, ErrorCode>
fn get(&mut self, name: String) -> Result<Option<String>, ErrorCode>
Outer result carries denial; inner option distinguishes
“variable not set” from “variable set to empty string”.
fn set(&mut self, name: String, value: String) -> Result<(), ErrorCode>
Implementations on Foreign Types§
Source§impl<_T: Host + ?Sized> Host for &mut _T
impl<_T: Host + ?Sized> Host for &mut _T
Source§fn get(&mut self, name: String) -> Result<Option<String>, ErrorCode>
fn get(&mut self, name: String) -> Result<Option<String>, ErrorCode>
Outer result carries denial; inner option distinguishes
“variable not set” from “variable set to empty string”.
Source§fn export_env(&mut self, name: String, value: String) -> Result<(), ErrorCode>
fn export_env(&mut self, name: String, value: String) -> Result<(), ErrorCode>
Export a variable to the environment (like export VAR=val in the shell).
Named export-env rather than export because export is a reserved
WIT keyword.