Trying to use the prost
Some checks failed
ci/woodpecker/push/code_tests Pipeline failed
ci/woodpecker/push/pre_commit_test Pipeline failed

This commit is contained in:
2025-11-28 19:18:04 +01:00
parent 56aa1e1bbf
commit 2052178ebf
8 changed files with 52 additions and 78 deletions

View File

@@ -4,7 +4,9 @@ version = "0.1.0"
edition = "2024"
[dependencies]
prost = "0.14.1"
uuid = { version = "1.18.1", features = ["v4"] }
[build-dependencies]
tonic-prost-build = "0.14.2"
prost-build = "0.14.1"
prost-types = "0.14.1"

View File

@@ -1,4 +1,13 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_prost_build::compile_protos("proto/helloworld.proto")?;
use std::{fs, io::Result};
fn main() -> Result<()> {
//let proto_dir = "proto";
//let paths = fs::read_dir(proto_dir).unwrap();
//for path in paths {
// prost_build::compile_protos(&[path.unwrap().path()], &[proto_dir])?;
//}
prost_build::compile_protos(&["proto/audio_backend.proto"], &["proto/"])?;
prost_build::compile_protos(&["proto/items.proto"], &["proto/"])?;
Ok(())
}

View File

@@ -0,0 +1,6 @@
syntax = "proto3";
package termix.audio_backend;
service AudioBackend {
}

View File

@@ -1,14 +0,0 @@
syntax = "proto3";
package helloworld;
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply);
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}

18
lib/proto/items.proto Normal file
View File

@@ -0,0 +1,18 @@
syntax = "proto3";
package snazzy.items;
// A snazzy new shirt!
message Shirt {
// Label sizes
enum Size {
SMALL = 0;
MEDIUM = 1;
LARGE = 2;
}
// The base color
string color = 1;
// The size as stated on the label
Size size = 2;
}

View File

@@ -1,5 +1,11 @@
pub mod metadata;
pub mod snazzy {
pub mod items {
include!(concat!(env!("OUT_DIR"), "/snazzy.items.rs"));
}
}
pub mod project;
pub mod region;
pub mod track;
pub mod termix {
pub mod audio_backend {
include!(concat!(env!("OUT_DIR"), "/termix.audio_backend.rs"));
}
}