From bf9fadbf7440cdd70f035e80bf45a2c9df3e565b Mon Sep 17 00:00:00 2001 From: Nadja Reitzenstein Date: Thu, 6 Jan 2022 19:42:54 +0100 Subject: [PATCH] Implement getAPIVersion and getServerRelease methods --- src/api.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/api.rs b/src/api.rs index 8effc5d..797b692 100644 --- a/src/api.rs +++ b/src/api.rs @@ -43,7 +43,10 @@ impl Bootstrap { } } +use connection_capnp::{API_VERSION_MAJOR, API_VERSION_MINOR, API_VERSION_PATCH}; use connection_capnp::bootstrap::*; +use crate::RELEASE; + impl connection_capnp::bootstrap::Server for Bootstrap { fn authentication_system(&mut self, _: AuthenticationSystemParams, @@ -99,4 +102,28 @@ impl connection_capnp::bootstrap::Server for Bootstrap { Promise::ok(()) } + + fn get_a_p_i_version( + &mut self, + _: GetAPIVersionParams, + mut results: GetAPIVersionResults + ) -> Promise<(), capnp::Error> { + let mut builder = results.get(); + let mut builder = builder.init_version(); + builder.set_major(API_VERSION_MAJOR); + builder.set_minor(API_VERSION_MINOR); + builder.set_patch(API_VERSION_PATCH); + Promise::ok(()) + } + + fn get_server_release( + &mut self, + _: GetServerReleaseParams, + mut results: GetServerReleaseResults + ) -> Promise<(), capnp::Error> { + let mut builder = results.get(); + builder.set_name("bffh"); + builder.set_release(RELEASE); + Promise::ok(()) + } }