Skip to main content

Crate yaml_lib

Crate yaml_lib 

Source

Re-exports§

pub use error::ErrorKind;
pub use error::YamlError;
pub use error::enhanced::EnhancedError;
pub use error::enhanced::ErrorCode;
pub use error::enhanced::ErrorSuggestion;
pub use error::enhanced::Span;
pub use error::enhanced::SuggestionBuilder;
pub use error::recovery::ErrorCollection;
pub use error::recovery::ParserState;
pub use error::recovery::RecoveryContext;
pub use error::recovery::RecoveryHandler;
pub use error::recovery::RecoveryStrategy;
pub use parser::config::ParserConfig;
pub use parser::config::ParserConfigBuilder;
pub use parser::document::parse;
pub use validation::engine::SchemaValidator;
pub use validation::engine::ValidationContext;
pub use validation::schema::ArraySchema;
pub use validation::schema::ObjectSchema;
pub use validation::schema::PropertySchema;
pub use validation::schema::Schema;
pub use validation::schema::SchemaType;
pub use validation::validators::CustomValidator;
pub use validation::validators::EnumValidator;
pub use validation::validators::LengthValidator;
pub use validation::validators::PatternValidator;
pub use validation::validators::RangeValidator;
pub use validation::validators::RequiredValidator;
pub use validation::validators::TypeValidator;
pub use validation::validators::ValidationResult;
pub use validation::validators::Validator;
pub use testing::fuzzing::FuzzResult;
pub use testing::fuzzing::FuzzRng;
pub use testing::fuzzing::YamlFuzzer;
pub use testing::fuzzing::fuzz_parse;
pub use testing::fuzzing::fuzz_roundtrip;
pub use testing::property::Property;
pub use testing::property::PropertyResult;
pub use testing::property::PropertySuite;
pub use testing::safety::MemoryStats;
pub use testing::safety::SafetyAudit;
pub use testing::safety::SafetyIssue;
pub use testing::safety::audit_node;
pub use testing::safety::calculate_memory_stats;
pub use devtools::debug::DebugAssert;
pub use devtools::debug::DebugContext;
pub use devtools::debug::DebugLevel;
pub use devtools::debug::NodeDebugger;
pub use devtools::diff::Diff;
pub use devtools::diff::DiffResult;
pub use devtools::diff::DiffType;
pub use devtools::diff::diff_nodes;
pub use devtools::inspect::NodeInfo;
pub use devtools::inspect::NodeType;
pub use devtools::inspect::find_by_type;
pub use devtools::inspect::has_anchor;
pub use devtools::inspect::has_tag;
pub use devtools::inspect::node_depth;
pub use devtools::inspect::node_size;
pub use devtools::inspect::node_summary;
pub use devtools::inspect::node_type;
pub use devtools::inspect::print_tree;
pub use devtools::trace::TracedTimer;
pub use devtools::trace::TraceEntry;
pub use devtools::trace::TraceEvent;
pub use devtools::trace::TraceGuard;
pub use devtools::trace::Tracer;

Modules§

devtools
Module for developer tools (debugging, inspection, diffing, tracing) YAML Developer Tools Module
embedded
Module for embedded systems support Embedded Systems Support Module
error
Module defining error types and handling for YAML operations. YAML Error Handling Module
parser
YAML Parser Module
test_helpers
File and buffer I/O abstractionsPretty-printing utilitiesUnicode-aware file handling
testing
Module for testing infrastructure (fuzzing, property testing, safety) YAML Library Testing Module
validation
Module for YAML validation and schema support Validation and Schema Support for YAML Library

Macros§

anchors_debug
collection_size_check
Macro to check collection size and return error if exceeded.
combined_loop_guard
Combined guard for loops that build collections.
lexer_debug
loop_guard_check
Macro to check loop iteration count and return error if exceeded.
loop_guard_init
Macro to create and check loop iteration guard.

Structs§

