Skip to content

Releases: webmaster128/anybuf

v0.5.2

06 Dec 11:36
v0.5.2
b93c8de
Compare
Choose a tag to compare
  • Add missing RepeatedStringError to public API (#25)
  • Implement decoding repeated message in Bufany (#24)

v0.5.1

05 Dec 13:52
v0.5.1
af9e5b5
Compare
Choose a tag to compare

0.5.0

04 Jun 22:43
v0.5.0
076ef2b
Compare
Choose a tag to compare
  • Implement std::error::Error (thank you srdtrk!)
  • Add no_std support

0.4.0

10 Feb 19:51
Compare
Choose a tag to compare

append_repeated_string got a generic element types

The list type of append_repeated_string changed from &[&str] to &[S] with the generic list element type S: AsRef<str>. This supports all previous types and many more. Especially owned string lists like Vec<String> can now be used directly:

let owned: Vec<String> = vec![
    "green".to_string(),
    "orange".to_string(),
];
let serialized = Anybuf::new()
    .append_repeated_string(4, &owned)
    .into_vec();

Before 0.4.0 you had to create a new list of references in order to call append_repeated_string.

In some cases you need to add an explicit generic type because the type can't be inferred anymore:

 let data = Anybuf::new()
     .append_string(1, "no messages")
-    .append_repeated_string(9, &[]);
+    .append_repeated_string::<&str>(9, &[]);

append_repeated_bytes got a generic element types

The list type of append_repeated_bytes changed from &[&[u8]] to &[B] with the generic list element type B: AsRef<[u8]>. This supports all previous types and many more. Especially owned data lists like Vec<Vec<u8>> can now be used directly:

let owned: Vec<Vec<u8>> = vec![
    vec![1u8; 10],
    vec![2u8; 10],
    vec![3u8; 10],
];
let serialized = Anybuf::new()
    .append_repeated_bytes(5, &owned)
    .into_vec();

Before 0.4.0 you had to create a new list of slice references in order to call append_repeated_bytes.

In some cases you need to add an explicit generic type because the type can't be inferred anymore:

 let data = Anybuf::new()
     .append_string(1, "no messages")
-    .append_repeated_bytes(10, &[]);
+    .append_repeated_bytes::<&[u8]>(10, &[]);

append_repeated_message get a generic element types

The list type of append_repeated_message changed from &[&Anybuf] to &[M] with the generic list element type M: AsRef<Anybuf>. This supports all previous types and many more. Especially owned data lists like Vec<Anybuf> can now be used directly:

let owned: Vec<Anybuf> = vec![
    Anybuf::new().append_uint32(1, 1),
    Anybuf::new().append_uint32(1, 2),
    Anybuf::new().append_uint32(1, 3),
];
let serialized = Anybuf::new()
    .append_repeated_message(11, &owned)
    .into_vec();

Before 0.4.0 you had to create a new list of references in order to call append_repeated_message.

In some cases you need to add an explicit generic type because the type can't be inferred anymore:

 let data = Anybuf::new()
     .append_string(1, "no messages")
-    .append_repeated_message(11, &[]);
+    .append_repeated_message::<&Anybuf>(11, &[]);

v0.3.0

01 Nov 22:37
Compare
Choose a tag to compare

Decoding support 🔥

Adds a minimal, zero dependency protobuf decoder: Bufany.

See #11 for an overview of Bufany's feature set.

int32/int64

Add signed integer support:

  • append_int32
  • append_int64
  • append_repeated_int32
  • append_repeated_int64

v0.2.0

24 Oct 23:05
Compare
Choose a tag to compare

Repeated

Add support for repeated fields through the new append_repeated_* functions. The approach promoted in version 0.1.0 was flawed as it led to default values being skipped (0s, "", empty bytes, default messages, false).

sint32/sint64

Add signed integer support (only sint32/sint64, not int32/int64):

  • append_sint32
  • append_sint64
  • append_repeated_sint32
  • append_repeated_sint64