pub struct DCField<'dc> {
keyword_list: DCKeywordList<'dc>,
parent_element: FieldParent<'dc>,
field_name: String,
field_id: FieldId,
field_type: Option<DCTypeDefinition>,
default_value_stale: bool,
has_default_value: bool,
default_value: Vec<u8>,
bogus_field: bool,
}
Expand description
A field of a Distributed Class. The DCField struct is a base for struct and dclass fields. In the DC language, there are three types of field declarations, which are: plain fields, atomic, and molecular.
Fields§
§keyword_list: DCKeywordList<'dc>
§parent_element: FieldParent<'dc>
§field_name: String
§field_id: FieldId
§field_type: Option<DCTypeDefinition>
§default_value_stale: bool
§has_default_value: bool
§default_value: Vec<u8>
§bogus_field: bool
Implementations§
source§impl<'dc> DCField<'dc>
impl<'dc> DCField<'dc>
pub fn get_field_id(&self) -> FieldId
pub fn get_field_name(&self) -> String
sourcepub fn get_dclass(&self) -> &'dc DClass<'_>
pub fn get_dclass(&self) -> &'dc DClass<'_>
Gets the parent DClass element reference.
Panics if this field’s parent element is not a DClass.
pub fn set_field_id(&mut self, id: FieldId)
pub fn set_field_name(&mut self, name: String)
pub fn set_field_type(&mut self, dtype: DCTypeDefinition)
pub fn set_field_keyword_list(&mut self, kw_list: DCKeywordList<'dc>)
pub fn set_default_value(&mut self, value: Vec<u8>)
pub fn set_bogus_field(&mut self, is_bogus: bool)
pub fn has_default_value(&self) -> bool
pub fn validate_ranges(&self, _packed_data: &Datagram) -> bool
sourcepub fn format_packed_data(
&self,
f: &mut Formatter<'_>,
_data: &[u8],
_show_field_names: bool,
) -> Result
pub fn format_packed_data( &self, f: &mut Formatter<'_>, _data: &[u8], _show_field_names: bool, ) -> Result
Given a blob that represents the packed data for this field, returns a string formatting it for human consumption.
pub fn is_bogus_field(&self) -> bool
pub fn is_required(&self) -> bool
pub fn is_broadcast(&self) -> bool
pub fn is_ram(&self) -> bool
pub fn is_db(&self) -> bool
pub fn is_clsend(&self) -> bool
pub fn is_clrecv(&self) -> bool
pub fn is_ownsend(&self) -> bool
pub fn is_ownrecv(&self) -> bool
pub fn is_airecv(&self) -> bool
fn _refresh_default_value(&self)
Trait Implementations§
source§impl<'dc> DCFileConfigAccessor for DCField<'dc>
impl<'dc> DCFileConfigAccessor for DCField<'dc>
fn get_dc_config(&self) -> &DCFileConfig
source§impl<'dc> LegacyDCHash for DCField<'dc>
impl<'dc> LegacyDCHash for DCField<'dc>
source§fn generate_hash(&self, hashgen: &mut DCHashGenerator)
fn generate_hash(&self, hashgen: &mut DCHashGenerator)
Accumulates the properties of this DC element into the file hash.
Auto Trait Implementations§
impl<'dc> Freeze for DCField<'dc>
impl<'dc> RefUnwindSafe for DCField<'dc>
impl<'dc> Send for DCField<'dc>
impl<'dc> Sync for DCField<'dc>
impl<'dc> Unpin for DCField<'dc>
impl<'dc> UnwindSafe for DCField<'dc>
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
Mutably borrows from an owned value. Read more