Skip to main content

drasi_host_sdk/
lib.rs

1#![allow(unexpected_cfgs)]
2// Copyright 2025 The Drasi Authors.
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//     http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16//! Host-side SDK for loading and interacting with Drasi cdylib plugins.
17//!
18//! This crate provides:
19//! - [`PluginLoader`] — scan directories and load cdylib plugins
20//! - Proxy types that wrap FFI vtables into real DrasiLib traits
21//!   ([`SourceProxy`], [`ReactionProxy`], [`SourcePluginProxy`], etc.)
22//! - [`StateStoreVtableBuilder`] — build a `StateStoreVtable` from a host `StateStoreProvider`
23//! - Callback types for log/lifecycle event capture
24
25pub mod callbacks;
26#[cfg(feature = "fetcher")]
27pub mod fetcher;
28pub mod identity_bridge;
29pub mod lifecycle;
30pub mod loader;
31pub mod lockfile;
32pub mod plugin_registry;
33pub mod plugin_types;
34pub mod proxies;
35#[cfg(feature = "registry")]
36pub mod registry;
37pub mod state_store_bridge;
38pub mod watcher;
39
40pub use callbacks::{CallbackContext, CapturedLifecycle, CapturedLog, InstanceCallbackContext};
41pub use identity_bridge::IdentityProviderVtableBuilder;
42pub use loader::{
43    is_plugin_binary, plugin_kind_from_filename, scan_plugin_metadata, LoadedPlugin, PluginLoader,
44    PluginLoaderConfig, PluginMetadataSummary, DEFAULT_PLUGIN_FILE_PATTERNS,
45    PLUGIN_BINARY_EXTENSIONS,
46};
47pub use proxies::bootstrap_provider::{BootstrapPluginProxy, BootstrapProviderProxy};
48pub use proxies::reaction::{ReactionPluginProxy, ReactionProxy};
49pub use proxies::source::{SourcePluginProxy, SourceProxy};
50pub use state_store_bridge::StateStoreVtableBuilder;
51
52pub use plugin_types::{
53    PluginCategory, PluginEvent, PluginFileEvent, PluginKindEntry, PluginStatus,
54};
55
56pub use lockfile::{
57    compute_file_hash, FileIntegrityStatus, LockedPlugin, PluginLockfile, PluginSignatureInfo,
58};
59
60pub use plugin_registry::{PluginKindInfo, PluginRegistry, RegisteredDescriptor};
61
62pub use lifecycle::{LoadedPluginState, PluginLifecycleManager};
63
64pub use watcher::{PluginWatcher, PluginWatcherConfig};