pub struct SharedPV { /* private fields */ }Expand description
A shared process variable that can be hosted by a server
SharedPVs represent individual process variables with typed values that can be accessed by EPICS clients.
§Example
use pvxs_sys::SharedPV;
let mut pv = SharedPV::create_mailbox()?;
// Note: open_double is internal API, use Server::create_pv_* methods instead
// Update the value
pv.post_double(99.9)?;
// Get current value
let value = pv.fetch()?;
println!("Current value: {}", value);Implementations§
Sourcepub fn create_mailbox() -> Result<Self>
pub fn create_mailbox() -> Result<Self>
Create a mailbox SharedPV
Mailbox PVs support both read and write operations by clients.
Sourcepub fn create_readonly() -> Result<Self>
pub fn create_readonly() -> Result<Self>
Create a readonly SharedPV
Readonly PVs only support read operations by clients.
Sourcepub fn post_double(&mut self, value: f64) -> Result<()>
pub fn post_double(&mut self, value: f64) -> Result<()>
Post a new double value to the PV
This updates the PV value and notifies connected clients. If the PV is a double array, this will just replace the value at position 0.
§Arguments
value- The new value to post
Sourcepub fn post_int32(&mut self, value: i32) -> Result<()>
pub fn post_int32(&mut self, value: i32) -> Result<()>
Post a new int32 value to the PV
This updates the PV value and notifies connected clients. If the PV is an int32 array, this will just replace the value at position 0.
§Arguments
value- The new value to post
Sourcepub fn post_string(&mut self, value: &str) -> Result<()>
pub fn post_string(&mut self, value: &str) -> Result<()>
Sourcepub fn post_enum(&mut self, value: i16) -> Result<()>
pub fn post_enum(&mut self, value: i16) -> Result<()>
Post a new enum value to the PV
Updates the enum index (value.index field) and notifies connected clients.
§Arguments
value- The enum index to post (should be valid for the choices array)
Sourcepub fn post_double_array(&mut self, value: &[f64]) -> Result<()>
pub fn post_double_array(&mut self, value: &[f64]) -> Result<()>
Post a new double array to the PV
Updates the array value and notifies connected clients.
§Arguments
value- The new array to post
Sourcepub fn post_int32_array(&mut self, value: &[i32]) -> Result<()>
pub fn post_int32_array(&mut self, value: &[i32]) -> Result<()>
Post a new int32 array to the PV
Updates the array value and notifies connected clients.
§Arguments
value- The new array to post