pub struct Pv(/* private fields */);Expand description
A handle to a live PV. Cheap to clone.
Implementations§
Source§impl Pv
impl Pv
pub fn name(&self) -> &PvName
Sourcepub fn dropped(&self) -> bool
pub fn dropped(&self) -> bool
Whether the PV connected once and has since lost its connection. A write to it is refused at once; one to a PV that has yet to connect is queued.
Sourcepub fn version(&self) -> u64
pub fn version(&self) -> u64
A number that changes whenever its state does (bar read-only mode), so a caller can skip work on a PV that has not changed.
Sourcepub fn listen(&self, listener: &Listener)
pub fn listen(&self, listener: &Listener)
Call listener with the current state now and with each change
after, until the caller drops it: unlike Pv::state read once a
frame, this sees every monitor update.
Sourcepub fn write(&self, value: impl Into<String>)
pub fn write(&self, value: impl Into<String>)
Write a value given as text; the backend converts it to the PV’s type.
Sourcepub fn write_long_string(&self, value: impl Into<String>)
pub fn write_long_string(&self, value: impl Into<String>)
Write text as Phoebus does for a widget whose format is string: into
a char array as a long string (see long_string_bytes). Any other
PV is written as by Pv::write.
Over CA, as in Phoebus, a char array is a DBF_CHAR channel of more
than one element, and the text is cut to that element count with its
NUL kept. Over PVA and loc:// it is any array of numbers. A PVA
array has no fixed element count to cut to, so an IOC that stores
only its first NELM elements may lose the NUL (and part of a
multi-byte character), as it does with Phoebus.