diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2020-04-16 21:42:45 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2020-04-16 21:42:45 +0200 |
commit | 6cf5244bc514042fe419fffe1cd26a7f5e3c778f (patch) | |
tree | 4a72abf80980c3d10656bd82606a69329867d057 /src/channel.h | |
parent | a76a9ad65fa549d2c1650bb5a7d9a657186edc43 (diff) |
Remove optional from load result
Makes loading of data well-defined for arbitrary object contents.
Introduce zero reference and object to represent missing or mismatched
parts.
Diffstat (limited to 'src/channel.h')
-rw-r--r-- | src/channel.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/channel.h b/src/channel.h index 100003c..1c7df30 100644 --- a/src/channel.h +++ b/src/channel.h @@ -9,7 +9,7 @@ namespace erebos { struct ChannelRequestData { Ref store(const Storage & st) const; - static optional<ChannelRequestData> load(const Ref &); + static ChannelRequestData load(const Ref &); const vector<Stored<Signed<IdentityData>>> peers; const Stored<PublicKexKey> key; @@ -20,7 +20,7 @@ typedef Signed<ChannelRequestData> ChannelRequest; struct ChannelAcceptData { Ref store(const Storage & st) const; - static optional<ChannelAcceptData> load(const Ref &); + static ChannelAcceptData load(const Ref &); Stored<class Channel> channel() const; @@ -40,7 +40,7 @@ public: {} Ref store(const Storage & st) const; - static optional<Channel> load(const Ref &); + static Channel load(const Ref &); static Stored<ChannelRequest> generateRequest(const Storage &, const Identity & self, const Identity & peer); |