Module plugins

Module plugins 

Source
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.0

Unless 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§

CustomProviderPlugin
Built-in custom provider plugin for user-defined discovery
PluginLoader
Plugin loader for dynamic plugin loading
PluginMetadata
Plugin metadata for identification and configuration
PluginRegistry
Plugin registry for managing custom discovery plugins

Enums§

PluginError
Errors that can occur during plugin operations
PluginStatus
Current status of a plugin

Traits§

DMSCHardwareDiscoveryPlugin
Trait for custom hardware discovery plugins

Functions§

create_custom_plugin
Utility function to create a custom discovery plugin from a closure

Type Aliases§

PluginResult
Result type for plugin discovery operations