This library implements the uProtocol Language Specific Library Requirements for Rust defined in uProtocol Specifications. The library is organized into packages that are described below. Each package contains a README file that describes the purpose of the package and how to use it.
The module contains the factory methods, serializers, and validators for all data types defined in the specifications, and any data models that either haven't or couldn't be defined in up-core-api yet.
Building the library is as simple as running cargo build
in the project root directory. The build pulls uprotocol protobuf definitions that constitute the core types used in the library. All of these are compiled automatically by build.rs
. The resulting Rust code is made available to the project via the up_core_api::
internal module.
Note: the library uses non-stable features from the uuid crate, notably version 8 UUIDs. These features are defined in cargo.toml
(where the uuid crate dependency is declared), and require a compiler flag to be included in the build. This is configured in .cargo/config.toml
.
The crate contains some optional features, as per the crate documentation (refer to src/lib.rs).
To tell VSCode to just build all crate features automatically, place the following in ./vscode/settings.json
:
{
"rust-analyzer.cargo.features": "all"
}
For more details on Rust (cargo) features, please refer to The Cargo Book.
Sub-modules of this crate, as well as optional features, are listed in the crate documentation in src/lib.rs
.