types: Add write_int() helper

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-10-12 16:51:29 +09:00
parent e19970b5e0
commit 14c3ef0b7e

View file

@ -52,6 +52,13 @@ impl Elem {
.get_integer(0) .get_integer(0)
.expect(&format!("Could not read {}", self.elem_name)) .expect(&format!("Could not read {}", self.elem_name))
} }
pub fn write_int(&mut self, card: &Ctl, value: i32) {
self.val
.set_integer(0, value)
.expect(&format!("Could not set {}", self.elem_name));
helpers::write_ev(card, &mut self.val, &self.elem_name);
}
} }
/** /**