pub struct ShellExpander { /* private fields */ }Expand description
Expands !`command` markers in text by running each command via
$SHELL -c (fallback sh) and substituting the trimmed stdout.
Construct once and reuse across a batch of expansions to amortize regex compilation.
Implementations§
Source§impl ShellExpander
impl ShellExpander
pub fn new() -> Self
Sourcepub async fn expand(&self, content: &str, cwd: &Path) -> String
pub async fn expand(&self, content: &str, cwd: &Path) -> String
Expand !`command` markers in content, running each command from
cwd. Returns content unchanged if no markers are present.
Markers are expanded concurrently; the first non-zero exit or spawn
failure short-circuits and surfaces as [ShellInterpError].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShellExpander
impl RefUnwindSafe for ShellExpander
impl Send for ShellExpander
impl Sync for ShellExpander
impl Unpin for ShellExpander
impl UnsafeUnpin for ShellExpander
impl UnwindSafe for ShellExpander
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