Struct super_process::sh::EnvAfterScript
source · 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 copy 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 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