Skip to main content

Crate spvirit_server

Crate spvirit_server 

Source
Expand description

PVAccess server library for EPICS.

Provides reusable server-side types, .db parsing, connection state, and the Source trait that abstracts over a PV data source. Consumers implement Source and register it with the SourceRegistry to serve PVs over PVAccess.

§High-level API

use spvirit_server::{AnyPv, Pv, PvaServer};

let temp = Pv::ai("SIM:TEMP", 22.5).units("C").prec(2);
let sp = Pv::ao("SIM:SETPOINT", 25.0)
    .on_put(|_pv, v: f64| if v.is_finite() { Ok(()) } else { Err("NaN".into()) });

let server = PvaServer::serve([AnyPv::from(temp.clone()), AnyPv::from(sp)])
    .start()
    .await;
temp.set(23.1).await?;

// Classic builder (still supported):
let server = PvaServer::builder()
    .ai("SIM:TEMP", 22.5)
    .ao("SIM:SETPOINT", 25.0)
    .bo("SIM:ENABLE", false)
    .build();

server.run().await?;

Re-exports§

pub use group::FieldMapping;
pub use group::GroupMember;
pub use group::GroupPvDef;
pub use group::GroupSource;
pub use group::TriggerDef;
pub use group::merge_group_defs;
pub use group::parse_group_config;
pub use group::parse_info_group;
pub use handler::PvListMode;
pub use pv::AnyPv;
pub use pv::Pv;
pub use pv::PvArray;
pub use pv::PvError;
pub use pv::PvScalar;
pub use pva_server::PvaServer;
pub use pva_server::PvaServerBuilder;
pub use pva_server::RunningServer;
pub use pva_server::ServeBuilder;
pub use pvstore::PvInfo;
pub use pvstore::Source;
pub use pvstore::SourceRegistry;
pub use server::PvaServerConfig;
pub use server::PvaServerState;
pub use server::run_pva_server;
pub use server::run_pva_server_with_registry;
pub use simple_store::SimplePvStore;
pub use types::DbCommonState;
pub use types::LinkExpr;
pub use types::OutputMode;
pub use types::RecordData;
pub use types::RecordInstance;
pub use types::RecordType;
pub use types::ScanMode;

Modules§

apply
Functions that apply decoded PUT values to Normative Type payloads.
beacon
PVA beacon sender.
convert
Type conversions from DecodedValue to Rust scalars and ScalarValue.
db
decode
PUT body decoding utilities.
group
Group PV configuration: parse JSON definitions that compose multiple individual PVs into a single structured PVA channel.
handler
PVA protocol handler — the core TCP connection processor.
monitor
Monitor subscription management for the PVA server.
pv
Typed PV handles — the ergonomic front door to SimplePvStore.
pva_server
High-level PVAccess server — builder pattern for typed records.
pvstore
The Source trait — an object-safe abstraction over any PV data source, and SourceRegistry — a dynamic, priority-ordered collection of sources.
record_fields
IOC/QSRV-style record field access.
server
Top-level PVA server orchestration.
simple_store
A simple in-memory Source implementation backed by RecordInstance.
state
types
Server-specific record and IOC types.