3 releases

Uses new Rust 2021

0.1.2 Jun 6, 2022
0.1.1 Feb 24, 2022
0.1.0 Dec 14, 2021
Download history 120/week @ 2022-08-17 242/week @ 2022-08-24 600/week @ 2022-08-31 291/week @ 2022-09-07 414/week @ 2022-09-14 371/week @ 2022-09-21 218/week @ 2022-09-28 195/week @ 2022-10-05 71/week @ 2022-10-12 144/week @ 2022-10-19 249/week @ 2022-10-26 274/week @ 2022-11-02 333/week @ 2022-11-09 285/week @ 2022-11-16 112/week @ 2022-11-23 588/week @ 2022-11-30

1,433 downloads per month
Used in 7 crates (2 directly)

MIT license

28KB
759 lines

Jcers

A Encode/Decode lib for Jce.

Features

  • derive: derive macro support

How to use

use jcers::{JceGet, JcePut};

#[derive(Debug, Default, JceGet, JcePut)]
pub struct YouJceStruct {  // only support NamedStruct
    #[jce(0)]              // jce tag
    pub a_named_field: u8, // a field
}

let s: YouJceStruct = jcers::from_buf(&mut buf).unwrap(); // buf should impl bytes::Buf

JceType

JceCode JceType RustType
0 u8 u8
1 i16 i16
2 i32 i32
3 i64 i64
4 f32 f32
5 f64 f64
6 ShortString String
7 LongString String
8 Map HashMap<K, V>
9 List Vec<V>
10 Struct T
11 StructEnd -
12 Empty T::default()
13 bytes bytes::Bytes

Other

  • u16 will be encoded as i32
  • u32 will be encoded as i64
  • u16 and u32 can't be decoded from jce

Dependencies

~145–265KB