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>
impl<'dc> DCFile<'dc>
sourcepub fn get_legacy_hash(&self) -> DCFileHash
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.
sourcepub fn get_pretty_hash(&self) -> String
pub fn get_pretty_hash(&self) -> String
Returns a string with the hash as a pretty format hexadecimal.
pub fn get_num_imports(&self) -> usize
pub fn get_python_import(&self, index: usize) -> &DCPythonImport
pub fn get_num_keywords(&self) -> usize
pub fn get_keyword(&self, _index: usize) -> &'dc DCKeyword
pub fn has_keyword(&self, _keyword: String) -> bool
pub fn get_num_dclasses(&self) -> usize
pub fn get_dclass(&self, _index: usize) -> &'dc DClass<'_>
pub fn get_dclass_by_id(&self, id: DClassId) -> &'dc DClass<'_>
pub fn get_dclass_by_name(&self, _name: &str) -> &'dc DClass<'_>
pub fn get_num_structs(&self) -> usize
pub fn get_struct(&self, _index: usize) -> &'dc DCStruct<'_>
Trait Implementations§
source§impl<'dc> DCFileConfigAccessor for DCFile<'dc>
impl<'dc> DCFileConfigAccessor for DCFile<'dc>
fn get_dc_config(&self) -> &DCFileConfig
source§impl<'dc> LegacyDCHash for DCFile<'dc>
impl<'dc> LegacyDCHash for DCFile<'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 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> 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)