pub trait LayoutCodec: 'static {
// Required methods
fn encode(&self, layout: &GridLayout) -> Result<String, LayoutError>;
fn decode(&self, text: &str) -> Result<GridLayout, LayoutError>;
}Expand description
Turns a layout into text and back. Called once per import or export.
The default is JsonLayoutCodec. Another codec can read a foreign
format, such as a LiveGrid or Syncfusion XML layout.
Required Methods§
Sourcefn encode(&self, layout: &GridLayout) -> Result<String, LayoutError>
fn encode(&self, layout: &GridLayout) -> Result<String, LayoutError>
Writes a layout.
Sourcefn decode(&self, text: &str) -> Result<GridLayout, LayoutError>
fn decode(&self, text: &str) -> Result<GridLayout, LayoutError>
Reads a layout. Also migrates older versions of its own format, and
refuses versions it does not read with
LayoutError::UnsupportedVersion.