graft
May 17, 2026 ยท View on GitHub
{#graftmodule}
graft
Native ABI contracts and runtime loading helpers.
Namespaces
| Name | Description |
|---|---|
graft | Shared-library ABI contracts and runtime loading helpers. |
{#graft}
graft
Shared-library ABI contracts and runtime loading helpers.
Classes
| Name | Description |
|---|---|
Library | Loads a native plugin library and resolves its typed entrypoint. |
Manifest | Metadata exported by a plugin or host surface. |
Enumerations
| Name | Description |
|---|---|
RuntimeKind | Runtime contract declared by a graft manifest. |
{#runtimekind}
RuntimeKind
enum RuntimeKind
Runtime contract declared by a graft manifest.
| Value | Description |
|---|---|
Unknown | Runtime string is missing or not recognized. |
Native | Plugin is loaded directly into the host process. |
Worker | Plugin is intended for a worker runtime. |
Host | Manifest describes a host-exported C ABI surface, not a plugin. |
Functions
| Return | Name | Description |
|---|---|---|
Graft_APIRuntimeKind | parseRuntimeKind nodiscard noexcept | Converts a manifest runtime string to a [RuntimeKind](#runtimekind). |
Graft_API const char * | runtimeKindName nodiscard noexcept | Returns the manifest runtime string for a [RuntimeKind](#runtimekind). |
Graft_API void | validateManifest | Throws when a manifest is incompatible or missing required fields. |
Graft_API void | validatePluginManifest | Throws when a manifest is not a plugin-loadable manifest. |
Graft_API void | validateHostSurfaceManifest | Throws when a manifest is not a host-exported surface manifest. |
{#parseruntimekind}
parseRuntimeKind
nodiscard noexcept
[[nodiscard]] Graft_APIRuntimeKind parseRuntimeKind(std::string_view runtime) noexcept
Converts a manifest runtime string to a [RuntimeKind](#runtimekind).
{#runtimekindname}
runtimeKindName
nodiscard noexcept
[[nodiscard]] Graft_API const char * runtimeKindName(RuntimeKind runtime) noexcept
Returns the manifest runtime string for a [RuntimeKind](#runtimekind).
{#validatemanifest}
validateManifest
Graft_API void validateManifest(const Manifest & manifest, std::string_view path)
Throws when a manifest is incompatible or missing required fields.
{#validatepluginmanifest}
validatePluginManifest
Graft_API void validatePluginManifest(const Manifest & manifest, std::string_view path)
Throws when a manifest is not a plugin-loadable manifest.
{#validatehostsurfacemanifest}
validateHostSurfaceManifest
Graft_API void validateHostSurfaceManifest(const Manifest & manifest, std::string_view path)
Throws when a manifest is not a host-exported surface manifest.
Variables
| Return | Name | Description |
|---|---|---|
std::uint32_t | ABI_VERSION constexpr | Current binary manifest ABI version required by the loader. |
const char * | PLUGIN_MANIFEST_SYMBOL constexpr | Exported symbol name that plugin libraries use for their manifest. |
const char * | MANIFEST_SYMBOL constexpr | Backwards-compatible name for PLUGIN_MANIFEST_SYMBOL. |
const char * | RUNTIME_NATIVE constexpr | Runtime string for plugins loaded directly into the current process. |
const char * | RUNTIME_WORKER constexpr | Runtime string for plugins intended to execute in a worker runtime. |
const char * | RUNTIME_HOST constexpr | Runtime string for host-exported C ABI surfaces. |
{#abi_version}
ABI_VERSION
constexpr
std::uint32_t ABI_VERSION = 1
Current binary manifest ABI version required by the loader.
{#plugin_manifest_symbol}
PLUGIN_MANIFEST_SYMBOL
constexpr
const char * PLUGIN_MANIFEST_SYMBOL = "icy_graft_manifest"
Exported symbol name that plugin libraries use for their manifest.
{#manifest_symbol}
MANIFEST_SYMBOL
constexpr
const char * MANIFEST_SYMBOL = "icy_graft_manifest"
Backwards-compatible name for PLUGIN_MANIFEST_SYMBOL.
{#runtime_native}
RUNTIME_NATIVE
constexpr
const char * RUNTIME_NATIVE = "native"
Runtime string for plugins loaded directly into the current process.
{#runtime_worker}
RUNTIME_WORKER
constexpr
const char * RUNTIME_WORKER = "worker"
Runtime string for plugins intended to execute in a worker runtime.
{#runtime_host}
RUNTIME_HOST
constexpr
const char * RUNTIME_HOST = "host"
Runtime string for host-exported C ABI surfaces.
{#library}
Library
#include <icy/graft/graft.h>
class Library
Defined in src/graft/include/icy/graft/graft.h:90
Loads a native plugin library and resolves its typed entrypoint.
List of all members
| Name | Kind | Owner |
|---|---|---|
Library | function | Declared here |
Library | function | Declared here |
Library | function | Declared here |
open | function | Declared here |
close | function | Declared here |
isOpen | function | Declared here |
path | function | Declared here |
manifest | function | Declared here |
requireSymbolAddress | function | Declared here |
requireSymbol | function | Declared here |
entrypoint | function | Declared here |
_library | variable | Declared here |
_path | variable | Declared here |
_manifest | variable | Declared here |
_open | variable | Declared here |
loadManifest | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
Library | Defaulted constructor. | |
Library | Deleted constructor. | |
Library | Deleted constructor. | |
void | open | |
void | close noexcept | |
bool | isOpen const nodiscard noexcept | |
const std::string & | path const nodiscard noexcept | |
const Manifest & | manifest const nodiscard | |
void * | requireSymbolAddress const nodiscard | |
T | requireSymbol const inline nodiscard | |
T | entrypoint const inline nodiscard |
{#library-1}
Library
Library() = default
Defined in src/graft/include/icy/graft/graft.h:93
Defaulted constructor.
{#library-2}
Library
Library(const Library &) = delete
Defined in src/graft/include/icy/graft/graft.h:96
Deleted constructor.
{#library-3}
Library
Library(Library &&) = delete
Defined in src/graft/include/icy/graft/graft.h:98
Deleted constructor.
{#open-6}
open
void open(const std::string & path)
Defined in src/graft/include/icy/graft/graft.h:101
{#close-24}
close
noexcept
void close() noexcept
Defined in src/graft/include/icy/graft/graft.h:102
{#isopen}
isOpen
const nodiscard noexcept
[[nodiscard]] bool isOpen() const noexcept
Defined in src/graft/include/icy/graft/graft.h:104
{#path-3}
path
const nodiscard noexcept
[[nodiscard]] const std::string & path() const noexcept
Defined in src/graft/include/icy/graft/graft.h:105
{#manifest-4}
manifest
const nodiscard
[[nodiscard]] const Manifest & manifest() const
Defined in src/graft/include/icy/graft/graft.h:106
{#requiresymboladdress}
requireSymbolAddress
const nodiscard
[[nodiscard]] void * requireSymbolAddress(const char * name) const
Defined in src/graft/include/icy/graft/graft.h:108
{#requiresymbol}
requireSymbol
const inline nodiscard
template<typename T> [[nodiscard]] inline T requireSymbol(const char * name) const
Defined in src/graft/include/icy/graft/graft.h:111
{#entrypoint-2}
entrypoint
const inline nodiscard
template<typename T> [[nodiscard]] inline T entrypoint() const
Defined in src/graft/include/icy/graft/graft.h:117
Private Attributes
| Return | Name | Description |
|---|---|---|
SharedLibrary | _library | |
std::string | _path | |
const Manifest * | _manifest | |
bool | _open |
{#_library}
_library
SharedLibrary _library
Defined in src/graft/include/icy/graft/graft.h:125
{#_path-4}
_path
std::string _path
Defined in src/graft/include/icy/graft/graft.h:126
{#_manifest}
_manifest
const Manifest * _manifest = nullptr
Defined in src/graft/include/icy/graft/graft.h:127
{#_open}
_open
bool _open = false
Defined in src/graft/include/icy/graft/graft.h:128
Private Methods
| Return | Name | Description |
|---|---|---|
void | loadManifest |
{#loadmanifest}
loadManifest
void loadManifest()
Defined in src/graft/include/icy/graft/graft.h:123
{#manifest-3}
Manifest
#include <icy/graft/graft.h>
struct Manifest
Defined in src/graft/include/icy/graft/graft.h:70
Metadata exported by a plugin or host surface.
List of all members
| Name | Kind | Owner |
|---|---|---|
abiVersion | variable | Declared here |
fileName | variable | Declared here |
id | variable | Declared here |
name | variable | Declared here |
version | variable | Declared here |
runtime | variable | Declared here |
entrypoint | variable | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
std::uint32_t | abiVersion | ABI version expected to match [ABI_VERSION](#abi_version). |
const char * | fileName | Source file that declared the manifest. |
const char * | id | Stable plugin or surface identifier. |
const char * | name | Human-readable plugin or surface name. |
const char * | version | Plugin or surface version string. |
const char * | runtime | Runtime contract string, such as native, worker, or host. |
const char * | entrypoint | Exported symbol name for the typed entrypoint. |
{#abiversion-1}
abiVersion
std::uint32_t abiVersion
Defined in src/graft/include/icy/graft/graft.h:73
ABI version expected to match [ABI_VERSION](#abi_version).
{#filename-3}
fileName
const char * fileName
Defined in src/graft/include/icy/graft/graft.h:75
Source file that declared the manifest.
{#id-4}
id
const char * id
Defined in src/graft/include/icy/graft/graft.h:77
Stable plugin or surface identifier.
{#name-8}
name
const char * name
Defined in src/graft/include/icy/graft/graft.h:79
Human-readable plugin or surface name.
{#version-6}
version
const char * version
Defined in src/graft/include/icy/graft/graft.h:81
Plugin or surface version string.
{#runtime-1}
runtime
const char * runtime
Defined in src/graft/include/icy/graft/graft.h:83
Runtime contract string, such as native, worker, or host.
{#entrypoint-1}
entrypoint
const char * entrypoint
Defined in src/graft/include/icy/graft/graft.h:85
Exported symbol name for the typed entrypoint.