Expand description
up-rust is the Eclipse uProtocol™ Language Library for the Rust programming language.
This 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.
§Library contents
communication
module, which defines uProtocol’s Communication Layer API for publishing and subscribing to topics and invoking RPC methods. It also contains a default implementation employing the Transport Layer API.uattributes
module, with uProtocol message attribute types and validatorsumessage
module, which defines the uProtocol core message type and provides related convenience functionalityupayload
module, which defines payload representation for uProtocol messagesuri
module, providing convenience wrappers for creation and validation of uProtocol-style resource identifiersustatus
module, which provices uProtocol types for representing status and status codesutransport
module, as an interface contract between uProtocol and specific transport protocol implementationsuuid
module, which generates and validates UUIDs as per the uProtocol specification
For user convenience, all of these modules export their types on up_rust top-level, except for (future) optional features.
§Features
-
cloudevents
enables support for mapping UMessages to/from CloudEvents using Protobuf Format according to the uProtocol specification. -
communication
enables support for the Communication Layer API and its default implementation on top of the Transport Layer API. Enabled by default. -
udiscovery
enables support for types required to interact with uDiscovery service implementations. -
usubscription
enables support for types required to interact with uSubscription service implementations. Enabled by default. -
utwin
enables support for types required to interact with uTwin service implementations. -
test-util
provides some useful mock implementations for testing. In particular, provides mock implementations of UTransport and Communication Layer API traits which make implementing unit tests a lot easier. -
util
provides some useful helper structs. In particular, provides a local, in-memory UTransport for exchanging messages within a single process. This transport is also used by the examples illustrating usage of the Communication Layer API.
§References
Modules§
- Provides a local UTransport which can be used for connecting uEntities running in the same process.
Structs§
- A wrapper type that allows comparing
UListener
s to each other. - A factory for URIs representing this uEntity’s resources.
- This extra struct is necessary in order to comply with mockall’s requirements regarding the parameter lifetimes see https://github.com/asomers/mockall/issues/571
- A handler for processing uProtocol messages.
- Validates attributes describing a Notification message.
- Validates attributes describing a Publish message.
- Validate
UAttributes
with typeUMessageType::Request
- Validate
UAttributes
with typeUMessageType::Response
- A URI provider that is statically configured with the uEntity’s authority, entity ID and version.
- A builder for creating
UMessage
s.
Enums§
- Enum that hold the implementations of uattributesValidator according to type.
Constants§
Traits§
- A factory for URIs representing this uEntity’s resources.
UAttributes
is the struct that defines the Payload. It serves as the configuration for various aspects like time to live, priority, security tokens, and more. Each variant ofUAttributes
defines a different type of message payload. The payload could represent a simple published payload with some state change, an RPC request payload, or an RPC response payload.- A handler for processing uProtocol messages.
- The uProtocol Transport Layer interface that provides a common API for uEntity developers to send and receive messages.