q
Size: a a a
q
ВМ
q
ВМ
pub fn start_window<W: WindowHandler>() {
let mut win = W::new();
...
event_loop.run(move |event, _, control_flow| {
q
ВМ
ВМ
pub trait WindowHandler {
const
TITLE: &
'static str;
fn
new() -> Self;
fn update(&mut self);
fn render(&mut self);
}
q
IB
q
q
ВМ
ВМ
q
fn new<W: WindowHandler<'_>>() -> W {
unsafe{transmute{&*STATIC}}
}
q
q
q
q
q