rust-bakery/nom ? reverse-engineered prompt

Reverse engineered prompt

Build me a Rust parser library for quickly turning raw text or bytes into structured data.

I want it to feel easy to use, so I can combine small parsing pieces like matching a tag, taking a certain number of characters, or parsing numbers, and then chain them together to handle real formats like config files, network messages, or simple programming language syntax. It should work well with both normal strings and byte slices, avoid unnecessary copying, and handle partial input cleanly when data arrives in chunks.

Please include a few clear examples, like parsing a hex color, and make sure there are tests for the main combinators and common edge cases. If there are any tricky parser details or current Rust best practices I should know about, look up the latest docs online and follow them.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab