1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Reusable, presentation-free async client for the opcda-bridge gateway's
//! gRPC API.
//!
//! This crate is the typed connect/read/write/browse/search/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 ([`BrowsePage`],
//! [`SearchEvent`], [`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.
//!
//! ```no_run
//! use opcda_bridge::{BrowsePageRequest, SearchMatchMode, SearchRequest};
//!
//! # async fn example() -> opcda_bridge::Result<()> {
//! let mut client = opcda_bridge::Client::connect("localhost:7600").await?;
//! let servers = client.list_servers().await?;
//! let root = client.browse(servers[0].clone(), 200).await?;
//! if let Some(token) = root.next_page_token.clone() {
//! let request =
//! BrowsePageRequest::next(servers[0].clone(), root.session_id.clone(), None, token, 200);
//! let _next_page = client.browse_page(request).await?;
//! }
//! let mut search = client
//! .search_stream(SearchRequest::new(
//! servers[0].clone(),
//! "Some",
//! SearchMatchMode::Prefix,
//! ))
//! .await?;
//! while let Some(event) = search.message().await? {
//! println!("{event:?}");
//! }
//! let values = client
//! .read(servers[0].clone(), vec!["Some.Tag".into()])
//! .await?;
//! client.close_browse_session(root.session_id).await?;
//! # let _ = values;
//! # Ok(())
//! # }
//! ```
pub use Client;
pub use SearchStream;
pub use ;
pub use DEFAULT_BRIDGE_PORT;
pub use ;