[][src]Function php_literal_parser::from_str

pub fn from_str<'a, T>(s: &'a str) -> Result<T, ParseError> where
    T: Deserialize<'a>, 

Parse a php literal

Example

use php_literal_parser::{from_str, Value, Key};

let map = from_str::<Value>(r#"["foo" => true, "nested" => ['foo' => false]]"#)?;

assert_eq!(map["foo"], true);
assert_eq!(map["nested"]["foo"], false);