ascom_alpaca/api/
rotator.rs1use super::Device;
2use crate::{ASCOMError, ASCOMResult};
3use macro_rules_attribute::apply;
4
5#[apply(rpc_trait)]
7pub trait Rotator: Device + Send + Sync {
8 #[http("canreverse", method = Get)]
10 async fn can_reverse(&self) -> ASCOMResult<bool> {
11 Ok(false)
12 }
13
14 #[http("ismoving", method = Get, device_state = IsMoving)]
18 async fn is_moving(&self) -> ASCOMResult<bool>;
19
20 #[http("mechanicalposition", method = Get, device_state = MechanicalPosition)]
22 async fn mechanical_position(&self) -> ASCOMResult<f64>;
23
24 #[http("position", method = Get, device_state = Position)]
26 async fn position(&self) -> ASCOMResult<f64>;
27
28 #[http("reverse", method = Get)]
30 async fn reverse(&self) -> ASCOMResult<bool>;
31
32 #[http("reverse", method = Put)]
34 async fn set_reverse(&self, #[http("Reverse")] reverse: bool) -> ASCOMResult<()>;
35
36 #[http("stepsize", method = Get)]
38 async fn step_size(&self) -> ASCOMResult<f64> {
39 Err(ASCOMError::NOT_IMPLEMENTED)
40 }
41
42 #[http("targetposition", method = Get)]
44 async fn target_position(&self) -> ASCOMResult<f64>;
45
46 #[http("halt", method = Put)]
48 async fn halt(&self) -> ASCOMResult<()> {
49 Err(ASCOMError::NOT_IMPLEMENTED)
50 }
51
52 #[http("move", method = Put)]
54 async fn move_(&self, #[http("Position")] position: f64) -> ASCOMResult<()>;
55
56 #[http("moveabsolute", method = Put)]
58 async fn move_absolute(&self, #[http("Position")] position: f64) -> ASCOMResult<()>;
59
60 #[http("movemechanical", method = Put)]
62 async fn move_mechanical(&self, #[http("Position")] position: f64) -> ASCOMResult<()>;
63
64 #[http("sync", method = Put)]
66 async fn sync(&self, #[http("Position")] position: f64) -> ASCOMResult<()>;
67
68 #[http("interfaceversion", method = Get)]
72 async fn interface_version(&self) -> ASCOMResult<i32> {
73 Ok(4_i32)
74 }
75}