Skip to main content

parse_layout

Function parse_layout 

Source
pub fn parse_layout(json: &str) -> Result<ScreenLayout, RenderError>
Expand description

Parse a layout from a JSON string.

This is the primary entry point for testing and for programmatic layout creation. After deserialisation the layout is validated for common issues (zero-sized elements, unknown types, etc.).

ยงErrors

Returns RenderError::InvalidLayout if the JSON cannot be parsed into a valid ScreenLayout.