Skip to main content

SharedPV

Struct SharedPV 

Source
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§

Source§

impl SharedPV

Source

pub fn create_mailbox() -> Result<Self>

Create a mailbox SharedPV

Mailbox PVs support both read and write operations by clients.

Source

pub fn create_readonly() -> Result<Self>

Create a readonly SharedPV

Readonly PVs only support read operations by clients.

Source

pub fn is_open(&self) -> bool

Check if the PV is open

Source

pub fn close(&mut self) -> Result<()>

Close the PV

Source

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
Source

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
Source

pub fn post_string(&mut self, value: &str) -> Result<()>

Post a new string value to the PV

§Arguments
  • value - The new value to post
Source

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)
Source

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
Source

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
Source

pub fn post_string_array(&mut self, value: &[String]) -> Result<()>

Post a new string array to the PV

Updates the array value and notifies connected clients.

§Arguments
  • value - The new array to post
Source

pub fn fetch(&self) -> Result<Value>

Fetch the current value of the PV

Returns the current value as a Value that can be inspected.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.