1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
use super::Value;

/// A Field describes a single setting by its name and its current value.
#[derive(Serialize, Deserialize)]
pub struct Field {
    /// The name of the setting.
    pub text: String,
    /// The current value of the setting.
    pub value: Value,
}

impl Field {
    /// Creates a new field.
    pub fn new(text: String, value: Value) -> Self {
        Self { text, value }
    }
}