saphyr_parser/lib.rs
1// Copyright 2015, Yuheng Chen.
2// Copyright 2023, Ethiraric.
3// See the LICENSE file at the top-level directory of this distribution.
4
5//! YAML 1.2 parser implementation in pure Rust.
6//!
7//! **If you want to load to a YAML Rust structure or manipulate YAML objects, use `saphyr` instead
8//! of `saphyr-parser`. This crate contains only the parser.**
9//!
10//! This is YAML 1.2 parser implementation and low-level parsing API for YAML. It allows users to
11//! fetch a stream of YAML events from a stream of characters/bytes.
12//!
13//! # Usage
14//!
15//! This crate is [on github](https://github.com/saphyr-rs/saphyr-parser) and can be used by adding
16//! `saphyr-parser` to the dependencies in your project's `Cargo.toml`:
17//!
18//! ```sh
19//! cargo add saphyr-parser
20//! ```
21//!
22//! # Features
23//! **Note:** With all features disabled, this crate's MSRV is `1.65.0`.
24//!
25//! #### `debug_prints`
26//! Enables the `debug` module and usage of debug prints in the scanner and the parser. Do not
27//! enable if you are consuming the crate rather than working on it as this can significantly
28//! decrease performance.
29//!
30//! The MSRV for this feature is `1.70.0`.
31
32#![warn(missing_docs, clippy::pedantic)]
33
34mod char_traits;
35#[macro_use]
36mod debug;
37pub mod input;
38mod parser;
39mod scanner;
40
41pub use crate::input::{str::StrInput, BufferedInput, Input};
42pub use crate::parser::{Event, EventReceiver, Parser, SpannedEventReceiver, Tag};
43pub use crate::scanner::{Marker, ScalarStyle, ScanError, Span};