Crate up_rust

Source
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 validators
  • umessage module, which defines the uProtocol core message type and provides related convenience functionality
  • upayload module, which defines payload representation for uProtocol messages
  • uri module, providing convenience wrappers for creation and validation of uProtocol-style resource identifiers
  • ustatus module, which provides uProtocol types for representing status and status codes
  • utransport module, as an interface contract between uProtocol and specific transport protocol implementations
  • uuid 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§

communication
core
local_transport
Provides a local UTransport which can be used for connecting uEntities running in the same process.

Structs§

CloudEvent
ComparableListener
A wrapper type that allows comparing UListeners to each other.
MockLocalUriProvider
A factory for URIs representing this uEntity’s resources.
MockTransport
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
MockUListener
A handler for processing uProtocol messages.
NotificationValidator
Validates attributes describing a Notification message.
PublishValidator
Validates attributes describing a Publish message.
RequestValidator
Validate UAttributes with type UMessageType::Request
ResponseValidator
Validate UAttributes with type UMessageType::Response
StaticUriProvider
A URI provider that is statically configured with the uEntity’s authority, entity ID and version.
UAttributes
UMessage
UMessageBuilder
A builder for creating UMessages.
UStatus
UUID
UUri

Enums§

UAttributesError
UAttributesValidators
Enum that hold the implementations of uattributesValidator according to type.
UCode
UMessageError
UMessageType
UPayloadFormat
UPriority
UUriError

Constants§

CONTENT_TYPE_CLOUDEVENTS_PROTOBUF

Traits§

LocalUriProvider
A factory for URIs representing this uEntity’s resources.
UAttributesValidator
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 of UAttributes 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.
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.