return Optional value for searches

This commit is contained in:
Nadja Reitzenstein 2022-04-22 19:32:17 +02:00
parent 049b183f96
commit aa006507c4
2 changed files with 11 additions and 3 deletions

View File

@ -25,4 +25,11 @@ struct UUID {
struct KeyValuePair {
key @0 :Text;
value @1 :Text;
}
}
struct Optional(T) {
union {
nothing @0 :Void;
just @1 :T;
}
}

View File

@ -7,6 +7,7 @@ using CSharp = import "programming_language/csharp.capnp";
$CSharp.namespace("FabAccessAPI.Schema");
using General = import "general.capnp";
using Optional = General.Optional;
using Machine = import "machine.capnp".Machine;
struct MachineSystem
@ -15,7 +16,7 @@ struct MachineSystem
interface Info $CSharp.name("InfoInterface") {
getMachineList @0 () -> ( machine_list :List(Machine) );
getMachine @1 ( id :Text ) -> Machine;
getMachineURN @2 ( urn :Text ) -> Machine;
getMachine @1 ( id :Text ) -> Optional(Machine);
getMachineURN @2 ( urn :Text ) -> Optional(Machine);
}
}