pub fn parse_single(input: &str, rule: Rule) -> Result<Instruction> {
  let record = DockerfileParser::parse(rule, input)
    .context(ParseError)?
    .next()
    .ok_or(Error::UnknownParseError)?;

  Instruction::try_from(record)
}
/// Parses a string into a single instruction using a particular syntax rule.
///
/// This is technically over-constrained as we could just parse any single
/// instruction using `Rule::step`, however doing so isn't ideal for
/// per-instruction unit tests.
Parses a string into a single instruction using a particular syntax rule.
This is technically over-constrained as we could just parse any single
instruction using `Rule::step`, however doing so isn't ideal for
per-instruction unit tests.
Parses a string into a single instruction using a particular syntax rule . This is technically over - constrained as we could just parse any single instruction using ` Rule :: step ` however doing so isn ' t ideal for per - instruction unit tests .
pub fn parse_single(input: &str, rule: Rule) -> Result<Instruction> {
  let record = DockerfileParser::parse(rule, input)
    .context(ParseError)?
    .next()
    .ok_or(Error::UnknownParseError)?;
  Instruction::try_from(record)
}
pub fn parse_single ( input : & str , rule : Rule ) -> Result < Instruction > { let record = DockerfileParser :: parse ( rule , input ) . context ( ParseError ) ? . next ( ) . ok_or ( Error :: UnknownParseError ) ? ; Instruction :: try_from ( record ) }
Parses a string into a single instruction using a particular syntax rule.
Parses a string into a single instruction using a particular syntax rule .
input
&str
rule
Rule