ascom_alpaca/api/
safety_monitor.rs

1use super::Device;
2use crate::ASCOMResult;
3use macro_rules_attribute::apply;
4
5/// SafetyMonitor Specific Methods.
6#[apply(rpc_trait)]
7pub trait SafetyMonitor: Device + Send + Sync {
8    /// Indicates whether the monitored state is safe for use.
9    ///
10    /// True if the state is safe, False if it is unsafe.
11    #[http("issafe", method = Get, device_state = IsSafe)]
12    async fn is_safe(&self) -> ASCOMResult<bool>;
13
14    /// This method returns the version of the ASCOM device interface contract to which this device complies.
15    ///
16    /// Only one interface version is current at a moment in time and all new devices should be built to the latest interface version. Applications can choose which device interface versions they support and it is in their interest to support  previous versions as well as the current version to ensure thay can use the largest number of devices.
17    #[http("interfaceversion", method = Get)]
18    async fn interface_version(&self) -> ASCOMResult<i32> {
19        Ok(3_i32)
20    }
21}