**Rationale:** Having two separate servers and communication methods resulted in additional maintenance & the need to convert often between backend & frontend data types. By moving the backend communication off of gRPC and to just use websockets it both gives more control & allows for simplification of the implementation. #8 **Changes:** - Replaces gRPC backend. - New implementation automatically handles reconnect logic - Implements an api layer - Migrates examples to the api layer - Implements a proc macro to make command handling easier - Implements unit tests for the api layer (90+% coverage) - Implements integration tests for the proc macro (90+% coverage) Reviewed-on: #10 Co-authored-by: Sergey Savelyev <sergeysav.nn@gmail.com> Co-committed-by: Sergey Savelyev <sergeysav.nn@gmail.com>
20 lines
513 B
Rust
20 lines
513 B
Rust
use crate::data_type::DataType;
|
|
use crate::messages::RequestResponse;
|
|
use serde::{Deserialize, Serialize};
|
|
use uuid::Uuid;
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct TelemetryDefinitionRequest {
|
|
pub name: String,
|
|
pub data_type: DataType,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct TelemetryDefinitionResponse {
|
|
pub uuid: Uuid,
|
|
}
|
|
|
|
impl RequestResponse for TelemetryDefinitionRequest {
|
|
type Response = TelemetryDefinitionResponse;
|
|
}
|