pub struct EnvAfterScript {
pub source: ShellSource,
}Expand description
Request for dumping the components of the environment after evaluating a shell script. ```
§tokio_test::block_on(async {
use std::ffi::OsStr; use super_process::{sh, exe};
let env = sh::EnvAfterScript {
source: sh::ShellSource {
contents: b“export A=3“.to_vec(),
},
};
let exe::EnvModifications(env) =
env.extract_env_bindings().await.unwrap(); let env_val =
env.get(OsStr::new(“A”)).unwrap().to_str().unwrap(); assert_eq!(3,
env_val.parse::
Fields§
§source: ShellSourceScript to run before extracting the environment.
Implementations§
Source§impl EnvAfterScript
impl EnvAfterScript
Sourcepub async fn extract_env_bindings(
self,
) -> Result<EnvModifications, ShellErrorWrapper>
pub async fn extract_env_bindings( self, ) -> Result<EnvModifications, ShellErrorWrapper>
Execute the wrapped script and parse the output of the env command
executed afterwards!
Trait Implementations§
Source§impl Clone for EnvAfterScript
impl Clone for EnvAfterScript
Source§fn clone(&self) -> EnvAfterScript
fn clone(&self) -> EnvAfterScript
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EnvAfterScript
impl RefUnwindSafe for EnvAfterScript
impl Send for EnvAfterScript
impl Sync for EnvAfterScript
impl Unpin for EnvAfterScript
impl UnwindSafe for EnvAfterScript
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more