rsomeip-bytes
A serialization crate for the SOME/IP on-wire format.
Overview
This crate provides traits for the serialization and deserialization of data types according to the SOME/IP protocol.
It also provides implementation of said traits for all basic types supported by the protocol, as well as for some commonly used types from Rust's standard library.
Getting Started
-
Add
rsomeip-bytesas a dependency to your project.# Cargo.toml [] = "0.1.0" -
Use the [
Serialize] and [Deserialize] traits to write and read data.use ; // Write data into a buffer using the `serialize` method. let mut buffer = new; 1u8.serialize.unwrap; // Use `serialize_len` method for dynamically sized types. let dyn_data = vec!; dyn_data.serialize_len.unwrap; // Read data from a buffer using the `deserialize` method. let mut buffer = buffer.freeze; assert_eq!; // Use `deserialize_len` for dynamically sized types. let dyn_data = Vec::deserialize_len.unwrap; assert_eq!; -
Implement the traits for your custom types.
use ;
Motivation
The SOME/IP protocol specifies a list of supported data types and how to represent those types on wire.
This crate aims to enable Rust projects to represent their data types using this format.
License
This project is licensed under either the Apache-2.0 License or MIT License, at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.