pub struct TaskHandlerEntry {
pub task_type: i16,
pub handler_fn: fn() -> Box<dyn TaskHandler>,
pub config_fn: fn() -> TaskConfig,
}Expand description
任务处理器注册条目 —— 编译期由 #[task_handler] 宏收集
与 linkme distributed_slice 配合使用,实现编译期自动发现。
Fields§
§task_type: i16任务类型标识
handler_fn: fn() -> Box<dyn TaskHandler>处理器构建函数(返回 Box
config_fn: fn() -> TaskConfig任务配置
Trait Implementations§
Source§impl Clone for TaskHandlerEntry
impl Clone for TaskHandlerEntry
Source§fn clone(&self) -> TaskHandlerEntry
fn clone(&self) -> TaskHandlerEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TaskHandlerEntry
impl RefUnwindSafe for TaskHandlerEntry
impl Send for TaskHandlerEntry
impl Sync for TaskHandlerEntry
impl Unpin for TaskHandlerEntry
impl UnsafeUnpin for TaskHandlerEntry
impl UnwindSafe for TaskHandlerEntry
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