bytehound-opc-da-client 0.2.3

Backend-agnostic OPC DA client library for Rust — async, trait-based, with transparent COM management
Documentation
#![allow(unsafe_code, unreachable_pub)]
#![doc = include_str!("../README.md")]
//! # opc-da-client
//!
//! Backend-agnostic OPC DA client library for Rust — async, trait-based,
//! with transparent COM management.
//!
//! ## Quick Start
//!
//! ```no_run
//! # use anyhow::Result;
//! use opc_da_client::{OpcDaClient, OpcProvider};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<()> {
//! let client = OpcDaClient::default();
//! let servers = client.list_servers("localhost").await?;
//! # Ok(())
//! # }
//! ```
//!
//! ## Feature Flags
//!
//! | Flag | Default | Effect |
//! |------|---------|--------|
//! | `opc-da-backend` | ✅ | Native OPC DA backend via `windows-rs` |
//! | `test-support` | ❌ | Enables `MockOpcProvider` via `mockall` |
//!
//! ## Platform
//!
//! **Windows only** — OPC DA is built on COM/DCOM.

mod com_guard;
pub use com_guard::ComGuard;
mod helpers;
#[cfg(feature = "opc-da-backend")]
mod inventory;
#[cfg(feature = "opc-da-backend")]
mod native_browse;
mod provider;

#[cfg(feature = "opc-da-backend")]
#[allow(warnings)]
mod bindings;
pub mod com_worker;

#[cfg(feature = "opc-da-backend")]
#[allow(warnings)]
mod opc_da;

#[cfg(feature = "opc-da-backend")]
mod backend;

// Stable public API
pub use helpers::{format_hresult, friendly_com_hint, log_opc_error};
pub use provider::{
    BrowseCapabilities, BrowseNamespace, BrowseNode, BrowseNodeFilter, BrowseNodeKind,
    BrowseNodeToken, BrowsePage, BrowsePageRequest, BrowsePageToken, BrowseSessionToken,
    InventoryCompleted, InventoryControl, InventoryEntry, InventoryEvent, InventoryOptions,
    InventoryProgress, InventoryStream, OpcProvider, OpcValue, TagValue, WriteResult,
};

#[cfg(feature = "opc-da-backend")]
pub use opc_da::{
    errors::{OpcError, OpcResult},
    typedefs::{GroupHandle, ItemHandle},
};

// Backend re-exports (conditional)
#[cfg(feature = "opc-da-backend")]
pub use backend::{connector::ComConnector, opc_da::OpcDaClient};

// Test support re-export
#[cfg(feature = "test-support")]
pub use provider::MockOpcProvider;