Trait ascom_alpaca::api::Switch
source · pub trait Switch: Device + Send + Sync {
// Provided methods
fn max_switch<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = ASCOMResult<i32>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn can_write<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_switch<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_switch_description<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_switch_name<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn min_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn max_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn set_switch<'life0, 'async_trait>(
&'life0 self,
id: u32,
state: bool
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn set_switch_name<'life0, 'async_trait>(
&'life0 self,
id: u32,
name: String
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn set_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32,
value: f64
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn switch_step<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
switch
only.Expand description
Switch Specific Methods
Provided Methods§
sourcefn max_switch<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = ASCOMResult<i32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn max_switch<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = ASCOMResult<i32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the number of switch devices managed by this driver. Devices are numbered from 0 to MaxSwitch - 1
Definition before the #[async_trait]
expansion:
async fn max_switch(&self) -> ASCOMResult<i32>
sourcefn can_write<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn can_write<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reports if the specified switch device can be written to, default true. This is false if the device cannot be written to, for example a limit switch or a sensor. Devices are numbered from 0 to MaxSwitch - 1
Definition before the #[async_trait]
expansion:
async fn can_write(&self, id: u32) -> ASCOMResult<bool>
sourcefn get_switch<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_switch<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the state of switch device id as a boolean. Devices are numbered from 0 to MaxSwitch - 1
Definition before the #[async_trait]
expansion:
async fn get_switch(&self, id: u32) -> ASCOMResult<bool>
sourcefn get_switch_description<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_switch_description<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the description of the specified switch device. This is to allow a fuller description of the device to be returned, for example for a tool tip. Devices are numbered from 0 to MaxSwitch - 1
Definition before the #[async_trait]
expansion:
async fn get_switch_description(&self, id: u32) -> ASCOMResult<String>
sourcefn get_switch_name<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_switch_name<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the name of the specified switch device. Devices are numbered from 0 to MaxSwitch - 1
Definition before the #[async_trait]
expansion:
async fn get_switch_name(&self, id: u32) -> ASCOMResult<String>
sourcefn get_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1, The value of this switch is expected to be between MinSwitchValue and MaxSwitchValue.
Definition before the #[async_trait]
expansion:
async fn get_switch_value(&self, id: u32) -> ASCOMResult<f64>
sourcefn min_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn min_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the minimum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
Definition before the #[async_trait]
expansion:
async fn min_switch_value(&self, id: u32) -> ASCOMResult<f64>
sourcefn max_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn max_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the maximum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.
Definition before the #[async_trait]
expansion:
async fn max_switch_value(&self, id: u32) -> ASCOMResult<f64>
sourcefn set_switch<'life0, 'async_trait>(
&'life0 self,
id: u32,
state: bool
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_switch<'life0, 'async_trait>(
&'life0 self,
id: u32,
state: bool
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets a switch controller device to the specified state, true or false.
Definition before the #[async_trait]
expansion:
async fn set_switch(&self, id: u32, state: bool) -> ASCOMResult
sourcefn set_switch_name<'life0, 'async_trait>(
&'life0 self,
id: u32,
name: String
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_switch_name<'life0, 'async_trait>(
&'life0 self,
id: u32,
name: String
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets a switch device name to the specified value.
Definition before the #[async_trait]
expansion:
async fn set_switch_name(&self, id: u32, name: String) -> ASCOMResult
sourcefn set_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32,
value: f64
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_switch_value<'life0, 'async_trait>(
&'life0 self,
id: u32,
value: f64
) -> Pin<Box<dyn Future<Output = ASCOMResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets a switch device value to the specified value.
Definition before the #[async_trait]
expansion:
async fn set_switch_value(&self, id: u32, value: f64) -> ASCOMResult
sourcefn switch_step<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn switch_step<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = ASCOMResult<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the step size that this device supports (the difference between successive values of the device). Devices are numbered from 0 to MaxSwitch - 1.
Definition before the #[async_trait]
expansion:
async fn switch_step(&self, id: u32) -> ASCOMResult<f64>