boost::capy::cond
Portable error conditions for capy I/O operations.
Synopsis
Declared in <boost/capy/cond.hpp>
enum class cond : int;
Description
These are the conditions callers should compare against when handling errors from capy operations. The error enum values map to these conditions, as do platform‐specific error codes (e.g., ECANCELED, SSL EOF errors).
Example
capy::task<> classify_read_error( capy::any_read_stream& stream, capy::mutable_buffer bufs )
{
auto [ec, n] = co_await stream.read_some( bufs );
if( ec == capy::cond::canceled )
{
// handle cancellation
}
else if( ec == capy::cond::eof )
{
// handle end of stream
}
else if( ec )
{
// handle other errors
}
}
Members
Name |
Description |
|
End‐of‐stream condition. |
|
Operation cancelled condition. |
|
Stream truncated condition. |
|
Operation timed out condition. |