pub struct PackageRegistry { /* private fields */ }Expand description
Registry that manages loading and resolving packages
Implementations§
Source§impl PackageRegistry
impl PackageRegistry
Sourcepub fn add_search_path(&mut self, path: PathBuf)
pub fn add_search_path(&mut self, path: PathBuf)
Add a search path for packages
Sourcepub fn load_package(
&mut self,
name: &str,
) -> Result<&SchemaPackage, PackageError>
pub fn load_package( &mut self, name: &str, ) -> Result<&SchemaPackage, PackageError>
Load a package by name
Searches in all registered search paths for a directory matching the package name. Version requirements are not yet enforced (milestone 1).
Sourcepub fn resolve_all(
&mut self,
root_package: &str,
) -> Result<Vec<String>, PackageError>
pub fn resolve_all( &mut self, root_package: &str, ) -> Result<Vec<String>, PackageError>
Resolve all dependencies for a root package recursively
Returns packages in deterministic topological order (dependencies first)
Sourcepub fn get_package(&self, name: &str) -> Option<&SchemaPackage>
pub fn get_package(&self, name: &str) -> Option<&SchemaPackage>
Get a loaded package by name
Sourcepub fn build_type_environment(
&self,
package_names: &[String],
) -> Result<TypeEnvironment, PackageError>
pub fn build_type_environment( &self, package_names: &[String], ) -> Result<TypeEnvironment, PackageError>
Build a merged type environment from resolved packages
Returns a map of qualified type names (package.Type) to TypeDef
Trait Implementations§
Source§impl Clone for PackageRegistry
impl Clone for PackageRegistry
Source§fn clone(&self) -> PackageRegistry
fn clone(&self) -> PackageRegistry
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 PackageRegistry
impl Debug for PackageRegistry
Auto Trait Implementations§
impl Freeze for PackageRegistry
impl RefUnwindSafe for PackageRegistry
impl Send for PackageRegistry
impl Sync for PackageRegistry
impl Unpin for PackageRegistry
impl UnwindSafe for PackageRegistry
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