Skip to main content

CommonFields

Struct CommonFields 

Source
pub struct CommonFields {
Show 43 fields pub sevr: AlarmSeverity, pub stat: u16, pub amsg: String, pub nsev: AlarmSeverity, pub nsta: u16, pub namsg: String, pub acks: AlarmSeverity, pub ackt: bool, pub udf: u8, pub udfs: i16, pub scan: ScanType, pub sscn: SimModeScan, pub oldsimm: i16, pub pini: i16, pub tpro: u8, pub bkpt: u8, pub flnk: String, pub inp: String, pub out: String, pub dtyp: String, pub time: SystemTime, pub tse: i16, pub tsel: String, pub utag: u64, pub analog_alarm: Option<AnalogAlarmConfig>, pub asg: String, pub asl: u8, pub desc: PvString, pub phas: i16, pub evnt: String, pub prio: i16, pub disv: i16, pub disa: i16, pub sdis: String, pub diss: i16, pub hyst: f64, pub lcnt: i16, pub disp: u8, pub putf: bool, pub rpro: u8, pub proc_field: u8, pub mlst: Option<f64>, pub alst: Option<f64>,
}
Expand description

Common fields shared by all records.

Fields§

§sevr: AlarmSeverity§stat: u16§amsg: String

Alarm message string (current). Mirrors epics-base PR #568: records may attach a human-readable explanation alongside stat/sevr. Empty means “no message”. Transferred from namsg by rec_gbl_reset_alarms.

§nsev: AlarmSeverity§nsta: u16§namsg: String

