Skip to main content

rmk_config/resolved/
layout.rs

1/// Resolved physical layout: the compressed, opaque blob the firmware streams
2/// verbatim over `GetLayout`. Empty when there's no `[layout].map`.
3pub struct Layout {
4    pub blob: Vec<u8>,
5}
6
7impl crate::KeyboardTomlConfig {
8    /// Resolve the physical layout blob from the `[layout]` section.
9    pub fn layout(&self) -> Result<Layout, String> {
10        let blob = match &self.layout {
11            Some(l) => crate::layout::build_layout_blob(l, Some(self.total_encoders()))?,
12            None => Vec::new(),
13        };
14        Ok(Layout { blob })
15    }
16}