livesplit_core/settings/field.rs
1use super::Value;
2use crate::platform::prelude::*;
3use serde::{Deserialize, Serialize};
4
5/// A Field describes a single setting by its name and its current value.
6#[derive(Serialize, Deserialize)]
7pub struct Field {
8 /// The name of the setting.
9 pub text: String,
10 /// The current value of the setting.
11 pub value: Value,
12}
13
14impl Field {
15 /// Creates a new field.
16 pub const fn new(text: String, value: Value) -> Self {
17 Self { text, value }
18 }
19}