Struct donet_core::dcfile::DCFile

source ·
pub struct DCFile<'dc> {
    config: DCFileConfig,
    baked_legacy_hash: DCFileHash,
    structs: Vec<DCStruct<'dc>>,
    dclasses: Vec<DClass<'dc>>,
    imports: Vec<DCPythonImport>,
    keywords: Vec<DCKeyword>,
    type_defs: Vec<DCTypeDefinition>,
    field_id_2_field: Vec<&'dc DCField<'dc>>,
    all_object_valid: bool,
    inherited_fields_stale: bool,
}
Expand description

Data model that provides a high level representation of a single, or collection, of DC files and their elements such as class imports, type definitions, structures, and Distributed Classes.

Fields§

§config: DCFileConfig§baked_legacy_hash: DCFileHash§structs: Vec<DCStruct<'dc>>§dclasses: Vec<DClass<'dc>>§imports: Vec<DCPythonImport>§keywords: Vec<DCKeyword>§type_defs: Vec<DCTypeDefinition>§field_id_2_field: Vec<&'dc DCField<'dc>>§all_object_valid: bool§inherited_fields_stale: bool

Implementations§

source§

impl<'dc> DCFile<'dc>

source

pub fn get_legacy_hash(&self) -> DCFileHash

Returns a 32-bit hash index associated with this file. This number is guaranteed to be consistent if the contents of the file have not changed, and it is very likely to be different if the contents of the file do change.

If called more than once, it will reuse the already calculated hash, as this structure is guaranteed to be immutable after initialization.

source

pub fn get_pretty_hash(&self) -> String

Returns a string with the hash as a pretty format hexadecimal.

source

pub fn get_num_imports(&self) -> usize

source

pub fn get_python_import(&self, index: usize) -> &DCPythonImport

source

pub fn get_num_keywords(&self) -> usize

source

pub fn get_keyword(&self, _index: usize) -> &'dc DCKeyword

source

pub fn has_keyword(&self, _keyword: String) -> bool

source

pub fn get_num_dclasses(&self) -> usize

source

pub fn get_dclass(&self, _index: usize) -> &'dc DClass<'_>

source

pub fn get_dclass_by_id(&self, id: DClassId) -> &'dc DClass<'_>

source

pub fn get_dclass_by_name(&self, _name: &str) -> &'dc DClass<'_>

source

pub fn get_num_structs(&self) -> usize

source

pub fn get_struct(&self, _index: usize) -> &'dc DCStruct<'_>

Trait Implementations§

source§

impl<'dc> Clone for DCFile<'dc>

source§

fn clone(&self) -> DCFile<'dc>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'dc> DCFileConfigAccessor for DCFile<'dc>

source§

impl<'dc> Debug for DCFile<'dc>

source§

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

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

impl<'dc> Display for DCFile<'dc>

source§

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

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

impl<'dc> From<DCFile> for DCFile<'dc>

source§

fn from(value: DCFile) -> Self

Converts to this type from the input type.
source§

impl<'dc> LegacyDCHash for DCFile<'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 DCFile<'dc>

§

impl<'dc> RefUnwindSafe for DCFile<'dc>

§

impl<'dc> Send for DCFile<'dc>

§

impl<'dc> Sync for DCFile<'dc>

§

impl<'dc> Unpin for DCFile<'dc>

§

impl<'dc> UnwindSafe for DCFile<'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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.