#[non_exhaustive]pub enum CommandOutput {
Message(String),
Silent,
Exit,
Continue,
}Expand description
Result of executing a slash command.
Replaces the heterogeneous return types of earlier command dispatch with a unified, exhaustive enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Message(String)
Send a message to the user via the channel.
Silent
Command handled silently; no output (e.g., /clear).
Exit
Exit the agent loop immediately.
Continue
Continue to the next loop iteration.
Implementations§
Source§impl CommandOutput
impl CommandOutput
Sourcepub fn message_or_silent(s: String) -> Self
pub fn message_or_silent(s: String) -> Self
Silent for an empty string, Message(s) otherwise.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandOutput
impl RefUnwindSafe for CommandOutput
impl Send for CommandOutput
impl Sync for CommandOutput
impl Unpin for CommandOutput
impl UnsafeUnpin for CommandOutput
impl UnwindSafe for CommandOutput
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