spvirit-client 0.1.7

PVAccess client library — search, connect, get, put, monitor.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use spvirit_client::PvaClient;
use std::ops::ControlFlow;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let pv = std::env::args()
        .nth(1)
        .unwrap_or_else(|| "MY:PV:NAME".into());

    let client = PvaClient::builder().build();
    client
        .pvmonitor(&pv, |value| {
            println!("{value}");
            ControlFlow::Continue(())
        })
        .await?;
    Ok(())
}