pipelight_files/lib.rs
1//! ## File - parse file types with pretty diagnostics.
2//!
3//! Well structured parsing error reports with the language specific error types.
4//! thanks to the [thiserror](https://docs.rs/thiserror/latest/thiserror/) and
5//! [miette](https://docs.rs/miette/latest/miette/index.html) crate.
6//!
7//! Let say you want to deserialize to a Config struct.
8//!
9//! ```rust
10//! # use miette::Result;
11//! # use serde_json::Value;
12//! # use pipelight_files::{YamlError,TomlError,CastError};
13//!
14//! # fn main () -> Result<(), CastError> {
15//! # let string = "";
16//!
17//! let res = serde_yaml::from_str::<Value>(&string);
18//! match res {
19//! Ok(res) => {
20//! // do things
21//! },
22//! Err(e) => {
23//! let err = YamlError::new(e, &string);
24//! return Err(err.into());
25//! }
26//! };
27//!
28//! # Ok(())
29//! # }
30//! ```
31//!
32//! ```rust
33//! # use miette::Result;
34//! # use serde_json::Value;
35//! # use pipelight_files::{YamlError,TomlError,CastError};
36//!
37//! # fn main () -> Result<(), CastError> {
38//! # let string = "";
39//!
40//! let res = toml::from_str::<Value>(&string);
41//! match res {
42//! Ok(res) => {
43//! // do things
44//! },
45//! Err(e) => {
46//! let err = TomlError::new(e, &string);
47//! return Err(err.into());
48//! }
49//! };
50//!
51//! # Ok(())
52//! # }
53//! ```
54mod from;
55
56// Re-export types
57mod error;
58pub use error::*;
59
60mod is;
61pub use is::*;
62
63mod methods;
64pub use methods::*;
65
66mod types;
67pub use types::*;