1 use std::cell::Cell; 2 3 pub trait Enter { 4 /// 调用键盘输入回调 emit_enter(&self, char: char, redraw: &Cell<bool>)5 fn emit_enter(&self, char: char, redraw: &Cell<bool>); 6 /// 设置回调函数 set_enter_callback<T: Fn(&Self, char, &Cell<bool>) + 'static>(&self, func: T)7 fn set_enter_callback<T: Fn(&Self, char, &Cell<bool>) + 'static>(&self, func: T); 8 } 9