parse

Function parse 

Source
pub fn parse<'a>(content: &'a str) -> Result<DashMap<&'a str, Process<'_>>>
Expand description

Parses a Procfile string.

§Examples

use procfile;

let my_procfile = "web: cargo run";
let parsed = procfile::parse(my_procfile).expect("Failed parsing procfile");
let web_process = parsed.get("web").expect("Failed getting web process");

assert_eq!("cargo", web_process.command);
assert_eq!(vec!["run"], web_process.options);

§Errors

  • When building the regex fails
  • When either the command, options, and the process name don’t exist but the regex matched