Kurlyk
Loading...
Searching...
No Matches
SubmitResult.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef KURLYK_HEADER_KURLYK_TYPES_SUBMIT_RESULT_HPP_INCLUDED
3#define KURLYK_HEADER_KURLYK_TYPES_SUBMIT_RESULT_HPP_INCLUDED
4
7
8#include <system_error>
9
10namespace kurlyk {
11
14 struct SubmitResult {
15 bool accepted = false;
16 std::error_code error_code;
17
20
24 SubmitResult(bool is_accepted, const std::error_code& error)
25 : accepted(is_accepted), error_code(error) {}
26
28 explicit operator bool() const {
29 return accepted;
30 }
31 };
32
33} // namespace kurlyk
34
35#endif // KURLYK_HEADER_KURLYK_TYPES_SUBMIT_RESULT_HPP_INCLUDED
Primary namespace for the Kurlyk library, encompassing initialization, request management,...
bool accepted
Indicates whether the work item was accepted for processing.
SubmitResult(bool is_accepted, const std::error_code &error)
Constructs an admission result.
SubmitResult()
Constructs a rejected result without an error code.
std::error_code error_code
Describes the rejection reason when accepted is false.