named_item/
namespaced_name.rs

1
2
3
4
5
6
7
8
9
10
11
12
crate::ix!();

/// Trait for namespacing names.
pub trait NamespaceName: Named {
    /// Returns the namespace of the name.
    fn namespace(&self) -> Cow<'_, str>;

    /// Returns the fully qualified name, including the namespace.
    fn full_name(&self) -> Cow<'_, str> {
        Cow::from(format!("{}::{}", self.namespace(), self.name()))
    }
}