chorba

Crates.iochorba
lib.rschorba
version0.1.0
created_at2025-04-14 15:56:34.622815+00
updated_at2025-04-14 15:56:34.622815+00
descriptionchorba
homepagehttps://github.com/myyrakle/chorba/blob/master/README.md
repositoryhttps://github.com/myyrakle/chorba
max_upload_size
id1633025
size7,001
myyrakle (myyrakle)

documentation

https://github.com/myyrakle/chorba/blob/master/README.md

README

chorba

GitHub license

  • simple binary serialization

Basic

  • Serializes a structure into binary format.
  • The values ​​are placed in the order of the structure fields, so the actual order of the fields is important.

Get Started

Install via cargo add

cargo add chorba

or, Modify Cargo.toml.

chorba = "0.1.0"

The usage is simple. Just apply the logic through derive and convert it through the encode/decode functions.

use chorba::{Decode, Encode, decode, encode};

#[derive(Encode, Decode, Debug)]
pub struct TestPacket {
    user_id: String,
    user_name: String,
    user_email: String,
}

fn main() {
    let encoded = encode(&TestPacket {
        user_id: "123".to_string(),
        user_name: "John Doe".to_string(),
        user_email: "myyrakle@naver.com".to_string(),
    });

    println!("encoded: {:?}", encoded);

    let decoded: TestPacket = decode(&encoded).unwrap();
    println!("decoded: {:?}", decoded);
}

Commit count: 20

cargo fmt