ArrayBuilder
Fluent builder for constructing Array nodes Builder for constructing Array nodes with a fluent API
BufferDestination
Destination implementation for writing YAML data to a memory buffer A memory buffer implementation for storing encoded JSON data as bytes. Provides functionality to write and manipulate byte content in memory.
BufferSource
Source implementation for reading YAML data from a memory buffer A memory buffer implementation for reading JSON data from bytes. Provides functionality to traverse and read byte content from memory.
CapacityHints
Capacity hints for optimizing allocations during parsing Capacity hints for optimizing allocations during parsing
CommonStrings
Common pre-interned strings for typical YAML keys Common strings that frequently appear in YAML documents
DocumentStats
Document statistics for performance analysis Statistics about a YAML document structure
FastPathDetector
Fast path detector for common YAML patterns Fast path detector for common YAML patterns
FileDestination
Destination implementation for writing YAML data to a file A file-based destination for writing JSON data to disk. Implements file operations for storing and manipulating encoded data.
FileSource
Source implementation for reading YAML data from a file File
InternedString
Reference-counted interned string for memory deduplication A reference-counted interned string
InternerStats
Statistics about string interning performance Statistics about string interning
LazyTag
Lazy tag that defers type coercion until accessed Lazy tag that defers type coercion until accessed
MappingBuilder
Fluent builder for constructing Mapping nodes Builder for constructing Mapping nodes with a fluent API
NodeBuilder
Memory-efficient node builder that reuses allocations Memory-efficient node builder that reuses allocations
NodeIterator
Iterator for traversing node trees Iterator for traversing a Node tree
NodePath
Path for accessing nested nodes Path for accessing nested nodes
NodeStream
Stream processor for efficient large document handling Stream processor for efficient large document handling
PerformanceOptimizer
Performance optimizer combining multiple optimization strategies Performance optimizer that combines multiple optimization strategies
Profiler
Performance profiler for measuring multiple operations Performance profiler for measuring multiple operations
SerializerRegistry
Custom serializer support Registry for custom serializers
SetBuilder
Fluent builder for constructing Set nodes Builder for constructing Set nodes with a fluent API
SimpleInterner
Simple single-threaded string interner Simple non-thread-safe interner for single-threaded use
StreamingSerializer
Streaming serialization Streaming YAML serializer
StringInterner
Thread-safe string interner with read-write lock String interner for deduplicating strings
TaggedSerializer
Custom serializer support Serializer for custom tagged nodes
Timer
Simple timer for measuring operation duration Simple timer for measuring operation duration
TypeSerializer
Custom serializer support Serializer for specific node types

Enums§

BlockStyle
Block style for string nodes Represents block/folded style for YAML string nodes
Format
This enum represents different Unicode text file formats with their corresponding byte order marks (BOM) Represents different Unicode text file formats with their corresponding byte order marks (BOM)
Node
Core data structure representing a YAML node in the parsed tree A node in the YAML data structure that can represent different types of values.
Numeric
Core data structure representing a numeric value node in the parsed tree Represents different numeric types that can be stored in a YAML node
PathSegment
Path segment (key or index) for node access Path-based node access
QuoteType
Quote type for string nodes Represents how a string was quoted in the source YAML
TraversalOrder
Traversal order for iterating through nodes Traversal order for iterating through a Node tree

Traits§

NodeIteratorExt
Extension trait for Node providing iterator methods Extension trait for Node to provide iterator methods
Serializer
Custom serializer support Trait for custom node serializers

Functions§

compare_performance
Utility to compare performance of different approaches Utility to compare performance of different approaches
detect_format
This function detects the Unicode format of a text file by examining its byte order mark (BOM) Detects the Unicode format of a text file by examining its byte order mark (BOM).
get_document
Returns the base node of document number n (0-based), reporting any errors. Returns the base node of document number n (0-based), reporting any errors. If the node is not a Document or the index is out of bounds, returns an error message.
get_number_of_documents
Returns the number of documents in a YAML stream represented by the Documents node. Returns the number of documents in a YAML stream represented by the Documents node. If the node is not a Documents node, returns an error message.
make_node
Helper function to create a Node from any value that can be converted into a Node Create a Node from any value that can be converted into a Node
make_set
Helper function to create a Set node from a vector, ensuring uniqueness Create a Set Node from a vector of values, ensuring uniqueness
parse_file
Parse YAML from a file path using the default parser configuration.
parse_string
Parse YAML from an in-memory string using the default parser configuration.
parse_string_with_recovery
Parse YAML from a string while preparing for future error recovery support.
parse_with_config
Parse YAML from a string with a custom parser configuration.
read_file_to_string
This function reads a text file and returns its content as a String, handling different Unicode formats Reads a text file and returns its content as a String, handling different Unicode formats Reads a text file and returns its content as a UTF-8 string.
stringify
Converts a Node tree back to YAML format Main entry point for stringifying YAML nodes to their text representation.
to_bencode
Converts a Node tree to bencode format Converts YAML nodes to Bencode format.
to_json
Converts a Node tree to JSON format stringify Converts YAML nodes to compact JSON format.
to_json_pretty
Converts YAML nodes to pretty-printed JSON format with indentation.
to_toml
Converts a Node tree to TOML format stringify
to_toml_pretty
Pretty variant currently delegates to the same behaviour (TOML key/value layout is line-oriented).
to_xml
Converts a Node tree to XML format stringify
to_xml_pretty
Pretty-print XML (delegates to same behaviour for now)
version
Returns the current version of the YAML library Returns the current version of the package as specified in Cargo.toml. Uses CARGO_PKG_VERSION environment variable that is set during compilation from the version field in Cargo.toml.
write_file_from_string
This function writes a string to a file in the specified Unicode format Writes a string to a file in the specified Unicode format Writes string content to a file with the specified Unicode format and BOM.

Type Aliases§

ZeroCopyStr
String pool for deduplicating common strings during parsing Zero-copy string wrapper Zero-copy string wrapper that borrows when possible