Skip to main content

Crate opcda_bridge

Crate opcda_bridge 

Source
Expand description

Reusable, presentation-free async client for the opcda-bridge gateway’s gRPC API.

This crate is the typed connect/read/write/browse/list-servers surface extracted from opcda-bridge-client’s commands.rs: no clap, no tabled, no serde_json/toml — just Client, the parameters its methods take, and the plain result types they return (BrowseNode, TagValue, WriteResult, Value). opcda-bridge-client depends on this crate and adds only CLI parsing and table/JSON rendering on top of it; any other async Rust program that needs typed OPC DA reads/writes/browses without shelling out to the CLI binary and parsing its output can depend on this crate directly instead.

let mut client = opcda_bridge::Client::connect("localhost:7600").await?;
let servers = client.list_servers().await?;
let values = client
    .read(servers[0].clone(), vec!["Some.Tag".into()])
    .await?;

Structs§

BrowseNode
A single node returned by crate::Client::browse: one tag or branch in the OPC DA server’s tag tree.
Client
A connected client for an opcda-bridge gateway’s gRPC API.
TagValue
A single tag’s value returned by crate::Client::read.
WriteResult
The result of a single crate::Client::write call.

Enums§

Error
Errors that can occur while talking to an opcda-bridge gateway.
Value
A tag value to write, parsed from a raw string via parse_value.

Constants§

DEFAULT_BRIDGE_PORT
Default TCP port used by the gateway and clients.

Functions§

parse_value
Parse a raw string into the most specific Value variant it matches: bool, then i32, then f64, falling back to String.

Type Aliases§

Result
A Result alias using Error, mirroring the ergonomics of anyhow::Result (opcda_bridge::Result<T>) for a crate that intentionally does not depend on anyhow itself.