pub struct TypeRegistry { /* private fields */ }Expand description
Type registry for managing SerializedTypes
Provides efficient lookup and management of type information within a SerializedFile.
Implementations§
Source§impl TypeRegistry
impl TypeRegistry
Sourcepub fn add_type(&mut self, serialized_type: SerializedType)
pub fn add_type(&mut self, serialized_type: SerializedType)
Add a type to the registry
Sourcepub fn get_type(&self, class_id: i32) -> Option<&SerializedType>
pub fn get_type(&self, class_id: i32) -> Option<&SerializedType>
Get a type by class ID
Sourcepub fn get_script_type(&self, script_index: i16) -> Option<&SerializedType>
pub fn get_script_type(&self, script_index: i16) -> Option<&SerializedType>
Get a script type by index
Sourcepub fn script_indices(&self) -> Vec<i16>
pub fn script_indices(&self) -> Vec<i16>
Get all script type indices
Sourcepub fn has_script_type(&self, script_index: i16) -> bool
pub fn has_script_type(&self, script_index: i16) -> bool
Check if a script index is registered
Sourcepub fn find_types<F>(&self, predicate: F) -> Vec<&SerializedType>
pub fn find_types<F>(&self, predicate: F) -> Vec<&SerializedType>
Get types by predicate
Sourcepub fn script_types(&self) -> Vec<&SerializedType>
pub fn script_types(&self) -> Vec<&SerializedType>
Get all script types
Sourcepub fn non_script_types(&self) -> Vec<&SerializedType>
pub fn non_script_types(&self) -> Vec<&SerializedType>
Get all non-script types
Trait Implementations§
Source§impl Clone for TypeRegistry
impl Clone for TypeRegistry
Source§fn clone(&self) -> TypeRegistry
fn clone(&self) -> TypeRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeRegistry
impl Debug for TypeRegistry
Source§impl Default for TypeRegistry
impl Default for TypeRegistry
Source§fn default() -> TypeRegistry
fn default() -> TypeRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeRegistry
impl RefUnwindSafe for TypeRegistry
impl Send for TypeRegistry
impl Sync for TypeRegistry
impl Unpin for TypeRegistry
impl UnwindSafe for TypeRegistry
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