#[repr(i16)]pub enum DbfCode {
Show 18 variants
String = 0,
Char = 1,
UChar = 2,
Short = 3,
UShort = 4,
Long = 5,
ULong = 6,
Int64 = 7,
UInt64 = 8,
Float = 9,
Double = 10,
Enum = 11,
Menu = 12,
Device = 13,
Inlink = 14,
Outlink = 15,
Fwdlink = 16,
NoAccess = 17,
}Expand description
C’s dbStatic dbfType code — the DBF_* token a .dbd declares and
the number dbStaticLib stores, exports and prints (dbFldTypes.h:24-43
@R7.0.10).
A SECOND fact about a field, not a renumbering of DbFieldType:
that enum’s discriminants are the CA wire codes and are load-bearing
on the protocol, whereas these are dbStatic’s own indices, and the two
orders disagree from the second entry on (DBF_CHAR is 1 here and
DBR_SHORT is 1 there). Anything that prints C’s %d type number —
dba’s Field Type row, dbStatic’s dbDumpField — needs this one.
It also has six codes DbFieldType cannot express at all: a served
type is one of twelve scalars, while a declaration can additionally be
MENU, DEVICE, the three link kinds, or NOACCESS. That is why
super::super::server::record::FieldDesc::declared_dbf carries this
type rather than deriving it — the collapse is one-way.
Variants§
String = 0
DBF_STRING (0).
Char = 1
DBF_CHAR (1) — epicsInt8.
UChar = 2
DBF_UCHAR (2) — epicsUInt8.
Short = 3
DBF_SHORT (3).
UShort = 4
DBF_USHORT (4).
Long = 5
DBF_LONG (5).
ULong = 6
DBF_ULONG (6).
Int64 = 7
DBF_INT64 (7).
UInt64 = 8
DBF_UINT64 (8).
Float = 9
DBF_FLOAT (9).
Double = 10
DBF_DOUBLE (10).
Enum = 11
DBF_ENUM (11).
Menu = 12
DBF_MENU (12) — served as an enum, declared as a menu.
Device = 13
DBF_DEVICE (13) — the DTYP field, served as an enum.
Inlink = 14
DBF_INLINK (14).
Outlink = 15
DBF_OUTLINK (15).
Fwdlink = 16
DBF_FWDLINK (16).
NoAccess = 17
DBF_NOACCESS (17) — a C-internal with no dbStatic representation.
Implementations§
Source§impl DbfCode
impl DbfCode
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The token without its DBF_ prefix — C’s dbf[] (dbTest.c:76-81),
which is pamapdbfType’s strvalue (dbFldTypes.h:51-70) with that
prefix stripped. dba prints DBF_%s around it and dbStatic prints
the full name, so one table serves both.
Sourcepub const fn dbr_code(self) -> DbfCode
pub const fn dbr_code(self) -> DbfCode
C’s mapDBFToDBR (dbAccess.c:76-95) — the DBR code dbEntryToAddr
stores in paddr->dbr_field_type (:639), which is what a client
asking for this field’s native type is answered with.
DBR_* here is dbFldTypes.h:75-90’s numbering, where every
DBR_x is #defined to its DBF_x, so the map is a projection of
this enum onto itself and needs no second type: it collapses MENU
and DEVICE onto ENUM and the three link types onto STRING, and
is the identity on the other thirteen.
NOT the CA wire type. That numbering is the older, narrower
db_access.h one carried by DbFieldType’s own discriminants and
reached through DbFieldType::ca_wire_type; the two disagree on
every code above DBR_SHORT.
Trait Implementations§
impl Copy for DbfCode
impl Eq for DbfCode
Source§impl Ord for DbfCode
impl Ord for DbfCode
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for DbfCode
impl PartialOrd for DbfCode
impl StructuralPartialEq for DbfCode
Auto Trait Implementations§
impl Freeze for DbfCode
impl RefUnwindSafe for DbfCode
impl Send for DbfCode
impl Sync for DbfCode
impl Unpin for DbfCode
impl UnsafeUnpin for DbfCode
impl UnwindSafe for DbfCode
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.