A Rust library for zero-allocation parsing of binary data.

Related tags

Parsing zero
Overview

Zero

A Rust library for zero-allocation parsing of binary data.

Requires Rust version 1.6 or later (requires stable libcore for no_std).

See docs for more information.

Available on crates.io.

Build:

cargo build

Test:

cargo test

To use in your project, add to your Cargo.toml:

[dependencies]
zero = "0.1.2"
You might also like...
A parser combinator for parsing &[Token].

PickTok A parser combinator like nom but specialized in parsing &[Token]. It has similar combinators as nom, but also provides convenient parser gener

MRT/BGP data parser written in Rust.
MRT/BGP data parser written in Rust.

BGPKIT Parser BGPKIT Parser aims to provides the most ergonomic MRT/BGP message parsing Rust API. BGPKIT Parser has the following features: performant

Parse RISC-V opcodes to provide more detailed structured data

riscv-opcodes-parser Parse RISC-V opcodes to provide more detailed structured data. License Licensed under either of Apache License, Version 2.0 (LICE

A native Rust port of Google's robots.txt parser and matcher C++ library.

robotstxt A native Rust port of Google's robots.txt parser and matcher C++ library. Native Rust port, no third-part crate dependency Zero unsafe code

A parser combinator library for Rust

combine An implementation of parser combinators for Rust, inspired by the Haskell library Parsec. As in Parsec the parsers are LL(1) by default but th

A library to display rich (Markdown) snippets and texts in a rust terminal application
A library to display rich (Markdown) snippets and texts in a rust terminal application

A CLI utilities library leveraging Markdown to format terminal rendering, allowing separation of structure, data and skin. Based on crossterm so works

xml-rs is an XML library for Rust programming language

xml-rs, an XML library for Rust Documentation xml-rs is an XML library for Rust programming language. It is heavily inspired by Java Streaming API for

The Simplest Parser Library (that works) in Rust

The Simplest Parser Library (TSPL) TSPL is the The Simplest Parser Library that works in Rust. Concept In pure functional languages like Haskell, a Pa

Universal configuration library parser

LIBUCL Table of Contents generated with DocToc Introduction Basic structure Improvements to the json notation General syntax sugar Automatic arrays cr

Comments
  • Cleanups

    Cleanups

    • Library crate doesn't need a Cargo.lock file
    • lib: Use assert_eq in necessary places
    • rustfmt and clippy run
    • Add gitignore to ignore Cargo.lock file
    • Implement Debug for testing struct
    opened by tesuji 4
  • Make read and read_array assert correct alignment.

    Make read and read_array assert correct alignment.

    Unaligned accesses are UB in LLVM (and silently corrupt data on at least some ARM chips), so before doing unsafe transmutes on the memory, we need to ensure the incoming slice is aligned correctly for the output type.

    Add some tests to ensure this happens ... and assume the u8 arrays are 32bit aligned, so we need to drop the first element to get an unaligned u32. This may not actually be true (and if so, the test will be flaky) but the test passes for several local runs on x86-64.

    opened by BryanKadzban 3
  • `zero` on crates.io seems outdated

    `zero` on crates.io seems outdated

    https://docs.rs/crate/zero/0.1.2/source/src/lib.rs

    It doesn't check the alignment as it is on GitHub: https://github.com/nrc/zero/blob/4a7247507cdc82d8018af48d7bf94b5c951a1eba/src/lib.rs#L51-L59

    Maybe publish a new version?

    opened by whfuyn 1
  • read_str() should return a Result instead of panicking

    read_str() should return a Result instead of panicking

    Wasn't sure whether to file this as an issue in this crate or in your xmas-elf crate, but I chose here because the lowest-level change should be made here.

    In the read_str() function, there is the potential to panic on the expect statement. When parsing a file (such as an ELF file using your xmas-elf crate), some symbols may not be encoded as UTF-8, so it'd be nice to be able to skip them and recover gracefully through a returned Result, rather than simply panicking and aborting the entire parse thread.

    If you're okay with that change, I'm happy to submit a pull request to both this and the xmas-elf crate.

    Also, thanks a lot for this and the xmas-elf crate, and also for making the change for my previous issue with the elf flags. It's really saved me a lot of time!!

    opened by kevinaboos 4
Owner
Nick Cameron
Software engineer at PingCAP; @rust-lang core team alumnus.
Nick Cameron
Rust library for parsing configuration files

configster Rust library for parsing configuration files Config file format The 'option' can be any string with no whitespace. arbitrary_option = false

The Impossible Astronaut 19 Jan 5, 2022
Yet Another Parser library for Rust. A lightweight, dependency free, parser combinator inspired set of utility methods to help with parsing strings and slices.

Yap: Yet another (rust) parsing library A lightweight, dependency free, parser combinator inspired set of utility methods to help with parsing input.

James Wilson 117 Dec 14, 2022
rbdt is a python library (written in rust) for parsing robots.txt files for large scale batch processing.

rbdt ?? ?? ?? ?? rbdt is a work in progress, currently being extracted out of another (private) project for the purpose of open sourcing and better so

Knuckleheads' Club 0 Nov 9, 2021
Parsing Expression Grammar (PEG) parser generator for Rust

Parsing Expression Grammars in Rust Documentation | Release Notes rust-peg is a simple yet flexible parser generator that makes it easy to write robus

Kevin Mehall 1.2k Dec 30, 2022
A typed parser generator embedded in Rust code for Parsing Expression Grammars

Oak Compiled on the nightly channel of Rust. Use rustup for managing compiler channels. You can download and set up the exact same version of the comp

Pierre Talbot 138 Nov 25, 2022
Parsing and inspecting Rust literals (particularly useful for proc macros)

litrs: parsing and inspecting Rust literals litrs offers functionality to parse Rust literals, i.e. tokens in the Rust programming language that repre

Lukas Kalbertodt 31 Dec 26, 2022
A Rust crate for RDF parsing and inferencing.

RDF-rs This crate provides the tools necessary to parse RDF graphs. It currently contains a full (with very few exceptions) Turtle parser that can par

null 2 May 29, 2022
A Rust crate for hassle-free Corosync's configuration file parsing

corosync-config-parser A Rust crate for hassle-free Corosync's configuration file parsing. Inspired by Kilobyte22/config-parser. Usage extern crate co

Alessio Biancalana 2 Jun 10, 2022
This crate provide parsing fontconfig file but not yet complete all features

This crate provide parsing fontconfig file but not yet complete all features

null 4 Dec 27, 2022
Extensible inline parser engine, the backend parsing engine for Lavendeux.

Lavendeux Parser - Extensible inline parser engine lavendeux-parser is an exensible parsing engine for mathematical expressions. It supports variable

Richard Carson 10 Nov 3, 2022