Skip to main content

pcu/parsers/
mod.rs

1pub mod conda;
2pub mod lockfiles;
3pub mod pyproject;
4pub mod requirements;
5
6pub use conda::CondaParser;
7pub use lockfiles::LockfileParser;
8pub use pyproject::PyProjectParser;
9pub use requirements::RequirementsParser;
10
11// Re-export Dependency from core for use by parsers
12pub use check_updates_core::Dependency;
13
14use std::path::Path;
15
16/// Trait for dependency file parsers
17pub trait DependencyParser {
18    /// Parse a file and return all dependencies found
19    fn parse(&self, path: &Path) -> anyhow::Result<Vec<Dependency>>;
20
21    /// Check if this parser can handle the given file
22    fn can_parse(&self, path: &Path) -> bool;
23}