1use crate::rust::Var; 2use crate::{CodeBuffer, Expression}; 3 4/// An element with a variable. 5pub trait WithVar { 6 /// Gets the variable. 7 fn var(&self) -> &Var; 8 9 /// Writes the variable. 10 fn write_var(&self, b: &mut CodeBuffer) { 11 self.var().write(b); 12 } 13}