use configurable as a key
This commit is contained in:
parent
21e269bc43
commit
5b3347bb00
1 changed files with 20 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use std::{collections::VecDeque, ops::{Div, Range, Sub}};
|
||||
use std::{collections::VecDeque, ops::{Deref, Div, Index, Range, Sub}};
|
||||
|
||||
use common::{CamState, ControlPacket, SensorData};
|
||||
use anyhow::Result;
|
||||
|
|
@ -22,7 +22,7 @@ impl AutoInterface {
|
|||
/// request auto enable, fails if the driver does not grant it
|
||||
pub fn enable(&self) -> Result<()> {unimplemented!()}
|
||||
pub fn enabled(&self) -> bool {unimplemented!()}
|
||||
pub fn auto_conf(&self) -> AutoConfig {unimplemented!()}
|
||||
pub fn conf(&self, key: &'static Configurable) -> f32 {unimplemented!()}
|
||||
fn send_message(&self, message: String) {unimplemented!()}
|
||||
}
|
||||
|
||||
|
|
@ -53,6 +53,14 @@ impl Configurable {
|
|||
}
|
||||
}
|
||||
|
||||
impl Deref for Configurable {
|
||||
type Target = str;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
self.name
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Configurable {
|
||||
fn default() -> Self {
|
||||
Self { name: Default::default(), description: Default::default(), default: Default::default(), min: 0.0, max: 1.0 }
|
||||
|
|
|
|||
Loading…
Reference in a new issue