pub enum Acon {
Array(Array),
String(String),
Table(Table),
}
Expand description
Enumeration over all variable types in ACON
Variants§
Array(Array)
Array type contains a Vec of Acon
String(String)
String type contains a simple std::string::String
Table(Table)
Table consists of a BTreeMap<String, Acon>
Implementations§
source§impl Acon
impl Acon
sourcepub fn path(&self, path: &str) -> Option<&Acon>
pub fn path(&self, path: &str) -> Option<&Acon>
Retrieve a reference to an entry via its path Paths are dot-separated.
use acon::Acon;
let input = r#"
{ table
[ array
value
$
"#;
let result = input.parse::<Acon>().unwrap();
assert_eq!(result.path("table.array.0").unwrap().string(), "value");
Trait Implementations§
source§impl FromStr for Acon
impl FromStr for Acon
source§impl PartialEq<Acon> for Acon
impl PartialEq<Acon> for Acon
impl StructuralPartialEq for Acon
Auto Trait Implementations§
impl RefUnwindSafe for Acon
impl Send for Acon
impl Sync for Acon
impl Unpin for Acon
impl UnwindSafe for Acon
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