Pending alarm message — set during process(), transferred to amsg by rec_gbl_reset_alarms (epics-base PR #566).

§acks: AlarmSeverity§ackt: bool§udf: u8

UDF (DBF_UCHAR in dbCommon.dbd) — “value undefined”. C models it as one epicsUInt8 that is BOTH the predicate (if (prec->udf)) and the served byte: caput UDF 255 stores 255 and caget renders it signed DBR_CHAR (-1). Modeled as the raw u8 so the byte round-trips on records that do not re-derive it; every predicate reader tests != 0, and the record-facing crate::server::record::ProcessContext::udf boundary keeps the bool view.

§udfs: i16

UDFS (DBF_MENU menu(menuAlarmSevr)) — the severity raised for a UDF record. Holds the raw stored ordinal (see AnalogAlarmConfig): C stores (epicsEnum16) verbatim on a numeric put, so an out-of-range UDFS round-trips (caput REC.UDFS 4 → 4); the alarm meaning is AlarmSeverity::from_u16(udfs as u16).

§scan: ScanType§sscn: SimModeScan§oldsimm: i16

OLDSIMM (DBF_MENU menu(menuSimm), special(SPC_NOMOD)) — the PREVIOUS simulation mode, the latch C’s recGblSaveSimm (recGbl.c:421-425) writes and recGblCheckSimm (recGbl.c:427-437) compares against to detect a SIMM transition and swap SCAN with SSCN.

C declares it per record (in each of the 21 dbd files that carry SSCN); this port keeps it next to sscn in the common fields, for the same reason sscn lives here — it is framework state, written by exactly one owner (PvDatabase::rec_gbl_save_simm) and read by exactly one (rec_gbl_check_simm). Read-only to clients (SPC_NOMOD).

§pini: i16

PINI is DBF_MENU/menu(menuPini) — a six-choice lifecycle selector, not a flag (see crate::server::record::PiniMode for the choice semantics). Holds the raw stored ordinal as i16: C stores (epicsEnum16) verbatim on a numeric put, so caput REC.PINI 6 keeps 6 and caput REC.PINI -1 keeps 65535. doRecordPini compares against the exact valid indices, so any out-of-range ordinal simply matches no lifecycle pass — read a choice with PiniMode::from_u16(pini as u16).

§tpro: u8

TPRO (DBF_UCHAR in dbCommon.dbd) — trace-processing flag. C stores the raw put byte and serves it as SIGNED DBR_CHAR (caput TPRO 255 → caget = -1). Modeled as the raw u8, like Self::bkpt, so the byte round-trips; consumers test != 0.

§bkpt: u8§flnk: String§inp: String§out: String§dtyp: String§time: SystemTime§tse: i16§tsel: String§utag: u64

Time-tag — C dbCommon.dbd.pod field(UTAG,DBF_UINT64). A 64-bit user/hardware tag set alongside time by recGblGetTimeStampSimm via dbGetTimeStampTag. Zero when no time-tag source is configured.

§analog_alarm: Option<AnalogAlarmConfig>§asg: String

Access security group — C dbCommon.ASG, a DBF_STRING with NO initial() in dbCommon.dbd, so a record that does not name a group holds the EMPTY string and caget -t REC.ASG on any C IOC prints an empty line. It is asAddMember (asLibRoutines.c:893-928) that resolves an empty or unknown name to the DEFAULT group — the FIELD never says “DEFAULT” unless the .db put it there. Ask Self::access_group for the group to evaluate against; read this only to serve the field.

§asl: u8

Access security level. C dbCommon.ASL (0 or 1, default 0). Compared against RULE(N, …) levels in crate::server::access_security::AccessSecurityConfig::check_access_method — a rule with RULE(M, …) only applies when ASL ≤ M. The earlier code hard-coded ASL=0 at every ACF call site (CA tcp.rs, PVA native_source GET/PUT/MONITOR), so every RULE(N>0, WRITE) was always considered “applicable” and the per-record ASL gate was silently inert.

§desc: PvString

Description — C dbCommon field(DESC,DBF_STRING) size(41). A genuine DBF_STRING data field served verbatim to clients, so it is a byte-preserving PvString (a non-UTF-8 DESC put must round-trip unchanged, matching EPICS fixed-size char-array string semantics).

§phas: i16§evnt: String

Event name for SCAN="Event" records. C dbCommon.dbd.pod: field(EVNT,DBF_STRING) { size(40) } — since EPICS 7 this is an event name (resolved by eventNameToHandle), not a numeric subscript. A numeric string (“5”) still works for backward compatibility. Empty means “no event”.

§prio: i16§disv: i16§disa: i16§sdis: String§diss: i16

DISS (DBF_MENU menu(menuAlarmSevr)) — the severity a disabled record takes. Holds the raw stored ordinal (see AnalogAlarmConfig).

§hyst: f64§lcnt: i16§disp: u8§putf: bool§rpro: u8§proc_field: u8§mlst: Option<f64>§alst: Option<f64>

Implementations§

Source§

impl CommonFields

Source

pub fn access_group(&self) -> &str

The single owner of “which access group does this record belong to” — C asAddMember(&prec->asp, prec->asg), whose asAddMemberPvt (asLibRoutines.c:893-928) resolves an empty or unknown group name to the always-present DEFAULT group.

Every access-security call site asks this, never Self::asg directly: the FIELD is what the .db wrote (empty by default, and that is what the wire must show), the GROUP is what the ACF is evaluated against. Three call sites used to spell the empty→DEFAULT rule out for themselves and a fourth (the CA server) relied on the config lookup missing — which is a different rule (C’s unknown-NAME reassignment) that happened to have the same effect.

Source

pub fn process_context(&self) -> ProcessContext

Build a ProcessContext snapshot of the framework-owned state a record’s process() or device support’s read() needs to observe during the cycle.

Source

pub fn callback_priority(&self) -> CallbackPriority

The callback band this record’s PRIO selects — C callbackSetPriority(prec->prio, ...) (seqRecord.c:146).

Trait Implementations§

Source§

impl Clone for CommonFields

Source§

fn clone(&self) -> CommonFields

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 Debug for CommonFields

Source§

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

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

impl Default for CommonFields

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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