Skip to content

eclipse-uprotocol/up-rust

Repository files navigation

Eclipse uProtocol Rust library

This is the uProtocol v1.6.0-alpha.3 Language Library for the Rust programming language.

The crate can be used to

  • implement uEntities that communicate with each other using the uProtocol Communication Layer API over one of the supported transport protocols.
  • implement support for an additional transport protocol by means of implementing the Transport Layer API.

Using the Crate

The crate needs to be added to the [dependencies] section of the Cargo.toml file:

[dependencies]
up-rust = { version = "0.1" }

Most developers will want to use the Communication Level API and its default implementation which are provided by the communication module.

Building from Source

First, the repository needs to be cloned using:

git clone --recurse-submodules git@github.com:eclipse-uprotocol/up-rust

The --recurse-submodules parameter is important to make sure that the git submodule referring to the uProtocol type definitions is being initialized in the workspace. The proto3 files contained in that submodule define uProtocol's basic types and are being compiled into Rust code as part of the build process. If the repository has already been cloned without the parameter, the submodule can be initialized manually using git submodule update --init --recursive.

The crate can then be built using the Cargo package manager from the root folder:

cargo build

The crate has some (optional) features as documented in lib.rs.

VSCode can be instructed to build all features automatically by means of putting the following into ./vscode/settings.json:

{
  "rust-analyzer.cargo.features": "all"
}

Generating API Documentation

The API documentation can be generated using

cargo doc --no-deps --all-features --open

License

The crate is published under the terms of the Apache License 2.0.

Contributing

Contributions are more than welcome. Please refer to the Contribution Guide.

About

uProtocol Language Specific Library for Rust

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages