named_item/namespaced_name.rs
1crate::ix!();
2
3/// Trait for namespacing names.
4pub trait NamespaceName: Named {
5 /// Returns the namespace of the name.
6 fn namespace(&self) -> Cow<'_, str>;
7
8 /// Returns the fully qualified name, including the namespace.
9 fn full_name(&self) -> Cow<'_, str> {
10 Cow::from(format!("{}::{}", self.namespace(), self.name()))
11 }
12}