|
cxxmcp 1.1.6
C++ MCP SDK
|
Shared result and error primitives used by the public cxxmcp SDK. More...
#include <string>#include <string_view>#include <tl/expected.hpp>#include <type_traits>#include <utility>#include <variant>Go to the source code of this file.
Classes | |
| struct | mcp::core::Error |
| Structured error returned by fallible SDK operations. More... | |
Typedefs | |
| using | mcp::core::Unit = std::monostate |
| Success value for operations that only need to report failure. | |
| template<typename T > | |
| using | mcp::core::Result = tl::expected< T, Error > |
| Alias for the SDK result type. | |
Shared result and error primitives used by the public cxxmcp SDK.
This header keeps SDK APIs independent from exceptions at their public boundaries. Operations that can fail return mcp::core::Result with a structured mcp::core::Error so callers can propagate MCP or transport failures without losing protocol error details.
| using mcp::core::Result = typedef tl::expected<T, Error> |
Alias for the SDK result type.
Uses tl::expected for every supported C++ standard so compiled SDK libraries and downstream consumers see the same public ABI even when the consumer builds with C++23 or newer. The error side is always mcp::core::Error.
| using mcp::core::Unit = typedef std::monostate |
Success value for operations that only need to report failure.
This is used as Result<Unit> in APIs whose successful completion has no payload, mirroring void while still fitting the expected style.