You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(readme): update and expand documentation, add Chinese translation
- update README.md with timestamp extension support and improved usage examples
- add detailed sections for data types, timestamp usage, and error handling
- fix formatting and clarify API overview and related projects
- add README_CN.md providing a comprehensive Chinese translation of the documentation
Copy file name to clipboardExpand all lines: README.md
+75-30Lines changed: 75 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,8 @@ An article introducing it: [Zig Msgpack](https://blog.nvimer.org/2025/05/03/zig-
8
8
9
9
## Features
10
10
11
-
-**Full MessagePack Support:** Implements all MessagePack types (except for the timestamp extension).
11
+
-**Full MessagePack Support:** Implements all MessagePack types including the timestamp extension.
12
+
-**Timestamp Support:** Complete implementation of MessagePack timestamp extension type (-1) with support for all three formats (32-bit, 64-bit, and 96-bit).
12
13
-**Efficient:** Designed for high performance with minimal memory overhead.
13
14
-**Type-Safe:** Leverages Zig's type system to ensure safety during serialization and deserialization.
14
15
-**Simple API:** Offers a straightforward and easy-to-use API for encoding and decoding.
@@ -56,56 +57,100 @@ For Zig `0.14.0` and `nightly`, follow these steps:
56
57
57
58
## Usage
58
59
59
-
Here is a simple example of how to encode and decode a `Payload`:
std.debug.print("Cannot convert negative to unsigned\n");
144
+
return;
145
+
},
146
+
else =>return err,
147
+
};
103
148
```
104
149
105
150
## API Overview
106
151
107
-
- **`msgpack.Pack`**: The main struct for packing and unpacking MessagePack data. It is initialized with read and write contexts.
108
-
- **`msgpack.Payload`**: A union that represents any MessagePack type. It provides methods for creating and interacting with different data types (e.g., `mapPayload`, `strToPayload`, `mapGet`).
152
+
- **`msgpack.Pack`**: The main struct for packing and unpacking MessagePack data. It is initialized with read and write contexts.
153
+
- **`msgpack.Payload`**: A union that represents any MessagePack type. It provides methods for creating and interacting with different data types (e.g., `mapPayload`, `strToPayload`, `mapGet`).
109
154
110
155
## Testing
111
156
@@ -121,9 +166,9 @@ Contributions are welcome! Please feel free to open an issue or submit a pull re
0 commit comments