Implement code for recieving the answer to a query

This commit is contained in:
2024-06-20 14:59:32 +02:00
parent aa7d51f088
commit db036064e7
2 changed files with 77 additions and 13 deletions

View File

@@ -21,6 +21,8 @@ use eagle::Protocol;
enum TestProtocol {
Addition((i32, i32), i32),
SomeKindOfQuestion(String, i32),
ThisRespondsWithAString(i32, String),
Void((), ()),
}
struct DummyServer;
@@ -32,6 +34,14 @@ impl TestProtocolServer for DummyServer {
fn addition(&mut self, a: i32, b: i32) -> i32 {
a + b
}
fn this_responds_with_a_string(&mut self, arg: i32) -> String {
format!("The number is {}", arg)
}
fn void(&mut self) {
println!("Void function called!")
}
}
fn main() {}