1 2 3 4 5 6 7 8 9 10 11 12
pub trait Device { fn name(&self) -> String; fn device_type(&self) -> DeviceType; fn memory_info(&self) -> String; } #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum DeviceType { Cpu, Gpu, Tpu, }