apple_products_parser 0.1.3

A tool that processes detailed data about Apple products(Iphones, MacBooks and IPads)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![doc = include_str!("../docs.md")]

use pest::error::Error as PestError;
use pest_derive::Parser;
use thiserror::Error;


/// This struct defines the parser and associates it with the grammar file.
#[derive(Parser)]
#[grammar = "./grammar.pest"]
pub struct Grammar;


/// Custom error type for JSON parsing errors. This uses the `thiserror` crate for easy error definition.
#[derive(Error, Debug)]
#[error("Error while parsing JSON: \n{0}")]
pub struct JsonParserError(#[from] PestError<Rule>);