npsd (Network Payload Serializer / Deserializer)
The npsd crate provides a flexible and efficient way to serialize and deserialize network payloads. It supports converting Rust types into byte streams suitable for network transmission and reconstructing those types from byte streams received over the network. This is particularly useful for networked applications that require efficient and reliable data exchange.
Features
- Serialize and deserialize complex Rust types to and from byte streams.
- Support for custom serialization contexts.
- Middleware support for extensible processing during serialization/deserialization.
Traits
PayloadContext
The PayloadContext trait provides a way to unwrap the context used in the payload processing.
Middleware
The Middleware trait defines methods for converting types to and from payloads of bytes.
IntoPayload
The IntoPayload trait is used to convert a type into a payload of bytes.
FromPayload
The FromPayload trait is used to convert a payload of bytes back into a type.
PayloadInfo
The PayloadInfo trait provides metadata about the payload.
Payload
The Payload trait combines IntoPayload and FromPayload to facilitate complete serialization and deserialization of types.
License
This project is licensed under the Apache 2.0 License.
Procedural Macros
The npsd crate also provides procedural macros for deriving serialization and deserialization implementations.
Schema
The Schema macro derives implementations for serializing and deserializing complex Rust types.
Example
use ;
Bitmap
The Bitmap macro derives implementations for serializing and deserializing bitmaps.
Example
use ;