tmux_interface/variables/layout/
layout.rs1use crate::Error;
2use crate::LayoutCell;
3use std::str::FromStr;
4
5#[derive(Default, PartialEq, Clone, Debug)]
6pub struct Layout {
7 pub checksum: usize, pub cell: LayoutCell,
9}
10
11impl FromStr for Layout {
14 type Err = Error;
15
16 fn from_str(s: &str) -> Result<Layout, Error> {
17 let mut layout = Layout::new();
18 let ls: Vec<&str> = s.split(',').collect();
19 layout.checksum = usize::from_str_radix(ls[0], 16)?;
20 layout.cell = ls[1].parse()?;
21 Ok(layout)
22 }
23}
24
25impl Layout {
26 pub fn new() -> Self {
27 Default::default()
28 }
29}