| Crates.io | rsomeip-proto |
| lib.rs | rsomeip-proto |
| version | 0.1.0 |
| created_at | 2025-08-21 17:28:58.195501+00 |
| updated_at | 2025-08-21 17:28:58.195501+00 |
| description | Sans-IO implementation of the SOME/IP protocol. |
| homepage | |
| repository | https://github.com/brunoldsilva/rsomeip |
| max_upload_size | |
| id | 1805071 |
| size | 133,594 |
Sans-IO implementation of the SOME/IP protocol.
This crate provides an implementation of the core SOME/IP protocol, mainly focused on message processing.
It provides the basic primitives used by the protocol as well as endpoint and interface abstractions to check messages for correctness.
Add rsomeip-proto as a dependency to your project.
# Cargo.toml
[dependencies]
rsomeip-proto = "0.1.0"
Create an [Endpoint] and serve an [Interface]. Use the
[Endpoint::process] and [Endpoint::poll] methods to serialize and
deserialize messages.
use rsomeip_proto::{Endpoint, ServiceId, Interface, MethodId, MessageType};
use rsomeip_bytes::{Bytes, BytesMut};
type Message = rsomeip_proto::Message<Bytes>;
// Create an endpoint with a stub and a proxy.
let endpoint = Endpoint::new()
.with_interface(
ServiceId::new(0x0001),
Interface::default().with_method(MethodId::default()),
)
.with_interface(
ServiceId::new(0x0002),
Interface::default().with_method(MethodId::default()).into_proxy(),
);
// Poll for incoming messages.
let mut buffer = Message::default()
.with_service(ServiceId::new(0x0001))
.to_bytes()
.expect("should serialize the message");
assert_eq!(
endpoint.poll(&mut buffer),
Ok(Message::default().with_service(ServiceId::new(0x0001)))
);
// Process outgoing messages.
let mut buffer = BytesMut::with_capacity(16);
assert_eq!(
endpoint.process(
Message::default().with_service(ServiceId::new(0x0002)),
&mut buffer
),
Ok(16)
);
assert_eq!(
buffer.freeze(),
Message::default()
.with_service(ServiceId::new(0x0002))
.to_bytes()
.expect("should serialize")
);
This crate is intended to be used as the core for developing more complex crates based on the SOME/IP protocol.
This project is licensed under either the Apache-2.0 License or MIT License, at your option.
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.