pub struct Status {
pub snake: Rc<RefCell<Snake>>,
pub food: (usize, usize),
pub speed_defer: f32,
pub snake_last_len: usize,
pub win: bool,
pub lose: bool,
}Fields§
§snake: Rc<RefCell<Snake>>§food: (usize, usize)§speed_defer: f32§snake_last_len: usize§win: bool§lose: boolTrait Implementations§
Source§impl Widget<Status> for Frame
impl Widget<Status> for Frame
Source§fn event(
&mut self,
ctx: &mut EventCtx<'_, '_>,
event: &Event,
data: &mut Status,
_env: &Env,
)
fn event( &mut self, ctx: &mut EventCtx<'_, '_>, event: &Event, data: &mut Status, _env: &Env, )
need this function for handling the arrow keys.
Source§fn lifecycle(
&mut self,
_ctx: &mut LifeCycleCtx<'_, '_>,
_event: &LifeCycle,
_data: &Status,
_env: &Env,
)
fn lifecycle( &mut self, _ctx: &mut LifeCycleCtx<'_, '_>, _event: &LifeCycle, _data: &Status, _env: &Env, )
Handle a life cycle notification. Read more
Source§fn update(
&mut self,
_ctx: &mut UpdateCtx<'_, '_>,
_old_data: &Status,
_data: &Status,
_env: &Env,
)
fn update( &mut self, _ctx: &mut UpdateCtx<'_, '_>, _old_data: &Status, _data: &Status, _env: &Env, )
Auto Trait Implementations§
impl Freeze for Status
impl !RefUnwindSafe for Status
impl !Send for Status
impl !Sync for Status
impl Unpin for Status
impl !UnwindSafe for Status
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