9 releases

new 0.0.12 Nov 21, 2024
0.0.11 Oct 15, 2024
0.0.10 Sep 27, 2024
0.0.6 Aug 29, 2024

#24 in #cryptocurrencies

Download history 281/week @ 2024-08-22 179/week @ 2024-08-29 520/week @ 2024-09-05 37/week @ 2024-09-12 14/week @ 2024-09-19 197/week @ 2024-09-26 13/week @ 2024-10-03 119/week @ 2024-10-10 40/week @ 2024-10-17 3/week @ 2024-10-24 7/week @ 2024-10-31 4/week @ 2024-11-07

109 downloads per month
Used in 2 crates (via fuel-streams-core)

Apache-2.0

26KB
321 lines


Logo

Fuel Data Parser

A utility library for encoding and decoding data in the Fuel Data Systems project.

CI Coverage Crates.io MSRV crates.io docs

📚 Documentation   🐛 Report Bug   ✨ Request Feature

📝 About

The DataParser struct provides functionality for encoding and decoding data through compression and serialization. It offers flexibility in choosing compression strategies and serialization formats, allowing for optimization of memory usage and I/O bandwidth. This utility is particularly useful when dealing with large datasets or when efficient data transfer is crucial.

🛠️ Usage

This library is intended for internal use within the Fuel Data Systems project. This is an example of usage outside of this crate within the project:

use fuel_data_parser::{DataParser, SerializationType, DataParseable};
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
struct YourDataType {
    // Your data fields here
}

async fn example_usage() -> Result<(), Box<dyn std::error::Error>> {
    let parser = DataParser::default()
        .with_serialization_type(SerializationType::Bincode);

    // Encoding data
    let data = YourDataType { /* ... */ };
    let encoded = parser.encode(&data).await?;

    // Decoding data
    let decoded: YourDataType = parser.decode(&encoded).await?;

    Ok(())
}

🏎️ Benchmarks

To run the benchmarks and measure performance of different serialization and compression strategies:

cargo bench -p data-parser -p nats-publisher -p bench-consumers

[!INFO] The benchmarks are located in the ../../benches folder.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

For more information on contributing, please see the CONTRIBUTING.md file in the root of the repository.

📜 License

This repo is licensed under the Apache-2.0 license. See LICENSE for more information.

Dependencies

~4–10MB
~107K SLoC