MCPcopy Create free account
hub / github.com/Snapchat/Valdi / setResult

Method setResult

valdi_core/src/valdi_core/cpp/Utils/Future.hpp:31–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 }
30
31 void setResult(Result<T> result) {
32 SmallVector<Function<void(Result<T>)>, 1> handlers;
33 {
34 std::lock_guard<Mutex> lock(_mutex);
35 SC_ASSERT(_result.empty(), _result.description());
36 _result = result;
37 handlers = std::move(_handlers);
38 }
39
40 for (auto& handler : handlers) {
41 handler(result);
42 }
43 }
44
45private:
46 Mutex _mutex;

Callers 4

setValueMethod · 0.80
setErrorMethod · 0.80
setValueMethod · 0.80
setErrorMethod · 0.80

Calls 3

descriptionMethod · 0.80
handlerFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected