1use crate::CodeBuffer; 2 3/// An element with a name. 4pub trait WithName { 5 /// Gets the name. 6 fn name(&self) -> &str; 7 8 /// Writes the name. 9 fn write_name(&self, b: &mut CodeBuffer) { 10 b.write(self.name()); 11 } 12}