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.
§Device Discovery Module
This module provides a comprehensive cross-platform device discovery system that can detect and enumerate hardware devices on any platform.
§Architecture
- DMSCDeviceDiscovery: Main discovery engine combining providers and plugins
- DMSCHardwareProvider: Trait for built-in hardware providers
- DMSCHardwareDiscoveryPlugin: Trait for custom discovery plugins
- PlatformInfo: Cross-platform detection and compatibility info
§Features
- Universal Hardware Support: CPU, Memory, Storage, Network, GPU, USB
- Cross-Platform: Linux, macOS, Windows, WebAssembly
- Extensible Plugin System: Custom discovery implementations
- Async-First: All operations are asynchronous
- Fallback Strategies: Graceful degradation when platforms lack support
§Usage
ⓘ
use dmsc::device::discovery::{DMSCDeviceDiscovery, DiscoveryConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = DiscoveryConfig::default();
let discovery = DMSCDeviceDiscovery::new(config).await?;
// Discover all devices
let devices = discovery.discover_all().await?;
println!("Discovered {} devices", devices.len());
// Discover specific category
let cpus = discovery.discover_category(dmsc::device::HardwareCategory::CPU).await?;
println!("Found {} CPUs", cpus.len());
Ok(())
}Re-exports§
pub use platform::PlatformInfo;pub use platform::PlatformType;pub use platform::Architecture;pub use platform::DiscoveryStrategy;pub use platform::HardwareCategory;pub use platform::PlatformCompatibility;pub use providers::DMSCHardwareProvider;pub use providers::ProviderRegistry;pub use providers::DiscoveryResult;pub use providers::CPUProvider;pub use providers::MemoryProvider;pub use providers::StorageProvider;pub use providers::NetworkProvider;pub use providers::GPUProvider;pub use providers::USBProvider;pub use plugins::DMSCHardwareDiscoveryPlugin;pub use plugins::PluginRegistry;pub use plugins::PluginMetadata;pub use plugins::PluginStatus;pub use plugins::PluginError;pub use plugins::PluginResult;pub use plugins::PluginLoader;pub use plugins::create_custom_plugin;
Modules§
- platform
- Copyright © 2025-2026 Wenze Wei. All Rights Reserved.
- plugins
- Copyright © 2025-2026 Wenze Wei. All Rights Reserved.
- providers
- Copyright © 2025-2026 Wenze Wei. All Rights Reserved.
Structs§
- Async
Discovery - Async discovery operation with progress tracking
- DMSC
Device Discovery - Main device discovery engine
- Discovery
Config - Discovery configuration
- Discovery
Stats - Discovery statistics
Traits§
- Device
Discovery Extension - Extension trait for DMSCDeviceController to integrate discovery