[][src]Trait savefile::IntrospectItem

pub trait IntrospectItem<'a> {
    fn key(&self) -> &str;
fn val(&self) -> &dyn Introspect; }

A child of an object implementing Introspect. Is a key-value pair. The only reason this is not simply (String, &dyn Introspect) is that Mutex wouldn't be introspectable in that case. Mutex needs something like (String, MutexGuard). By having this a trait, different types can have whatever reference holder needed (MutexGuard, RefMut etc).

Required methods

fn key(&self) -> &str

Should return a descriptive string for the given child. For structures, this would be the field name, for instance.

fn val(&self) -> &dyn Introspect

The introspectable value of the child.

Loading content...

Implementors

impl<'a> IntrospectItem<'a> for IntrospectItemSimple<'a>[src]

impl<'a, T: Introspect> IntrospectItem<'a> for IntrospectItemMutex<'a, T>[src]

impl<'a, T: Introspect> IntrospectItem<'a> for IntrospectItemRwLock<'a, T>[src]

impl<'a, T: Introspect> IntrospectItem<'a> for IntrospectItemStdMutex<'a, T>[src]

Loading content...