Expand description
Utility functions and shared types for ASS-RS core
Contains common functionality used across parser, tokenizer, and analysis modules. Focuses on zero-allocation helpers, color processing, and UTF-8 handling.
§Performance
- Zero-copy span utilities for AST references
- SIMD-optimized color conversions when available
- Minimal allocation math helpers (bezier evaluation)
§Example
use ass_core::utils::{Spans, parse_bgr_color};
let color_str = "&H00FF00FF&";
let rgba = parse_bgr_color(color_str)?;
assert_eq!(rgba, [255, 0, 255, 0]); // BGR -> RGBARe-exports§
pub use benchmark_generators::create_test_event;pub use benchmark_generators::generate_overlapping_script;pub use benchmark_generators::generate_script_with_issues;pub use benchmark_generators::ComplexityLevel;pub use benchmark_generators::ScriptGenerator;pub use errors::CoreError;pub use hashers::create_hash_map;pub use hashers::create_hash_map_with_capacity;pub use hashers::create_hasher;pub use hashers::hash_value;pub use utf8::detect_encoding;pub use utf8::normalize_line_endings;pub use utf8::recover_utf8;pub use utf8::strip_bom;pub use utf8::validate_utf8;
Modules§
- benchmark_
generators - Benchmark utilities for generating synthetic ASS scripts
- errors
- Core error types for ASS-RS utilities and cross-module error handling
- hashers
- Hash function utilities for consistent performance across platforms
- utf8
- UTF-8 and text encoding utilities for ASS script processing
Structs§
- Spans
- Zero-copy span utilities for AST node validation and manipulation
Functions§
- decode_
uu_ data - Decode UU-encoded data commonly found in ASS
[Fonts]and[Graphics]sections - eval_
cubic_ bezier - Evaluate cubic bezier curve at parameter t
- format_
ass_ time - Format centiseconds back to ASS time format
- normalize_
field_ value - Trim and normalize whitespace in ASS field values
- parse_
ass_ time - Parse ASS time format (H:MM:SS.CC) to centiseconds
- parse_
bgr_ color - Parse ASS BGR color format to RGBA bytes
- parse_
numeric - Parse numeric value from ASS field with validation
- validate_
ass_ name - Check if string contains only valid ASS characters