saphyr-serde/parser/src/lib.rs
Ethiraric d9bb7a1693 Add Input interface.
Hiding character fetching behind this interface allows us to create more
specific implementations when is appropriate. For instance, an instance
of `Input` can be created for a `&str`, allowing for borrowing and more
efficient peeking and traversing than if we were to fetch characters one
at a time and placing them into a temporary buffer.
2024-07-14 16:59:09 +02:00

45 lines
1.5 KiB
Rust

// Copyright 2015, Yuheng Chen.
// Copyright 2023, Ethiraric.
// See the LICENSE file at the top-level directory of this distribution.
//! YAML 1.2 parser implementation in pure Rust.
//!
//! **If you want to load to a YAML Rust structure or manipulate YAML objects, use `saphyr` instead
//! of `saphyr-parser`. This crate contains only the parser.**
//!
//! This is YAML 1.2 parser implementation and low-level parsing API for YAML. It allows users to
//! fetch a stream of YAML events from a stream of characters/bytes.
//!
//! # Usage
//!
//! This crate is [on github](https://github.com/saphyr-rs/saphyr-parser) and can be used by adding
//! `saphyr-parser` to the dependencies in your project's `Cargo.toml`.
//!
//! ```toml
//! [dependencies]
//! saphyr-parser = "0.0.2"
//! ```
//!
//! # Features
//! **Note:** With all features disabled, this crate's MSRV is `1.65.0`.
//!
//! #### `debug_prints`
//! Enables the `debug` module and usage of debug prints in the scanner and the parser. Do not
//! enable if you are consuming the crate rather than working on it as this can significantly
//! decrease performance.
//!
//! The MSRV for this feature is `1.70.0`.
#![warn(missing_docs, clippy::pedantic)]
mod buffered_input;
mod char_traits;
#[macro_use]
mod debug;
mod input;
mod parser;
mod scanner;
pub use crate::buffered_input::BufferedInput;
pub use crate::parser::{Event, EventReceiver, MarkedEventReceiver, Parser, Tag};
pub use crate::scanner::{Marker, ScanError, TScalarStyle};