Struct donet_core::dcfield::DCField

source ·
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>

source

pub fn get_field_id(&self) -> FieldId

source

pub fn get_field_name(&self) -> String

source

pub fn get_dclass(&self) -> &'dc DClass<'_>

Gets the parent DClass element reference.

Panics if this field’s parent element is not a DClass.

source

pub fn set_field_id(&mut self, id: FieldId)

source

pub fn set_field_name(&mut self, name: String)

source

pub fn set_field_type(&mut self, dtype: DCTypeDefinition)

source

pub fn set_field_keyword_list(&mut self, kw_list: DCKeywordList<'dc>)

source

pub fn set_default_value(&mut self, value: Vec<u8>)

source

pub fn set_bogus_field(&mut self, is_bogus: bool)

source

pub fn has_default_value(&self) -> bool

source

pub fn validate_ranges(&self, _packed_data: &Datagram) -> bool

source

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.

source

pub fn is_bogus_field(&self) -> bool

source

pub fn is_required(&self) -> bool

source

pub fn is_broadcast(&self) -> bool

source

pub fn is_ram(&self) -> bool

source

pub fn is_db(&self) -> bool

source

pub fn is_clsend(&self) -> bool

source

pub fn is_clrecv(&self) -> bool

source

pub fn is_ownsend(&self) -> bool

source

pub fn is_ownrecv(&self) -> bool

source

pub fn is_airecv(&self) -> bool

source

fn _refresh_default_value(&self)

Trait Implementations§

source§

impl<'dc> DCFileConfigAccessor for DCField<'dc>

source§

impl<'dc> Debug for DCField<'dc>

source§

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

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

impl<'dc> Display for DCField<'dc>

source§

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

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

impl<'dc> LegacyDCHash for DCField<'dc>

source§

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> 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.