Expand description
Copyright © 2025-2026 Wenze Wei. All Rights Reserved.
This file is part of DMSC. The DMSC project belongs to the Dunimd Team.
Licensed under the Apache License, Version 2.0 (the “License”); You may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
§Custom Discovery Plugins
This module provides a plugin system for custom hardware discovery implementations. Users can create their own discovery plugins to support specialized hardware or proprietary device interfaces.
§Architecture
- DMSCHardwareDiscoveryPlugin: Trait for plugin implementations
- PluginRegistry: Manages registered plugins
- PluginMetadata: Plugin information and configuration
§Usage
use dmsc::device::discovery::plugins::{DMSCHardwareDiscoveryPlugin, PluginRegistry};
// Create a custom plugin
struct MyCustomPlugin;
#[async_trait::async_trait]
impl DMSCHardwareDiscoveryPlugin for MyCustomPlugin {
fn name(&self) -> &str { "MyCustomPlugin" }
fn version(&self) -> &str { "1.0.0" }
async fn discover(&self) -> Result<Vec<DMSCDevice>, String> {
// Custom discovery logic
Ok(vec![])
}
}
// Register the plugin
let mut registry = PluginRegistry::new();
registry.register(Box::new(MyCustomPlugin));Structs§
- Custom
Provider Plugin - Built-in custom provider plugin for user-defined discovery
- Plugin
Loader - Plugin loader for dynamic plugin loading
- Plugin
Metadata - Plugin metadata for identification and configuration
- Plugin
Registry - Plugin registry for managing custom discovery plugins
Enums§
- Plugin
Error - Errors that can occur during plugin operations
- Plugin
Status - Current status of a plugin
Traits§
- DMSC
Hardware Discovery Plugin - Trait for custom hardware discovery plugins
Functions§
- create_
custom_ plugin - Utility function to create a custom discovery plugin from a closure
Type Aliases§
- Plugin
Result - Result type for plugin discovery operations