Skip to content

Commit

Permalink
Factor payload types into separate modules
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Mar 18, 2024
1 parent f1d0337 commit bfcb9a9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
use std::{collections::HashMap, fmt};

use serde::{Serialize, Deserialize};

use crate::{Frame, InputEvent};

/// The payload of a model message.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
#[serde(untagged)]
pub enum Model {
Frame(Frame),
InputEvent(InputEvent),
}

/// The payload of a LIST request.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
#[serde(transparent)]
Expand Down
5 changes: 5 additions & 0 deletions lighthouse-protocol/src/payload/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod directory_tree;
mod model;

pub use directory_tree::*;
pub use model::*;
11 changes: 11 additions & 0 deletions lighthouse-protocol/src/payload/model.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use serde::{Serialize, Deserialize};

use crate::{Frame, InputEvent};

/// The payload of a model message.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
#[serde(untagged)]
pub enum Model {
Frame(Frame),
InputEvent(InputEvent),
}

0 comments on commit bfcb9a9

Please sign in to comment.