sapient-rs
Rust bindings for the SAPIENT / BSI Flex 335 protobuf schemas.
This crate is maintained by Tom Mann, one of the Principal Authors of the SAPIENT standard. It is not affiliated with or sponsored by DSTL.
The generated bindings are distinct from the protocol specification itself. They are derived from schema definitions published in the DSTL SAPIENT-Proto-Files repository. Those source schema files are attributed to DSTL and remain available under Apache License 2.0.
Features
v2_0is enabled by defaultv1_0enables the older BSI Flex 335 v1.0 bindingsv1_0,v2_0enables both schema versions in one build
Usage
Add the crate with:
Import the schema version you want:
use SapientMessage;
The generated types implement prost::Message, so encoding and decoding uses
the usual prost APIs:
use Message;
use Timestamp;
use ;
Framing
This crate also provides simple framing helpers in sapient_rs::utils for a
stream transport of:
- 4-byte unsigned little-endian payload length
- followed by the protobuf-encoded message bytes
Licensing
This crate is licensed under either of:
- MIT
- Apache-2.0
at your option.
The SAPIENT .proto schema source from which these bindings were generated is
derived from the DSTL SAPIENT-Proto-Files repository and is separately
attributed to DSTL under Apache License 2.0.