Skip to main content

Crate opcua_kit

Crate opcua_kit 

Source
Expand description

Embed OPC UA protocol services in a Rust application.

The default build implements UA TCP endpoint discovery and UADP key frames in Rust. Both can be embedded without third-party dependencies. Discovery lists the policies an endpoint advertises. Before connecting, provision the approved server certificate and application URI.

use std::time::Duration;
let endpoints = opcua_kit::discover_endpoints("opc.tcp://localhost:4840", Duration::from_secs(5))?;
for endpoint in endpoints { println!("{}", endpoint.security_policy_uri); }

The optional client and server features provide Rust implementations of sessions, reads, subscriptions and serving host-owned variables. control adds writes and calls. commissioning and cems support offline signal checks and meter processing. Enable only pubsub for the standalone no_std codec with an allocator. With all features disabled, the crate provides a dependency-free no_std status classifier.

Re-exports§

pub use client::MeterReadError;
pub use client::SnapshotReadError;
pub use client::CallOutcome;
pub use client::ConditionComment;
pub use client::ConditionError;
pub use client::Control;
pub use client::ControlError;
pub use client::ArrayValue;
pub use client::BrowseEntry;
pub use client::BrowseError;
pub use client::BrowseName;
pub use client::CertificateRollover;
pub use client::Client;
pub use client::ConnectError;
pub use client::ConnectionConfig;
pub use client::ConnectionOptions;
pub use client::DataChange;
pub use client::DataChanges;
pub use client::EngineeringUnitEvidence;
pub use client::EventError;
pub use client::EventField;
pub use client::Events;
pub use client::FixedScalar;
pub use client::HistoricalRead;
pub use client::HistoryError;
pub use client::MAX_MONITORED_NODES;
pub use client::MAX_READ_NODES;
pub use client::MonitoredDataChanges;
pub use client::MonitoredNode;
pub use client::PublishError;
pub use client::ReadAttribute;
pub use client::ReadError;
pub use client::ReadOperand;
pub use client::RecoveredSession;
pub use client::RecoveringClient;
pub use client::RecoveryError;
pub use client::Sample;
pub use client::SampleTimestamp;
pub use client::Scalar;
pub use client::SecurityPolicy;
pub use client::Sequenced;
pub use client::SequencedDataChanges;
pub use client::SessionState;
pub use client::SubscriptionError;
pub use client::TimestampError;
pub use client::UnitStage;
pub use client::UserIdentity;
pub use client::VariableDefinition;
pub use discovery::DiscoveryError;
pub use discovery::EndpointInfo;
pub use discovery::EndpointToken;
pub use discovery::discover_endpoints;

Modules§

client
Discover endpoints and browse, read or monitor nodes over a pinned OPC UA session.
commissioning
Compare the declared metadata consumed by a gateway against scoped OPC UA observations.
discovery
Synchronous OPC UA GetEndpoints over UA TCP. Uses the Rust standard library.
pubsub
A bounded OPC UA Part 14 UADP wire profile for host-owned transports.
server
Serve host-owned scalar variables in an OPC UA address space. The application owns the event loop, values and shutdown signal.
ua
UA Binary values and service structures for the protocol roles provided by this crate.

Structs§

EngineeringUnit
A programmatic OPC UA engineering unit, identified by its authority and signed ID.
NodeId
A namespace URI and a typed OPC UA identifier. Namespace indexes are session-local.
NodeIdError
An invalid namespace URI or OPC UA identifier.

Enums§

Severity
Client interpretation of the severity field of an OPC UA StatusCode.

Functions§

certificate_application_uri
Read the single application URI from a DER certificate’s subject alternative name. Certificate validity, usage and peer trust are checked when preparing a connection.
status_severity
Classifies the two severity bits, independently of the subcode and flags.