pub trait IntrospectItem<'a> {
// Required methods
fn key(&self) -> &str;
fn val(&self) -> &dyn Introspect;
}Expand description
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<T>). By having this a trait,
different types can have whatever reference holder needed (MutexGuard, RefMut etc).
Required Methods§
Sourcefn key(&self) -> &str
fn key(&self) -> &str
Should return a descriptive string for the given child. For structures, this would be the field name, for instance.
Sourcefn val(&self) -> &dyn Introspect
fn val(&self) -> &dyn Introspect
The introspectable value of the child.
Implementations on Foreign Types§
Source§impl IntrospectItem<'_> for str
impl IntrospectItem<'_> for str
Source§impl IntrospectItem<'_> for String
impl IntrospectItem<'_> for String
Source§impl<'a, T: Introspect> IntrospectItem<'a> for Ref<'a, T>
impl<'a, T: Introspect> IntrospectItem<'a> for Ref<'a, T>
Implementors§
impl<'a> IntrospectItem<'a> for IntrospectItemSimple<'a>
impl<'a, T: Introspect> IntrospectItem<'a> for IntrospectItemMutex<'a, T>
Available on crate feature
parking_lot only.impl<'a, T: Introspect> IntrospectItem<'a> for IntrospectItemRwLock<'a, T>
Available on crate feature
parking_lot only.