Kurlyk
Loading...
Searching...
No Matches
kurlyk::SubmitResult Struct Reference

Represents the synchronous result of trying to enqueue or submit work. More...

#include <SubmitResult.hpp>

Public Member Functions

 SubmitResult ()
 Constructs a rejected result without an error code.
 SubmitResult (bool is_accepted, const std::error_code &error)
 Constructs an admission result.
 operator bool () const
 Converts the result to a boolean accepted flag.

Public Attributes

bool accepted = false
 Indicates whether the work item was accepted for processing.
std::error_code error_code
 Describes the rejection reason when accepted is false.

Detailed Description

Represents the synchronous result of trying to enqueue or submit work.

Definition at line 14 of file SubmitResult.hpp.

Constructor & Destructor Documentation

◆ SubmitResult() [1/2]

kurlyk::SubmitResult::SubmitResult ( )
inline

Constructs a rejected result without an error code.

Definition at line 19 of file SubmitResult.hpp.

◆ SubmitResult() [2/2]

kurlyk::SubmitResult::SubmitResult ( bool is_accepted,
const std::error_code & error )
inline

Constructs an admission result.

Parameters
is_acceptedIndicates whether the work item was accepted.
errorDescribes the rejection reason.

Definition at line 24 of file SubmitResult.hpp.

Member Function Documentation

◆ operator bool()

kurlyk::SubmitResult::operator bool ( ) const
inlineexplicit

Converts the result to a boolean accepted flag.

Definition at line 28 of file SubmitResult.hpp.

Member Data Documentation

◆ accepted

bool kurlyk::SubmitResult::accepted = false

Indicates whether the work item was accepted for processing.

Definition at line 15 of file SubmitResult.hpp.

◆ error_code

std::error_code kurlyk::SubmitResult::error_code

Describes the rejection reason when accepted is false.

Definition at line 16 of file SubmitResult.hpp.


The documentation for this struct was generated from the following file: