macro_rules! impl_common_name_methods {
($type_desc:literal) => {
#[doc = concat!("Gets the name of this ", $type_desc, ".")]
#[inline(always)]
pub fn name(&self) -> Option<&str> {
self.metadata.name()
}
#[doc = concat!("Sets the name of this ", $type_desc, ".")]
#[doc = concat!("* `name` - The name to set for this ", $type_desc)]
#[inline(always)]
pub fn set_name(&mut self, name: &str) {
self.metadata.set_name(name);
}
#[doc = concat!("Clears the name of this ", $type_desc, ".")]
#[inline(always)]
pub fn clear_name(&mut self) {
self.metadata.clear_name();
}
#[doc = concat!("Sets the name of this ", $type_desc, " and returns it.")]
#[doc = concat!("* `name` - The name to set for this ", $type_desc)]
#[doc = concat!("This ", $type_desc, " with the supplied name.")]
#[inline(always)]
pub fn with_name(mut self, name: &str) -> Self {
self.metadata.set_name(name);
self
}
};
}
pub(crate) use impl_common_name_methods;