pub struct PvaServerBuilder { /* private fields */ }Expand description
Implementations§
Source§impl PvaServerBuilder
impl PvaServerBuilder
Sourcepub fn ai(self, name: impl Into<String>, initial: f64) -> Self
pub fn ai(self, name: impl Into<String>, initial: f64) -> Self
Add an ai (analog input, read-only) record.
Sourcepub fn ao(self, name: impl Into<String>, initial: f64) -> Self
pub fn ao(self, name: impl Into<String>, initial: f64) -> Self
Add an ao (analog output, writable) record.
Sourcepub fn bi(self, name: impl Into<String>, initial: bool) -> Self
pub fn bi(self, name: impl Into<String>, initial: bool) -> Self
Add a bi (binary input, read-only) record.
Sourcepub fn bo(self, name: impl Into<String>, initial: bool) -> Self
pub fn bo(self, name: impl Into<String>, initial: bool) -> Self
Add a bo (binary output, writable) record.
Sourcepub fn string_in(
self,
name: impl Into<String>,
initial: impl Into<String>,
) -> Self
pub fn string_in( self, name: impl Into<String>, initial: impl Into<String>, ) -> Self
Add a stringin (string input, read-only) record.
Sourcepub fn string_out(
self,
name: impl Into<String>,
initial: impl Into<String>,
) -> Self
pub fn string_out( self, name: impl Into<String>, initial: impl Into<String>, ) -> Self
Add a stringout (string output, writable) record.
Sourcepub fn waveform(self, name: impl Into<String>, data: ScalarArrayValue) -> Self
pub fn waveform(self, name: impl Into<String>, data: ScalarArrayValue) -> Self
Add a waveform record (array) with the given initial data.
Sourcepub fn mbbi(
self,
name: impl Into<String>,
choices: Vec<String>,
initial: i32,
) -> Self
pub fn mbbi( self, name: impl Into<String>, choices: Vec<String>, initial: i32, ) -> Self
Add an mbbi (multi-bit binary input, read-only) NTEnum record.
Sourcepub fn mbbo(
self,
name: impl Into<String>,
choices: Vec<String>,
initial: i32,
) -> Self
pub fn mbbo( self, name: impl Into<String>, choices: Vec<String>, initial: i32, ) -> Self
Add an mbbo (multi-bit binary output, writable) NTEnum record.
Sourcepub fn generic(
self,
name: impl Into<String>,
struct_id: impl Into<String>,
fields: Vec<(String, PvValue)>,
) -> Self
pub fn generic( self, name: impl Into<String>, struct_id: impl Into<String>, fields: Vec<(String, PvValue)>, ) -> Self
Add a generic structure record with a custom struct ID and fields.
Sourcepub fn on_put<F>(self, name: impl Into<String>, callback: F) -> Self
pub fn on_put<F>(self, name: impl Into<String>, callback: F) -> Self
Register a callback invoked when a PUT is applied to the named PV.
Sourcepub fn scan<F>(
self,
name: impl Into<String>,
period: Duration,
callback: F,
) -> Self
pub fn scan<F>( self, name: impl Into<String>, period: Duration, callback: F, ) -> Self
Register a periodic scan callback that produces a new value for a PV.
Sourcepub fn link<F>(
self,
output: impl Into<String>,
inputs: &[&str],
compute: F,
) -> Self
pub fn link<F>( self, output: impl Into<String>, inputs: &[&str], compute: F, ) -> Self
Link an output PV to one or more input PVs.
Whenever any input PV changes (via set_value, protocol PUT, or
another link), the compute callback is invoked with the current
values of all inputs (in order) and the result is written to
the output PV.
.link("CALC:SUM", &["INPUT:A", "INPUT:B"], |values| {
let a = values[0].as_f64().unwrap_or(0.0);
let b = values[1].as_f64().unwrap_or(0.0);
ScalarValue::F64(a + b)
})Sourcepub fn advertise_ip(self, ip: IpAddr) -> Self
pub fn advertise_ip(self, ip: IpAddr) -> Self
Set the IP address to advertise in search responses.
Sourcepub fn compute_alarms(self, enabled: bool) -> Self
pub fn compute_alarms(self, enabled: bool) -> Self
Enable alarm computation from limits.
Sourcepub fn beacon_period(self, secs: u64) -> Self
pub fn beacon_period(self, secs: u64) -> Self
Set the beacon broadcast period in seconds (default 15).
Sourcepub fn conn_timeout(self, timeout: Duration) -> Self
pub fn conn_timeout(self, timeout: Duration) -> Self
Set the idle connection timeout (default ~18 hours).
Sourcepub fn pvlist_mode(self, mode: PvListMode) -> Self
pub fn pvlist_mode(self, mode: PvListMode) -> Self
Set the PV list mode (default PvListMode::List).
Sourcepub fn pvlist_max(self, max: usize) -> Self
pub fn pvlist_max(self, max: usize) -> Self
Set the maximum number of PV names in pvlist responses (default 1024).
Sourcepub fn pvlist_allow_pattern(self, pattern: Regex) -> Self
pub fn pvlist_allow_pattern(self, pattern: Regex) -> Self
Set a regex filter for PV names exposed by pvlist.