spvirit_client/lib.rs
1//! PVAccess client library — search, connect, get, put, monitor.
2//!
3//! This crate provides both a **high-level API** ([`PvaClient`]) and the
4//! lower-level protocol functions used to build it.
5//!
6//! # High-level API
7//!
8//! ```rust,ignore
9//! use spvirit_client::PvaClient;
10//! use std::ops::ControlFlow;
11//!
12//! let client = PvaClient::builder().build();
13//!
14//! // GET
15//! let result = client.pvget("MY:PV").await?;
16//!
17//! // PUT
18//! client.pvput("MY:PV", 42.0).await?;
19//!
20//! // MONITOR
21//! client.pvmonitor("MY:PV", |val| {
22//! println!("{val:?}");
23//! ControlFlow::Continue(())
24//! }).await?;
25//!
26//! // INFO (introspection)
27//! let desc = client.pvinfo("MY:PV").await?;
28//! ```
29//!
30//! # Key types
31//!
32//! - [`PvaClient`] — high-level client with `pvget`, `pvput`, `pvmonitor`, `pvinfo`
33//! - [`PvOptions`] — configuration for PV operations (ports, timeout, auth)
34//! - [`PvGetResult`] — decoded GET result with introspection
35//! - [`ChannelConn`] — low-level established TCP channel
36//! - [`SearchTarget`] — UDP/TCP search target address
37
38pub mod auth;
39pub mod client;
40pub mod format;
41pub mod put_encode;
42pub mod pva_client;
43pub mod pvlist;
44pub mod search;
45pub mod transport;
46pub mod types;
47
48// --- Re-exports: high-level API ---
49pub use pva_client::{
50 PvaChannel, PvaClient, PvaClientBuilder, client_from_opts, pvinfo, pvmonitor, pvput,
51};
52pub use pvlist::PvListSource;
53
54// --- Re-exports: client core ---
55pub use client::{ChannelConn, build_client_validation, establish_channel, pvget};
56pub use format::{OutputFormat, RenderOptions, format_output};
57pub use search::{SearchTarget, build_auto_broadcast_targets, resolve_pv_server, search_pv};
58pub use transport::read_packet;
59pub use types::{PvGetError, PvGetOptions, PvGetResult, PvMonitorEvent, PvOptions};