typeward 0.6.0

A type-driven parser combinator library for Rust.
Documentation
//! Parsing utilities and traits.
//!
//! # Unpacking parser output
//!
//! [`Unpack`] is re-exported from the [`unpackable`] crate. Typeward implements
//! it for transparent combinators such as [`Ws`](crate::combinators::Ws),
//! [`DelimitedExact`](crate::combinators::DelimitedExact),
//! [`DelimNested`](crate::combinators::DelimNested), and
//! [`And`](crate::combinators::And), and for collection combinators such as
//! [`Many1`](crate::collections::Many1), [`Repeat`](crate::collections::Repeat),
//! [`Separated`](crate::combinators::Separated), and
//! [`Collect`](crate::collections::Collect).
//! [`Span`](crate::combinators::Span) and [`Nested`] preserve their wrapper
//! while unpacking the inner value.
//!
//! Deriving [`Parse`] uses it automatically for `#[parse(from(ParserType))]` fields that
//! do not provide an explicit mapper.
//!
//! It is recommended to implement [`Unpack`] for your own combinators and wrapper types, so that they can be used seamlessly with the derive macro.
//! (derive support to be added in the future for implementing [`Unpack`] for your own types, but for now you can implement it manually).

mod complete;
mod core;
mod offset;
mod unpack;

pub use complete::{
    parse_complete, parse_complete_input, parse_complete_input_spanned, parse_complete_spanned,
};
pub use core::{Nested, Parse, ParseExt};
pub use offset::{
    ParseOffsetAnchor, ParseOffsetContext, ParseOffsetInput, with_parse_recursion_guard,
};
pub use unpack::{Unpack, Unpackable};

pub(crate) use offset::{
    current_parse_offset, with_parse_offset_scope, with_parse_offset_scope_if_missing,
};