/* Eagle - A library for easy communication in full-stack Rust applications Copyright (c) 2024 KodiCraft This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ use eagle::Protocol; #[derive(Protocol)] enum TestProtocol { Addition((i32, i32), i32), SomeKindOfQuestion(String, i32), ThisRespondsWithAString(i32, String), Void((), ()), } struct DummyServer; impl TestProtocolServer for DummyServer { fn some_kind_of_question(&mut self, question: String) -> i32 { question.len() as i32 } 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() {}