feat(proto): ConfigView wire type
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Effective (resolved) daemon configuration sent to clients.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ConfigView {
|
||||
pub default_shell: String,
|
||||
pub font_family: String,
|
||||
pub font_size: u16,
|
||||
pub theme: String,
|
||||
pub accent: String,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
#[test]
|
||||
fn config_view_round_trips() {
|
||||
let c = ConfigView {
|
||||
default_shell: "/bin/zsh".into(), font_family: "JetBrains Mono".into(),
|
||||
font_size: 13, theme: "dark".into(), accent: "blue".into(),
|
||||
};
|
||||
let back: ConfigView = serde_json::from_str(&serde_json::to_string(&c).unwrap()).unwrap();
|
||||
assert_eq!(back, c);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
pub mod codec;
|
||||
pub mod config_view;
|
||||
pub mod event;
|
||||
pub mod ids;
|
||||
pub mod layout;
|
||||
@@ -6,6 +7,7 @@ pub mod message;
|
||||
pub mod status;
|
||||
pub mod workspace;
|
||||
|
||||
pub use config_view::ConfigView;
|
||||
pub use event::{EventKind, EventRecord, MarkReadTarget};
|
||||
pub use ids::{GroupId, SurfaceId, WorkspaceId};
|
||||
pub use layout::{LayoutNode, Orient};
|
||||
|
||||
Reference in New Issue
Block a user