SofaBuffers C/C++ 0.12.0
API Documentation
Loading...
Searching...
No Matches
sofab::IStreamImpl::Result Class Reference

Outcome of a feed call. More...

#include <sofab.hpp>

Public Member Functions

 operator bool () const noexcept
 True if the feed reached a complete message boundary (same as ok()). An Error::Incomplete partial decode is neither complete nor an error, so this is false — use incomplete() to tell it apart from a genuine error.
 
bool operator== (Error e) const noexcept
 Compare the held error code to e.
 
bool operator!= (Error e) const noexcept
 Negated operator==().
 
bool ok () const noexcept
 True if the consumed bytes end exactly on a field boundary (a complete message so far). False for both a partial decode (incomplete()) and a genuine decode error.
 
bool incomplete () const noexcept
 True if the consumed bytes end mid-field or with an open sequence: a valid but partial decode (Error::Incomplete). Not an error — the caller owns end-of-input and may feed more bytes to continue. Distinct from both ok() and a decode error.
 
bool invalid () const noexcept
 True if the bytes are malformed (Error::InvalidMessage). Deliberately false for limitExceeded(): a receiver limit is a policy rejection on well-formed bytes (§6.2.1/§6.3), and the two must stay distinguishable to the caller.
 
bool limitExceeded () const noexcept
 True if a configured receiver limit was exceeded on a schema-unbounded field (Error::LimitExceeded, §6.2.1).
 
Error code () const noexcept
 The Error result of the feed.
 

Friends

class IStreamImpl
 

Detailed Description

Outcome of a feed call.

Convertible to bool (true on success) and comparable to Error.

Definition at line 2297 of file sofab.hpp.

Member Function Documentation

◆ code()

Error sofab::IStreamImpl::Result::code ( ) const
inlinenoexcept

The Error result of the feed.

Definition at line 2372 of file sofab.hpp.

◆ incomplete()

bool sofab::IStreamImpl::Result::incomplete ( ) const
inlinenoexcept

True if the consumed bytes end mid-field or with an open sequence: a valid but partial decode (Error::Incomplete). Not an error — the caller owns end-of-input and may feed more bytes to continue. Distinct from both ok() and a decode error.

Definition at line 2346 of file sofab.hpp.

◆ invalid()

bool sofab::IStreamImpl::Result::invalid ( ) const
inlinenoexcept

True if the bytes are malformed (Error::InvalidMessage). Deliberately false for limitExceeded(): a receiver limit is a policy rejection on well-formed bytes (§6.2.1/§6.3), and the two must stay distinguishable to the caller.

Definition at line 2355 of file sofab.hpp.

◆ limitExceeded()

bool sofab::IStreamImpl::Result::limitExceeded ( ) const
inlinenoexcept

True if a configured receiver limit was exceeded on a schema-unbounded field (Error::LimitExceeded, §6.2.1).

Means *"raise my limit, or the sender must send less"* — the same bytes decode on a receiver configured more loosely. Terminal, like invalid(), but never the same answer.

Definition at line 2366 of file sofab.hpp.

◆ ok()

bool sofab::IStreamImpl::Result::ok ( ) const
inlinenoexcept

True if the consumed bytes end exactly on a field boundary (a complete message so far). False for both a partial decode (incomplete()) and a genuine decode error.

Definition at line 2337 of file sofab.hpp.

Here is the caller graph for this function:

◆ operator bool()

sofab::IStreamImpl::Result::operator bool ( ) const
inlineexplicitnoexcept

True if the feed reached a complete message boundary (same as ok()). An Error::Incomplete partial decode is neither complete nor an error, so this is false — use incomplete() to tell it apart from a genuine error.

Definition at line 2317 of file sofab.hpp.

Here is the call graph for this function:

◆ operator!=()

bool sofab::IStreamImpl::Result::operator!= ( Error  e) const
inlinenoexcept

Negated operator==().

Definition at line 2329 of file sofab.hpp.

Here is the call graph for this function:

◆ operator==()

bool sofab::IStreamImpl::Result::operator== ( Error  e) const
inlinenoexcept

Compare the held error code to e.

Definition at line 2323 of file sofab.hpp.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ IStreamImpl

Definition at line 2302 of file sofab.hpp.


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