pub struct CommandRegistry { /* private fields */ }Expand description
Zentrale Registry für alle Commands - HOCHPERFORMANT & ROBUST
Implementations§
Source§impl CommandRegistry
impl CommandRegistry
Sourcepub fn register<T: Command>(&mut self, command: T) -> &mut Self
pub fn register<T: Command>(&mut self, command: T) -> &mut Self
Command registrieren - CHAIN-ABLE
Sourcepub fn register_boxed(&mut self, command: Box<dyn Command>) -> &mut Self
pub fn register_boxed(&mut self, command: Box<dyn Command>) -> &mut Self
Registriert einen Boxed Command (für Plugins)
Sourcepub fn initialize(&mut self) -> &mut Self
pub fn initialize(&mut self) -> &mut Self
Registry finalisieren - sortiert nach Priorität
Sourcepub fn find_command(&self, input: &str) -> Option<&dyn Command>
pub fn find_command(&self, input: &str) -> Option<&dyn Command>
Findet Command basierend auf Input
Sourcepub fn execute_sync(
&self,
command: &str,
args: &[&str],
) -> Option<Result<String>>
pub fn execute_sync( &self, command: &str, args: &[&str], ) -> Option<Result<String>>
Führt Command synchron aus
Sourcepub async fn execute_async(
&self,
command: &str,
args: &[&str],
) -> Option<Result<String>>
pub async fn execute_async( &self, command: &str, args: &[&str], ) -> Option<Result<String>>
Führt Command asynchron aus
Sourcepub fn list_commands(&self) -> Vec<(&str, &str)>
pub fn list_commands(&self) -> Vec<(&str, &str)>
Listet alle verfügbaren Commands auf
Sourcepub fn debug_info(&self) -> String
pub fn debug_info(&self) -> String
Debug-Informationen
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandRegistry
impl !RefUnwindSafe for CommandRegistry
impl Send for CommandRegistry
impl Sync for CommandRegistry
impl Unpin for CommandRegistry
impl !UnwindSafe for CommandRegistry
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more