pub struct OutTarget {
pub field_type: Option<DbFieldType>,
pub element_count: i64,
pub is_ca_link: bool,
pub puts_as_string: bool,
}Expand description
Resolved metadata of an OUT-link TARGET, as C’s soft device support obtains it before choosing its write buffer.
C’s two sources, both mirrored by
PvDatabase::resolve_out_target:
DB_LINK—dbNameToAddrgivesfield_typeandno_elements(devsCalcoutSoft.c:127-131,devaCalcoutSoft.c:78-79); an unresolvable name leaves the caller’s initializers untouched.CA_LINK—dbCaGetLinkDBFtype/dbCaGetNelements(dbCa.c:662-704), which both return-1on a disconnected link and likewise leave the initializers untouched.
A record reproduces its C device support’s buffer switch on this in
Record::multi_output_buffer.
Fields§
§field_type: Option<DbFieldType>Target field’s DBF type. None = unresolved (disconnected CA link,
or a name this IOC cannot resolve) — C’s field_type initializer.
element_count: i64Target field’s element capacity — C no_elements / dbCaGetNelements.
1 when unresolved, matching C’s n_elements = 1 initializer.
is_ca_link: boolTrue when C would classify this link as a CA_LINK: an explicit
ca:///pva:// link, or a DB-style name that is not a record of
this IOC (dbInitLink locality). Device support that splits its
buffer choice on sync-vs-async (devsCalcoutSoft.c:76, gated on
plink->type == CA_LINK && pscalcout->wait) reads this.
puts_as_string: boolTrue when the target field is one of the seven DBF classes C’s soft
device support puts as DBR_STRING — DBF_STRING, DBF_ENUM,
DBF_MENU, DBF_DEVICE, DBF_INLINK, DBF_OUTLINK, DBF_FWDLINK
(devsCalcoutSoft.c:83-85, :128-130).
Carried here rather than re-derived from Self::field_type because
DbFieldType is the DBR wire type: it has no Menu or Device
variant, so a menu target (PRIO, STAT, SEVR, DISS, ACKT, …)
or DTYP is indistinguishable from a plain numeric/string field by
type alone. The classification is made once, at resolution, by the
side that holds the target’s field metadata
(RecordInstance::field_puts_as_string); a record’s
Record::multi_output_buffer just reads the answer.
Implementations§
Source§impl OutTarget
impl OutTarget
Sourcepub const UNRESOLVED: Self
pub const UNRESOLVED: Self
C’s initializer state: field_type = 0 is never used as a type by
the port (a None type routes to the device support’s default:
arm), and n_elements = 1. An unresolved target is not in the string
class — C’s field_type = 0 matches no case and falls to default:.
Trait Implementations§
impl Copy for OutTarget
impl Eq for OutTarget
impl StructuralPartialEq for OutTarget
Auto Trait Implementations§
impl Freeze for OutTarget
impl RefUnwindSafe for OutTarget
impl Send for OutTarget
impl Sync for OutTarget
impl Unpin for OutTarget
impl UnsafeUnpin for OutTarget
impl UnwindSafe for OutTarget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.