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
communicationmodule, 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.uattributesmodule, with uProtocol message attribute types and validatorsumessagemodule, which defines the uProtocol core message type and provides related convenience functionalityupayloadmodule, which defines payload representation for uProtocol messagesurimodule, providing convenience wrappers for creation and validation of uProtocol-style resource identifiersustatusmodule, which provides uProtocol types for representing status and status codesutransportmodule, as an interface contract between uProtocol and specific transport protocol implementationsuuidmodule, 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
-
cloudeventsenables support for mapping UMessages to/from CloudEvents using Protobuf Format according to the uProtocol specification. -
communicationenables support for the Communication Layer API and its default implementation on top of the Transport Layer API. Enabled by default. -
udiscoveryenables support for types required to interact with uDiscovery service implementations. -
usubscriptionenables support for types required to interact with uSubscription service implementations. Enabled by default. -
utwinenables support for types required to interact with uTwin service implementations. -
test-utilprovides 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. -
utilprovides 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§
- communication
- core
- local_
transport - Provides a local UTransport which can be used for connecting uEntities running in the same process.
Structs§
- Cloud
Event - Comparable
Listener - A wrapper type that allows comparing
UListeners to each other. - Mock
Local UriProvider - A factory for URIs representing this uEntity’s resources.
- Mock
Transport - 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
- MockU
Listener - A handler for processing uProtocol messages.
- Notification
Validator - Validates attributes describing a Notification message.
- Publish
Validator - Validates attributes describing a Publish message.
- Request
Validator - Validate
UAttributeswith typeUMessageType::Request - Response
Validator - Validate
UAttributeswith typeUMessageType::Response - Static
UriProvider - A URI provider that is statically configured with the uEntity’s authority, entity ID and version.
- UAttributes
- UMessage
- UMessage
Builder - A builder for creating
UMessages. - UStatus
- UUID
- UUri
Enums§
- UAttributes
Error - UAttributes
Validators - Enum that hold the implementations of uattributesValidator according to type.
- UCode
- UMessage
Error - UMessage
Type - UPayload
Format - UPriority
- UUri
Error
Constants§
Traits§
- Local
UriProvider - A factory for URIs representing this uEntity’s resources.
- UAttributes
Validator UAttributesis 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 ofUAttributesdefines 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.- UListener
- A handler for processing uProtocol messages.
- UTransport
- The uProtocol Transport Layer interface that provides a common API for uEntity developers to send and receive messages.
Functions§
- verify_
filter_ criteria - Verifies that given UUris can be used as source and sink filter UUris for registering listeners.