[][src]Crate kul

Additional, more convenient, functionality, which leverages the Rust standard library, layered on top of kul_core.

This crate:

  • Provides Parsers, for ready-made use for common basic parsing applications, that set pre-chosen types for most of the generic parameters.

  • Re-exports all of kul_core.

  • Provides Datum reference types that wrap the standard Box, Rc, and Arc types, for heap-allocating Datums.

  • Provides Text types that use heap allocation for their chunking.

  • Provides SourceStream types suitable for efficient use with streaming sources that buffer into heap-allocated string chunks. It is possible to achieve minimal copying such that streamed data is only copied once from the OS into the user-space string chunks. Once buffered, these types produce Text types that have zero-copy operation.

  • Avoids stack overflows (when possible) when dropping the provided heap-allocated Datum types, so they can handle being used for very-deep trees (e.g. long lists), by using a custom Drop implementation for them. (Otherwise the compiler's default drop recursion could overflow.)

Unlike kul_core, this crate's purpose mostly is to provide premade implementations intended for ready use. So, instead of placing such items in sub-modules named premade, they are placed at the top of their respective modules, including for the premade items re-exported from kul_core.

Re-exports

pub use kul_core::*;

Modules

common

Parsers and related types and functions, provided for convenience, that use recommended types for instantiating many of the generic parameters of this crate, for common basic parsing applications.

datum

Datum reference types for heap-allocating Datums. Also re-exports the core crate's module and premades.

drop

Custom handling of dropping for the heap-allocated Datum types of this crate. Enables using very-deep Datum trees, e.g. long lists, which would otherwise cause stack overflows when droppped (due to the compiler's automatic recursive dropping). Can also be used for any other Datum reference types of yours if they meet the requirements.

parser

Types for Parsers that use the std library, including heap allocation. Also re-exports the core crate's module and premades.

source_stream

SourceStream types that use the std library, including heap allocation.

text

Text types that use the std library, including heap allocation. Also re-exports the core crate's module and premades.