pub struct MunyoItem {
pub typename: String,
pub argument: String,
pub params: BTreeMap<String, String>,
pub children: Vec<MunyoItem>,
}Expand description
Untyped Munyo value which can be used without implementing Serialize/Deserialize
Fields§
§typename: StringThe typename of the line of the Munyo language
argument: StringThe argument of the line of the Munyo language
params: BTreeMap<String, String>The params of the line of the Munyo language
children: Vec<MunyoItem>The children of the line of the Munyo language
Implementations§
source§impl MunyoItem
impl MunyoItem
sourcepub fn from_str_with_path<P: AsRef<Path>>(
s: &str,
path: P,
) -> Result<Processed<MunyoItem>>
pub fn from_str_with_path<P: AsRef<Path>>( s: &str, path: P, ) -> Result<Processed<MunyoItem>>
Deserialize MunyoItem from &str of the Munyo language.
path is only used for error messages.
See from_str for details;
sourcepub fn from_str(s: &str) -> Result<Processed<MunyoItem>>
pub fn from_str(s: &str) -> Result<Processed<MunyoItem>>
Deserialize MunyoItem from &str of the Munyo language.
§Example
let v = munyo::MunyoItem::from_str("Typename argu ment | param value ")?.result;
assert_eq!(&v[0].typename, "Typename");
assert_eq!(&v[0].argument, " argu ment ");
assert_eq!(v[0].params.get("param").unwrap(), " value ");sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Processed<MunyoItem>>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Processed<MunyoItem>>
Deserialize MunyoItem from path of the source file of the Munyo language.
§Example
let s = "foo";
// create a file with text "foo" and get the path
let v = munyo::MunyoItem::from_file(path)?.result;
assert_eq!(&v[0].typename, "foo");Trait Implementations§
impl StructuralPartialEq for MunyoItem
Auto Trait Implementations§
impl Freeze for MunyoItem
impl RefUnwindSafe for MunyoItem
impl Send for MunyoItem
impl Sync for MunyoItem
impl Unpin for MunyoItem
impl UnwindSafe for MunyoItem
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)