pub struct TypeRegistry { /* private fields */ }Expand description
In-memory registry of known TypeObjects, indexed by
EquivalenceHash. Typically populated by TypeLookup replies.
Implementations§
Source§impl TypeRegistry
impl TypeRegistry
Sourcepub fn insert_minimal(&mut self, hash: EquivalenceHash, t: MinimalTypeObject)
pub fn insert_minimal(&mut self, hash: EquivalenceHash, t: MinimalTypeObject)
Inserts a minimal TypeObject, indexed by its hash.
Sourcepub fn insert_complete(&mut self, hash: EquivalenceHash, t: CompleteTypeObject)
pub fn insert_complete(&mut self, hash: EquivalenceHash, t: CompleteTypeObject)
Inserts a complete TypeObject.
Sourcepub fn get_minimal(&self, hash: &EquivalenceHash) -> Option<&MinimalTypeObject>
pub fn get_minimal(&self, hash: &EquivalenceHash) -> Option<&MinimalTypeObject>
Lookup.
Sourcepub fn get_complete(
&self,
hash: &EquivalenceHash,
) -> Option<&CompleteTypeObject>
pub fn get_complete( &self, hash: &EquivalenceHash, ) -> Option<&CompleteTypeObject>
Lookup.
Sourcepub fn iter_minimals(&self) -> Iter<'_, EquivalenceHash, MinimalTypeObject>
pub fn iter_minimals(&self) -> Iter<'_, EquivalenceHash, MinimalTypeObject>
Iterates over all minimal entries.
Sourcepub fn iter_completes(&self) -> Iter<'_, EquivalenceHash, CompleteTypeObject>
pub fn iter_completes(&self) -> Iter<'_, EquivalenceHash, CompleteTypeObject>
Iterates over all complete entries.
Sourcepub fn dependencies_of(&self, hash: &EquivalenceHash) -> Vec<EquivalenceHash>
pub fn dependencies_of(&self, hash: &EquivalenceHash) -> Vec<EquivalenceHash>
Returns all direct dependencies of a hash (transitively via
collect_referenced_hashes). If the type is not in the
registry, empty is returned.
Prefers the Minimal variant, falls back to Complete.
Sourcepub fn transitive_dependencies(
&self,
hash: &EquivalenceHash,
max_nodes: usize,
) -> Vec<EquivalenceHash>
pub fn transitive_dependencies( &self, hash: &EquivalenceHash, max_nodes: usize, ) -> Vec<EquivalenceHash>
Collects transitively all dependent hashes — follows each
found hash recursively through the registry. The incoming hash
itself is NOT included. Bounded by max_nodes.
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 (const: unstable) · 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 UnsafeUnpin 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