initial commit for client+libs
This commit is contained in:
parent
49ba2eb018
commit
b1f432ef3f
8 changed files with 167 additions and 0 deletions
28
beamer/libs/semserialize/src/lib.rs
Normal file
28
beamer/libs/semserialize/src/lib.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
#[macro_use]
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
// How many lines are there from HIGHEST to LOWEST
|
||||
const HEIGHT: usize = 32;
|
||||
// "Pixels" from left to right
|
||||
const WIDTH: usize = 32;
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
struct SemLine{
|
||||
line: u32,
|
||||
pixels:[u8;WIDTH]
|
||||
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use serde_json;
|
||||
#[test]
|
||||
fn test_serialize(){
|
||||
let test_struct: SemLine = SemLine{line:0,pixels:[0;WIDTH]};
|
||||
let serialized = serde_json::to_string(&test_struct).unwrap();
|
||||
let
|
||||
}
|
||||
fn deserialize(){
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue