pub struct Record<'a> { /* private fields */ }Expand description
An immutable reference to a TableGen record.
This reference cannot outlive the RecordKeeper from which it is
borrowed.
Implementations§
source§impl<'a> Record<'a>
impl<'a> Record<'a>
sourcepub unsafe fn from_raw(ptr: TableGenRecordRef) -> Record<'a>
pub unsafe fn from_raw(ptr: TableGenRecordRef) -> Record<'a>
sourcepub fn bit_value(self, name: &str) -> Option<bool>
pub fn bit_value(self, name: &str) -> Option<bool>
Returns the boolean value of the field with the given name if this
field is of type BitInit.
sourcepub fn int_value(self, name: &str) -> Option<i64>
pub fn int_value(self, name: &str) -> Option<i64>
Returns the integer value of the field with the given name if this
field is of type IntInit.
sourcepub fn code_value(self, name: &str) -> Option<String>
pub fn code_value(self, name: &str) -> Option<String>
Returns the field with the given name converted to a String
if this field is of type StringInit.
Note that this copies the string into a new string.
sourcepub fn code_str_value(self, name: &str) -> Option<&str>
pub fn code_str_value(self, name: &str) -> Option<&str>
Returns the field with the given name converted to a &str
if this field is of type StringInit.
sourcepub fn string_value(self, name: &str) -> Option<String>
pub fn string_value(self, name: &str) -> Option<String>
Returns the field with the given name converted to a String
if this field is of type StringInit.
Note that this copies the string into a new string.
sourcepub fn str_value(self, name: &str) -> Option<&str>
pub fn str_value(self, name: &str) -> Option<&str>
Returns the field with the given name converted to a &str
if this field is of type StringInit.
sourcepub fn list_value(self, name: &str) -> Option<ListInit<'_>>
pub fn list_value(self, name: &str) -> Option<ListInit<'_>>
sourcepub fn value(self, name: &str) -> Option<RecordValue<'_>>
pub fn value(self, name: &str) -> Option<RecordValue<'_>>
Returns a RecordValue for the field with the given name.
sourcepub fn subclass_of(self, class: &str) -> bool
pub fn subclass_of(self, class: &str) -> bool
Returns true if the record is a subclass of the class with the given name.
sourcepub fn values(self) -> RecordValueIter<'a> ⓘ
pub fn values(self) -> RecordValueIter<'a> ⓘ
Returns an iterator over the fields of the record.
The iterator yields RecordValue structs