Trait IKernel

Source
pub trait IKernel<W: IWindow, I: IUi<EventInput = W::EventType>, G: IGameLogic<EventInput = I::EventInputFiltered>, R: IRenderer<EventRender = G::EventRender>>:
    AsMut<W>
    + AsMut<I>
    + AsMut<G>
    + AsMut<R>{
    // Required method
    fn new() -> Result<Self, &'static str>
       where Self: Sized;

    // Provided methods
    fn new_with<F>(f: F) -> Result<Self, &'static str>
       where F: FnOnce() -> Result<Self, &'static str>,
             Self: Sized { ... }
    fn init_hook(&mut self) -> Result<(), &'static str> { ... }
    fn deinit_hook(&mut self) -> Result<(), &'static str> { ... }
    fn run(&mut self) -> Result<(), &'static str> { ... }
}

Required Methods§

Source

fn new() -> Result<Self, &'static str>
where Self: Sized,

Provided Methods§

Source

fn new_with<F>(f: F) -> Result<Self, &'static str>
where F: FnOnce() -> Result<Self, &'static str>, Self: Sized,

Source

fn init_hook(&mut self) -> Result<(), &'static str>

Source

fn deinit_hook(&mut self) -> Result<(), &'static str>

Source

fn run(&mut self) -> Result<(), &'static str>

default implementation of the main control flow

Implementors§

Source§

impl<GameLogic> IKernel<WinGlutin, XformInput, GameLogic, Renderer> for Kernel<GameLogic>
where GameLogic: IGameLogic<EventInput = <XformInput as IUi>::EventInputFiltered, EventRender = <Renderer as IRenderer>::EventRender>, <GameLogic as IGameLogic>::RenderObj: Into<Vec<<GameLogic as IGameLogic>::EventRender>>,

use default implementation for run method