Skip to main content

radixdb_plugin_host/
lib.rs

1// Copyright 2026 RadixDB Contributors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Internal startup loader and immutable runtime registry for operator-trusted
16//! native RadixDB packages.
17//!
18//! This crate owns filesystem admission and copies every accepted ABI
19//! descriptor into Rust-owned metadata. It deliberately has no dependency on
20//! catalog, executor, MVCC, WAL, page, or recovery crates.
21
22#![forbid(unsafe_op_in_unsafe_fn)]
23
24mod invoke;
25mod loader;
26mod manifest;
27mod registry;
28
29pub use invoke::{
30    CandidateKeySpan, CandidatePlan, HashComponent, InvocationLimits, NormalizedPredicateArgument,
31    PlannerPlanIdentity, PlannerSupportOutcome, PluginInvocationError,
32};
33#[cfg(any(test, feature = "test-hooks"))]
34#[doc(hidden)]
35pub use loader::registry_from_test_descriptor;
36pub use loader::{
37    load_plugin_registry, plugin_loader_metrics, PluginHostError, PluginLoaderMetricsSnapshot,
38};
39pub use manifest::{
40    PluginHostConfig, PluginPackageManifest, MANIFEST_FORMAT, MAXIMUM_REQUIRED_GLIBC,
41    OFFICIAL_BUILD_IMAGE, PLUGIN_MANIFEST_FILE, SUPPORTED_TARGET,
42};
43pub use registry::{
44    derive_object_id, DatabasePluginAdmission, ObjectId, ObjectKind, ObjectRequirement,
45    PackageRequirement, PluginRegistry, PluginRegistryStatus, RegisteredBinding,
46    RegisteredExternalType, RegisteredFunction, RegisteredOperator, RegisteredOperatorClass,
47    RegisteredPackage, RegisteredPlannerSupport, RegisteredTypeRef, RequirementIssue,
48};
49
50/// Stable host-side names for ABI storage tags. Consumers do not need a
51/// second direct dependency on the raw ABI crate merely to inspect admitted
52/// descriptors.
53pub const EXTERNAL_STORAGE_FIXED: u16 = radixdb_plugin_abi::RADIX_EXTERNAL_STORAGE_FIXED;
54pub const EXTERNAL_STORAGE_VARIABLE: u16 = radixdb_plugin_abi::RADIX_EXTERNAL_STORAGE_VARIABLE;