stay backwards compatible

This commit is contained in:
Nadja Reitzenstein 2022-04-28 20:10:06 +02:00
parent 750ae0c34b
commit 93f130873e
2 changed files with 16 additions and 11 deletions

View File

@ -39,7 +39,7 @@ struct Fallible(T, E) {
# In those cases returning an `Optional` doesn't transfer information about the way that the # In those cases returning an `Optional` doesn't transfer information about the way that the
# operation failed. `Fallible` contains this information in the generic `E` type. # operation failed. `Fallible` contains this information in the generic `E` type.
union { union {
successful @0 :T; failed @0 :E;
failed @1 :E; successful @1 :T;
} }
} }

View File

@ -27,6 +27,10 @@ struct UserSystem
interface Manage $CSharp.name("ManageInterface") { interface Manage $CSharp.name("ManageInterface") {
getUserList @0 () -> ( user_list :List(User) ); getUserList @0 () -> ( user_list :List(User) );
addUser @1 (username :Text, password: Text) -> User;
removeUser @2 (user: User);
struct AddUserError {
enum AddUserError { enum AddUserError {
alreadyExists @0; alreadyExists @0;
# An user with that username already exists # An user with that username already exists
@ -34,7 +38,8 @@ struct UserSystem
# The provided username is unusable, e.g. contains invalid characters, # The provided username is unusable, e.g. contains invalid characters,
# is too long or too short. # is too long or too short.
} }
addUser @1 (username :Text, password: Text) -> Fallible(User, AddUserError); error @0 :AddUserError;
removeUser @2 (user: User); }
addUserFallible @3 (username :Text, password: Text) -> Fallible(User, AddUserError);
} }
} }