30 lines
604 B
Rust
30 lines
604 B
Rust
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||
|
|
pub struct CommandManifestEntry {
|
||
|
|
pub name: String,
|
||
|
|
pub source: CommandSource,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||
|
|
pub enum CommandSource {
|
||
|
|
Builtin,
|
||
|
|
InternalOnly,
|
||
|
|
FeatureGated,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||
|
|
pub struct CommandRegistry {
|
||
|
|
entries: Vec<CommandManifestEntry>,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl CommandRegistry {
|
||
|
|
#[must_use]
|
||
|
|
pub fn new(entries: Vec<CommandManifestEntry>) -> Self {
|
||
|
|
Self { entries }
|
||
|
|
}
|
||
|
|
|
||
|
|
#[must_use]
|
||
|
|
pub fn entries(&self) -> &[CommandManifestEntry] {
|
||
|
|
&self.entries
|
||
|
|
}
|
||
|
|
}
|