FastLED 3.9.15
Loading...
Searching...
No Matches
fl::asio::error_code Struct Reference

Detailed Description

Asio-compatible error code: numeric code + optional human-readable message.

Maps to boost::system::error_code in Asio.

Unlike fl::task::Error (string-only, heap allocation on every error), error_code is cheap to copy and supports quick boolean checks: if (ec) { /* error *‍/ }

Definition at line 31 of file error_code.h.

#include <error_code.h>

+ Collaboration diagram for fl::asio::error_code:

Public Member Functions

 error_code () FL_NOEXCEPT
 
 error_code (errc c)
 
 error_code (errc c, const char *msg)
 
 error_code (errc c, const fl::string &msg)
 
bool ok () const
 Convenience: true if no error.
 
 operator bool () const
 Asio-style: true if error, false if success.
 
bool operator!= (const error_code &o) const
 
bool operator== (const error_code &o) const
 
fl::task::Error to_error () const
 Convert to fl::task::Error for interop with existing FastLED code.
 

Static Public Member Functions

static error_code from_errno (int platform_errno)
 Convert from platform errno value.
 
static error_code from_error (const fl::task::Error &e)
 Convert from fl::task::Error for interop with existing FastLED code.
 

Public Attributes

errc code
 
fl::string message
 

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