summaryrefslogtreecommitdiff
path: root/WebInterface/wasm/webhogg/src/app.rs
blob: 7931418ecd4431dc356b66bf73eb3547dce19945 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::webhogg_exception::WebhoggException;
use crate::page::Page;
use crate::canvas::Canvas;

pub(crate) struct WebhoggApplication {
    page: Page,
    canvas: Canvas,
}

impl WebhoggApplication {
    pub fn new() -> Result<Self, WebhoggException> {
        let page = Page::obtain()?;
        let canvas = Canvas::from_existing("canvas", &page)?;
        Ok(Self {
            page, canvas,
        })
    }

    pub fn run(self) -> Result<(), WebhoggException> {
        Ok(())
    }
}