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