1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
use VRDisplayPtr; use VREvent; use VRGamepadPtr; pub trait VRService: Send { fn initialize(&mut self) -> Result<(), String>; fn fetch_displays(&mut self) -> Result<Vec<VRDisplayPtr>, String>; fn fetch_gamepads(&mut self) -> Result<Vec<VRGamepadPtr>, String>; fn is_available(&self) -> bool; fn poll_events(&self) -> Vec<VREvent>; } pub trait VRServiceCreator { fn new_service(&self) -> Box<VRService>; }