livesplit_core/layout/
layout_settings.rs1use super::{ComponentSettings, GeneralSettings};
2use crate::platform::prelude::*;
3use serde::{Deserialize, Serialize};
4
5#[derive(Clone, Serialize, Deserialize)]
8pub struct LayoutSettings {
9 pub components: Vec<ComponentSettings>,
11 pub general: GeneralSettings,
13}
14
15#[cfg(feature = "std")]
16impl LayoutSettings {
17 pub fn from_json<R>(reader: R) -> serde_json::Result<LayoutSettings>
19 where
20 R: std::io::Read,
21 {
22 serde_json::from_reader(reader)
23 }
24
25 pub fn write_json<W>(&self, writer: W) -> serde_json::Result<()>
27 where
28 W: std::io::Write,
29 {
30 serde_json::to_writer(writer, self)
31 }
32}