pub struct ParsedShell {
pub original: String,
pub commands: Vec<Command>,
pub has_pipes: bool,
}Expand description
Parsed shell command information.
Fields§
§original: StringOriginal shell script text.
commands: Vec<Command>Extracted commands.
has_pipes: boolWhether the shell has pipes.
Implementations§
Source§impl ParsedShell
impl ParsedShell
Sourcepub fn from_run_args(args: &RunArgs) -> Self
pub fn from_run_args(args: &RunArgs) -> Self
Parse from RUN instruction arguments.
Sourcepub fn any_command<F>(&self, pred: F) -> bool
pub fn any_command<F>(&self, pred: F) -> bool
Check if any command matches the predicate.
Sourcepub fn all_commands<F>(&self, pred: F) -> bool
pub fn all_commands<F>(&self, pred: F) -> bool
Check if all commands match the predicate.
Sourcepub fn no_commands<F>(&self, pred: F) -> bool
pub fn no_commands<F>(&self, pred: F) -> bool
Check if no commands match the predicate.
Sourcepub fn find_command_names(&self) -> Vec<&str>
pub fn find_command_names(&self) -> Vec<&str>
Find command names in the script.
Sourcepub fn using_program(&self, prog: &str) -> bool
pub fn using_program(&self, prog: &str) -> bool
Check if using a specific program.
Sourcepub fn is_pip_install(&self, cmd: &Command) -> bool
pub fn is_pip_install(&self, cmd: &Command) -> bool
Check if any command is a pip install.
Trait Implementations§
Source§impl Clone for ParsedShell
impl Clone for ParsedShell
Source§fn clone(&self) -> ParsedShell
fn clone(&self) -> ParsedShell
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 moreSource§impl Debug for ParsedShell
impl Debug for ParsedShell
Source§impl Default for ParsedShell
impl Default for ParsedShell
Source§fn default() -> ParsedShell
fn default() -> ParsedShell
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParsedShell
impl RefUnwindSafe for ParsedShell
impl Send for ParsedShell
impl Sync for ParsedShell
impl Unpin for ParsedShell
impl UnwindSafe for ParsedShell
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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