asimov_core

Trait MaybeNamed

source
pub trait MaybeNamed {
    // Required method
    fn name(&self) -> Option<Cow<'_, str>>;

    // Provided method
    fn is_named(&self) -> bool { ... }
}
Expand description

A trait for objects that may have a name.

Required Methods§

source

fn name(&self) -> Option<Cow<'_, str>>

Returns the name, if any, of the object.

Provided Methods§

source

fn is_named(&self) -> bool

Checks whether the object has a name.

Implementors§