29 lines
558 B
Rust
29 lines
558 B
Rust
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||
|
|
pub struct ToolManifestEntry {
|
||
|
|
pub name: String,
|
||
|
|
pub source: ToolSource,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||
|
|
pub enum ToolSource {
|
||
|
|
Base,
|
||
|
|
Conditional,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||
|
|
pub struct ToolRegistry {
|
||
|
|
entries: Vec<ToolManifestEntry>,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl ToolRegistry {
|
||
|
|
#[must_use]
|
||
|
|
pub fn new(entries: Vec<ToolManifestEntry>) -> Self {
|
||
|
|
Self { entries }
|
||
|
|
}
|
||
|
|
|
||
|
|
#[must_use]
|
||
|
|
pub fn entries(&self) -> &[ToolManifestEntry] {
|
||
|
|
&self.entries
|
||
|
|
}
|
||
|
|
}
|