1pub(crate) use shrinkwraprs::Shrinkwrap;
4pub use proc_macro2::TokenStream;
5pub use quote::quote;
6pub use quote::TokenStreamExt;
7
8#[derive(Debug) ]
10pub enum Error {
11 IO(std::io::Error),
13 JSON(serde_json::Error),
15 Message(String),
17}
18
19impl From<&str> for Error {
20 fn from(s: &str) -> Self {
21 Self::Message(s.into())
22 }
23}
24
25impl From<String> for Error {
26 fn from(s: String) -> Self {
27 Self::Message(s)
28 }
29}
30
31impl From<std::io::Error> for Error {
32 fn from(error: std::io::Error) -> Self {
33 Self::IO(error)
34 }
35}
36
37impl From<serde_json::Error> for Error {
38 fn from(error: serde_json::Error) -> Self {
39 Self::JSON(error)
40 }
41}
42
43pub type Result<T> = std::result::Result<T, Error>;