pub struct CommandEntry<K, C, R, O, E> { /* private fields */ }Expand description
One command in a static dispatch table.
The entry stores only its key and an erased function pointer. It owns no context or resources and requires no heap allocation.
Implementations§
Source§impl<K, C, R, O, E> CommandEntry<K, C, R, O, E>
impl<K, C, R, O, E> CommandEntry<K, C, R, O, E>
Sourcepub const fn new(key: K, handler: CommandHandler<C, R, O, E>) -> Self
pub const fn new(key: K, handler: CommandHandler<C, R, O, E>) -> Self
Creates an entry from a key and already-erased handler function.
Applications normally use crate::command! to generate handler.
Auto Trait Implementations§
impl<K, C, R, O, E> Freeze for CommandEntry<K, C, R, O, E>
impl<K, C, R, O, E> RefUnwindSafe for CommandEntry<K, C, R, O, E>
impl<K, C, R, O, E> Send for CommandEntry<K, C, R, O, E>
impl<K, C, R, O, E> Sync for CommandEntry<K, C, R, O, E>
impl<K, C, R, O, E> Unpin for CommandEntry<K, C, R, O, E>
impl<K, C, R, O, E> UnsafeUnpin for CommandEntry<K, C, R, O, E>
impl<K, C, R, O, E> UnwindSafe for CommandEntry<K, C, R, O, E>
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