Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::ResultSocket Struct Reference

Socket result retaining a stable operation detail and one scalar diagnostic context. More...

#include <SocketError.h>

Public Member Functions

constexpr ResultSocket (bool valid)
 
constexpr ResultSocket (SocketError error, SocketErrorDetail detail=SocketErrorDetail::None)
 
constexpr ResultSocket (SocketError error, SocketErrorDetail detail, SocketErrorContextKind contextKind, SocketErrorContext context)
 
constexpr ResultSocket (Result result)
 
template<typename ResultLike >
constexpr ResultSocket (const ResultLike &other)
 
constexpr operator bool () const
 
constexpr operator Result () const
 
constexpr Result toResult () const
 
constexpr bool isError (SocketError error) const
 

Static Public Member Functions

static constexpr ResultSocket withNativeError (SocketError error, SocketErrorDetail detail, uint32_t nativeError)
 
static constexpr ResultSocket withResolverError (SocketError error, SocketErrorDetail detail, int32_t resolverError)
 
static constexpr ResultSocket withRequiredBytes (SocketError error, SocketErrorDetail detail, uint32_t requiredBytes)
 
static constexpr ResultSocket withActualBytes (SocketError error, SocketErrorDetail detail, uint32_t actualBytes)
 

Public Attributes

Result result
 
SocketErrorDetail detail = SocketErrorDetail::None
 
SocketErrorContextKind contextKind = SocketErrorContextKind::None
 
SocketErrorContext context = {}
 

Detailed Description

Socket result retaining a stable operation detail and one scalar diagnostic context.

The composed Result is authoritative. Plain and foreign conversions clear Socket-specific context, while same-domain copies retain it. Conversion to Result preserves only the category/error identity.


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