pub struct CommandBuilder { /* private fields */ }Expand description
用于链式构建和注册指令的构建器。
Implementations§
Source§impl CommandBuilder
impl CommandBuilder
Sourcepub fn new(
name: String,
filter: ContextFilter,
registry: Arc<RwLock<CommandRegistry>>,
) -> Self
pub fn new( name: String, filter: ContextFilter, registry: Arc<RwLock<CommandRegistry>>, ) -> Self
创建一个新的 CommandBuilder。
通常由 Context::command() 调用。
Sourcepub fn description(self, description: &str) -> Self
pub fn description(self, description: &str) -> Self
为指令设置描述。
Sourcepub fn register(self) -> FrameworkResult<()>
pub fn register(self) -> FrameworkResult<()>
构建并注册指令。
Auto Trait Implementations§
impl !RefUnwindSafe for CommandBuilder
impl !UnwindSafe for CommandBuilder
impl Freeze for CommandBuilder
impl Send for CommandBuilder
impl Sync for CommandBuilder
impl Unpin for CommandBuilder
impl UnsafeUnpin for CommandBuilder
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