match LabVIEW demo
This commit is contained in:
parent
60c0c862d9
commit
09c1fe5982
1 changed files with 5 additions and 10 deletions
|
@ -2,25 +2,20 @@ use serde::{Deserialize, Serialize};
|
|||
use anyhow::Result;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
enum Status {
|
||||
Online,
|
||||
Offline,
|
||||
Burning,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
struct Data {
|
||||
boolean: bool,
|
||||
string: String,
|
||||
number: u8,
|
||||
#[serde(rename = "report")]
|
||||
status: Status,
|
||||
#[serde(rename = "numbers")]
|
||||
array: [u8; 4],
|
||||
}
|
||||
|
||||
let data = Data {
|
||||
boolean: false,
|
||||
string: String::from("data"),
|
||||
number: 42,
|
||||
status: Status::Online,
|
||||
array: [0,1,2,3],
|
||||
};
|
||||
|
||||
println!("debug: {:?}", data);
|
||||
|
|
Loading…
Reference in a new issue