Replace gRPC Backend (#10)

**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>
This commit was merged in pull request #10.
This commit is contained in:
2026-01-01 10:11:53 -08:00
committed by sergeysav
parent f658b55586
commit 788dd10a91
68 changed files with 3934 additions and 1504 deletions

View File

@@ -0,0 +1,10 @@
use api_proc_macro::IntoCommandDefinition;
#[derive(IntoCommandDefinition)]
enum TestEnum {
Variant
}
fn main() {
}

View File

@@ -0,0 +1,5 @@
error: IntoCommandDefinition not supported for enum
--> tests/into_command_definition/enum_fails.rs:4:1
|
4 | enum TestEnum {
| ^^^^

View File

@@ -0,0 +1,12 @@
use api_proc_macro::IntoCommandDefinition;
#[derive(IntoCommandDefinition)]
#[repr(C)]
union TestUnion {
f1: u32,
f2: f32,
}
fn main() {
}

View File

@@ -0,0 +1,5 @@
error: IntoCommandDefinition not supported for union
--> tests/into_command_definition/union_fails.rs:5:1
|
5 | union TestUnion {
| ^^^^^

View File

@@ -0,0 +1,8 @@
use api_proc_macro::IntoCommandDefinition;
#[derive(IntoCommandDefinition)]
struct TestUnnamedStruct(f32, f64, bool);
fn main() {
}

View File

@@ -0,0 +1,5 @@
error: IntoCommandDefinition not supported for unnamed structs
--> tests/into_command_definition/unnamed_struct_fails.rs:4:25
|
4 | struct TestUnnamedStruct(f32, f64, bool);
| ^^^^^^^^^^^^^^^^