pub struct CustomCommandLoader { /* private fields */ }Expand description
Loads and manages custom commands from command directories.
Implementations§
Source§impl CustomCommandLoader
impl CustomCommandLoader
Sourcepub fn new(working_dir: &Path) -> Self
pub fn new(working_dir: &Path) -> Self
Create a new loader rooted at the given working directory.
Sourcepub fn load_commands(&mut self) -> &HashMap<String, CustomCommand>
pub fn load_commands(&mut self) -> &HashMap<String, CustomCommand>
Load all custom commands from command directories.
Scans .opendev/commands/ under the project directory (higher priority)
and then the global directory. Results are cached.
Sourcepub fn get_command(&mut self, name: &str) -> Option<&CustomCommand>
pub fn get_command(&mut self, name: &str) -> Option<&CustomCommand>
Get a custom command by name.
Sourcepub fn list_commands(&mut self) -> Vec<CommandInfo>
pub fn list_commands(&mut self) -> Vec<CommandInfo>
List all available custom commands.
Auto Trait Implementations§
impl Freeze for CustomCommandLoader
impl RefUnwindSafe for CustomCommandLoader
impl Send for CustomCommandLoader
impl Sync for CustomCommandLoader
impl Unpin for CustomCommandLoader
impl UnsafeUnpin for CustomCommandLoader
impl UnwindSafe for CustomCommandLoader
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