Skip to main content

OutTarget

Struct OutTarget 

Source
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_LINKdbNameToAddr gives field_type and no_elements (devsCalcoutSoft.c:127-131, devaCalcoutSoft.c:78-79); an unresolvable name leaves the caller’s initializers untouched.
  • CA_LINKdbCaGetLinkDBFtype / dbCaGetNelements (dbCa.c:662-704), which both return -1 on 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: i64

Target field’s element capacity — C no_elements / dbCaGetNelements. 1 when unresolved, matching C’s n_elements = 1 initializer.

§is_ca_link: bool

True 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: bool

True when the target field is one of the seven DBF classes C’s soft device support puts as DBR_STRINGDBF_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

Source

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§

Source§

impl Clone for OutTarget

Source§

fn clone(&self) -> OutTarget

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OutTarget

Source§

impl Debug for OutTarget

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for OutTarget

Source§

impl PartialEq for OutTarget

Source§

fn eq(&self, other: &OutTarget) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OutTarget

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more