pub struct CliBot { /* private fields */ }Expand description
A bot whose “platform” is the CLI wire protocol.
Build it like any other adapter, take the CliHub handle if you need
to drive it out-of-band (acpbot-style platform senders, tests), then
run().
Implementations§
Source§impl CliBot
impl CliBot
Sourcepub fn hub(&self) -> CliHub
pub fn hub(&self) -> CliHub
The shared hub handle: inject events, subscribe to outbound lines, or build platform senders on it.
Sourcepub fn command<H, Args>(self, name: impl Into<String>, handler: H) -> Selfwhere
H: IntoHandler<Args>,
pub fn command<H, Args>(self, name: impl Into<String>, handler: H) -> Selfwhere
H: IntoHandler<Args>,
Register a command handler.
Sourcepub fn command_with_description<H, Args>(
self,
name: impl Into<String>,
description: impl Into<String>,
handler: H,
) -> Selfwhere
H: IntoHandler<Args>,
pub fn command_with_description<H, Args>(
self,
name: impl Into<String>,
description: impl Into<String>,
handler: H,
) -> Selfwhere
H: IntoHandler<Args>,
Register a command handler with a menu description.
Register a button handler (* suffix matches by prefix).
Sourcepub fn message<H, Args>(self, handler: H) -> Selfwhere
H: IntoHandler<Args>,
pub fn message<H, Args>(self, handler: H) -> Selfwhere
H: IntoHandler<Args>,
Register the catch-all message handler.
Sourcepub fn fallback<H, Args>(self, handler: H) -> Selfwhere
H: IntoHandler<Args>,
pub fn fallback<H, Args>(self, handler: H) -> Selfwhere
H: IntoHandler<Args>,
Register the handler for events no route claims.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CliBot
impl !Unpin for CliBot
impl !UnsafeUnpin for CliBot
impl !UnwindSafe for CliBot
impl Freeze for CliBot
impl Send for CliBot
impl Sync for CliBot
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