pub struct ShellScript { /* private fields */ }Expand description
A shell script parsed into every command line it would run, in source order, a command’s substitutions ahead of the command.
Implementations§
Source§impl ShellScript
impl ShellScript
Sourcepub fn parse(script: &str) -> Result<Self, ShellParseError>
pub fn parse(script: &str) -> Result<Self, ShellParseError>
Parses script.
§Errors
Returns ShellParseError when the script, or a shell string inside
it, is not valid shell, or nests deeper than the parse follows.
Sourcepub fn commands(&self) -> &[ShellCommand]
pub fn commands(&self) -> &[ShellCommand]
Every command the script would run.
Sourcepub fn get(&self, id: CommandId) -> &ShellCommand
pub fn get(&self, id: CommandId) -> &ShellCommand
Sourcepub fn line(&self, line: LineId) -> impl Iterator<Item = &ShellCommand>
pub fn line(&self, line: LineId) -> impl Iterator<Item = &ShellCommand>
The commands of line: its program, then what it wraps.
Sourcepub fn wrappers<'a>(
&'a self,
command: &'a ShellCommand,
) -> impl Iterator<Item = &'a ShellCommand> + 'a
pub fn wrappers<'a>( &'a self, command: &'a ShellCommand, ) -> impl Iterator<Item = &'a ShellCommand> + 'a
The wrappers that run command, innermost first.
Trait Implementations§
Source§impl Clone for ShellScript
impl Clone for ShellScript
Source§impl Debug for ShellScript
impl Debug for ShellScript
impl Eq for ShellScript
Source§impl PartialEq for ShellScript
impl PartialEq for ShellScript
impl StructuralPartialEq for ShellScript
Auto Trait Implementations§
impl Forget for ShellScript
impl Freeze for ShellScript
impl Move for ShellScript
impl RefUnwindSafe for ShellScript
impl Send for ShellScript
impl Sync for ShellScript
impl Unpin for ShellScript
impl UnsafeUnpin for ShellScript
impl UnwindSafe for ShellScript
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more