Struct libdonet::dclass::DClass

source ·
pub struct DClass<'dc> {
    dcfile: &'dc DCFile<'dc>,
    class_name: String,
    class_id: DClassId,
    is_bogus_class: bool,
    class_parents: Vec<&'dc DClass<'dc>>,
    constructor: Option<&'dc DCAtomicField<'dc>>,
    fields: Vec<&'dc ClassField<'dc>>,
    inherited_fields: Vec<&'dc ClassField<'dc>>,
    field_name_2_field: FieldName2Field<'dc>,
    field_id_2_field: FieldId2Field<'dc>,
}
Expand description

Represents a Distributed Class defined in the DC file. Contains a map of DC Fields, as well as atomic and molecular fields that are declared within the class. Also stores other properties such as its hierarchy.

Fields§

§dcfile: &'dc DCFile<'dc>§class_name: String§class_id: DClassId§is_bogus_class: bool§class_parents: Vec<&'dc DClass<'dc>>§constructor: Option<&'dc DCAtomicField<'dc>>§fields: Vec<&'dc ClassField<'dc>>§inherited_fields: Vec<&'dc ClassField<'dc>>§field_name_2_field: FieldName2Field<'dc>§field_id_2_field: FieldId2Field<'dc>

Implementations§

source§

impl<'dc> DClass<'dc>

source

pub fn get_field_by_name(&self, name: &str) -> Option<&'dc ClassField<'_>>

source

pub fn get_name(&self) -> String

source

pub fn get_dclass_id(&self) -> DClassId

source

pub fn get_num_parents(&self) -> usize

source

pub fn get_parent(&self, index: usize) -> Option<&'static DClass<'_>>

source

pub fn has_constructor(&self) -> bool

source

pub fn get_constructor(&self) -> Option<&'dc DCAtomicField<'_>>

Trait Implementations§

source§

impl<'dc> DCHash for DClass<'dc>

source§

fn generate_hash(&self, hashgen: &mut DCHashGenerator)

Accumulates the properties of this DC element into the file hash.
source§

impl<'dc> Debug for DClass<'dc>

source§

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

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

impl<'dc> Display for DClass<'dc>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'dc> Freeze for DClass<'dc>

§

impl<'dc> !RefUnwindSafe for DClass<'dc>

§

impl<'dc> !Send for DClass<'dc>

§

impl<'dc> !Sync for DClass<'dc>

§

impl<'dc> Unpin for DClass<'dc>

§

impl<'dc> !UnwindSafe for DClass<'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>,

§

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>,

§

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.