pub enum PackageMode {
Relative,
Package {
dependencies: HashMap<String, PackageDependency>,
analyzer: DependencyAnalyzer,
},
LocalDevelopment {
local_paths: HashMap<String, PathBuf>,
},
}Expand description
Determines how imports are generated in the output
Variants§
Relative
Generate relative file imports (default for local development)
Package
Generate package imports for nickel-mine
Fields
§
dependencies: HashMap<String, PackageDependency>Map of external package dependencies discovered through analysis
§
analyzer: DependencyAnalyzerDependency analyzer for automatic detection
LocalDevelopment
Local development mode with local package paths
Implementations§
Source§impl PackageMode
impl PackageMode
Sourcepub fn new_with_analyzer(manifest_path: Option<&PathBuf>) -> Self
pub fn new_with_analyzer(manifest_path: Option<&PathBuf>) -> Self
Create a new package mode with automatic dependency detection
Sourcepub fn analyze_and_update_dependencies(
&mut self,
types: &[Type],
current_package: &str,
)
pub fn analyze_and_update_dependencies( &mut self, types: &[Type], current_package: &str, )
Analyze types to detect dependencies automatically
Sourcepub fn convert_import(&self, import_path: &str) -> String
pub fn convert_import(&self, import_path: &str) -> String
Convert an import path based on the package mode
Sourcepub fn generate_imports(
&self,
types: &[Type],
current_package: &str,
) -> Vec<String>
pub fn generate_imports( &self, types: &[Type], current_package: &str, ) -> Vec<String>
Generate import statements for detected dependencies
Sourcepub fn add_to_manifest(&self, content: &str, _package_name: &str) -> String
pub fn add_to_manifest(&self, content: &str, _package_name: &str) -> String
Add Nickel package manifest fields based on detected dependencies
Sourcepub fn get_dependencies(&self) -> Option<&HashMap<String, PackageDependency>>
pub fn get_dependencies(&self) -> Option<&HashMap<String, PackageDependency>>
Get the dependency map (for testing and debugging)
Trait Implementations§
Source§impl Clone for PackageMode
impl Clone for PackageMode
Source§fn clone(&self) -> PackageMode
fn clone(&self) -> PackageMode
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 PackageMode
impl Debug for PackageMode
Source§impl Default for PackageMode
impl Default for PackageMode
Source§fn default() -> PackageMode
fn default() -> PackageMode
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PackageMode
impl RefUnwindSafe for PackageMode
impl Send for PackageMode
impl Sync for PackageMode
impl Unpin for PackageMode
impl UnwindSafe for PackageMode
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