Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
= Eclipse uProtocol Rust library :toc: preamble :sectnums: :source-highlighter: highlight.js
SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation
See the NOTICE file(s) distributed with this work for additional information regarding copyright ownership.
This program and the accompanying materials are made available under the terms of the Apache License Version 2.0 which is available at https://www.apache.org/licenses/LICENSE-2.0
SPDX-FileType: DOCUMENTATION SPDX-License-Identifier: Apache-2.0
== Overview
This crate is the https://github.com/eclipse-uprotocol/uprotocol-spec/blob/main/languages.adoc[uProtocol Language Library] for the Rust programming language.
The crate can be used to
- implement uEntities that communicate with each other using the uProtocol https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l2/api.adoc[Communication Layer API] over one of the supported transport protocols.
- implement support for an additional transport protocol by means of implementing the https://github.com/eclipse-uprotocol/up-spec/blob/main/up-l1/README.adoc[Transport Layer API].
[.specitem,oft-sid="umanup-language-building1",oft-covers="requp-language-documentation1"]
== Building
[.specitem,oft-sid="impluse-cargo-build-system1",oft-covers="requp-language-build-sys1,requp-language-build-deps1"]
The crate can be built using the https://doc.rust-lang.org/cargo/[Cargo package manager] from the root folder:
[example]
cargo build
--
The build requires an active connection to the internet because it needs to download and compile https://github.com/eclipse-uprotocol/up-spec/tree/main/up-core-api[uProtocol protobuf files] which define many of the core types used throughout the library.
The crate has some (optional) features as documented in link:src/lib.rs[lib.rs]).
VSCode can be instructed to build all features automatically by means of putting the following into ./vscode/settings.json
:
[source,json]
{ "rust-analyzer.cargo.features": "all" }
=== Generating API Documentation
The API documentation can be generated using
[example]
cargo doc --no-deps --all-features --open
[.specitem,oft-sid="umanup-language-using1",oft-covers="requp-language-documentation1"]
== Using the Crate
The crate needs to be added to the [dependencies]
section of the Cargo.toml
file:
[source,toml]
[dependencies] up-rust = { version = "0.1" }
Most developers will want to use the Communication Level API and its default implementation
which are provided by communication
module.