Trait ascom_alpaca::api::Switch

source ·
pub trait Switch: Device + Send + Sync {
    // Provided methods
    async fn max_switch(&self) -> ASCOMResult<i32> { ... }
    async fn can_write(&self, id: u32) -> ASCOMResult<bool> { ... }
    async fn get_switch(&self, id: u32) -> ASCOMResult<bool> { ... }
    async fn get_switch_description(&self, id: u32) -> ASCOMResult<String> { ... }
    async fn get_switch_name(&self, id: u32) -> ASCOMResult<String> { ... }
    async fn get_switch_value(&self, id: u32) -> ASCOMResult<f64> { ... }
    async fn min_switch_value(&self, id: u32) -> ASCOMResult<f64> { ... }
    async fn max_switch_value(&self, id: u32) -> ASCOMResult<f64> { ... }
    async fn set_switch(&self, id: u32, state: bool) -> ASCOMResult { ... }
    async fn set_switch_name(&self, id: u32, name: String) -> ASCOMResult { ... }
    async fn set_switch_value(&self, id: u32, value: f64) -> ASCOMResult { ... }
    async fn switch_step(&self, id: u32) -> ASCOMResult<f64> { ... }
}
Available on crate feature switch only.
Expand description

Switch Specific Methods

Provided Methods§

source

async fn max_switch(&self) -> ASCOMResult<i32>

Returns the number of switch devices managed by this driver. Devices are numbered from 0 to MaxSwitch - 1

source

async fn can_write(&self, id: u32) -> ASCOMResult<bool>

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

source

async fn get_switch(&self, id: u32) -> ASCOMResult<bool>

Return the state of switch device id as a boolean. Devices are numbered from 0 to MaxSwitch - 1

source

async fn get_switch_description(&self, id: u32) -> ASCOMResult<String>

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

source

async fn get_switch_name(&self, id: u32) -> ASCOMResult<String>

Gets the name of the specified switch device. Devices are numbered from 0 to MaxSwitch - 1

source

async fn get_switch_value(&self, id: u32) -> ASCOMResult<f64>

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.

source

async fn min_switch_value(&self, id: u32) -> ASCOMResult<f64>

Gets the minimum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.

source

async fn max_switch_value(&self, id: u32) -> ASCOMResult<f64>

Gets the maximum value of the specified switch device as a double. Devices are numbered from 0 to MaxSwitch - 1.

source

async fn set_switch(&self, id: u32, state: bool) -> ASCOMResult

Sets a switch controller device to the specified state, true or false.

source

async fn set_switch_name(&self, id: u32, name: String) -> ASCOMResult

Sets a switch device name to the specified value.

source

async fn set_switch_value(&self, id: u32, value: f64) -> ASCOMResult

Sets a switch device value to the specified value.

source

async fn switch_step(&self, id: u32) -> ASCOMResult<f64>

Returns the step size that this device supports (the difference between successive values of the device). Devices are numbered from 0 to MaxSwitch - 1.

Trait Implementations§

source§

impl Hash for dyn Switch

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
source§

impl PartialEq<dyn Switch + 'static> for dyn Switch

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for dyn Switch

Implementors§