lp 0.2.5

An embeddable plugin system for Rust applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
#[macro_export]
macro_rules! impl_parse {
    ($struct:ty, $parser:expr) => {
        impl $struct {
            pub fn parse(path: &str) -> Result<Self, ParseError> {
                let file = std::fs::read_to_string(path).map_err(ParseError::Read)?;
                $parser(&file).map_err(|err| ParseError::Format(Box::new(err)))
            }
        }
    };
}