xref: /DragonOS/kernel/src/driver/base/device/driver.rs (revision 79a452ce8f27ad9c7283ac0bcf4078ed6fa018d7)
1 use super::IdTable;
2 use core::{any::Any, fmt::Debug};
3 
4 /// @brief: Driver error
5 #[allow(dead_code)]
6 #[derive(Debug, PartialEq, Eq, Clone, Copy)]
7 pub enum DriverError {
8     ProbeError,
9 }
10 
11 /// @brief: 所有设备驱动都应该实现该trait
12 pub trait Driver: Any + Send + Sync + Debug {
13     /// @brief: 获取设备驱动标识符
14     /// @parameter: None
15     /// @return: 该设备驱动唯一标识符
16     fn get_id_table(&self) -> IdTable;
17 }
18