1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
use raui_core::{
    layout::{CoordsMapping, Layout},
    renderer::Renderer,
    widget::unit::WidgetUnit,
};

#[derive(Debug, Default, Copy, Clone)]
pub struct BinaryRenderer;

impl Renderer<Vec<u8>, bincode::Error> for BinaryRenderer {
    fn render(
        &mut self,
        tree: &WidgetUnit,
        _: &CoordsMapping,
        _layout: &Layout,
    ) -> Result<Vec<u8>, bincode::Error> {
        bincode::serialize(tree)
    }
}