Expand description
This crate provides types, traits and macros for ergonomic
interactions with fuchsia_inspect. Proc macros are originally defined
in a separate crate, but re-exported here. Users should depend directly
on this crate.
Structs§
- Attach
Error - AttachError denotes a broken data acquisition invariant, such as when a mutex is held during attachment.
- IOwned
- Generic smart pointer which owns an inspect subtree (either a Node or a Property) for the duration of its lifetime. It dereferences to the user-provided base type (similar to Arc and other smart pointers). This type should rarely be used declared explictly. Rather, a specific smart pointer (such as IValue) should be used.
- IOwned
MutGuard - A RAII implementation of a scoped guard of an IOwned smart pointer. When this structure is dropped (falls out of scope), the new inspect state will be published.
- Option
Data - The inspect data of an Option
gets the same inspect representation as T, but can also be absent.
Traits§
- Inspect
- A trait for types that can be inspected using fuchsia_inspect and that
maintain their inspect state during their lifetime. Notably, this trait is
implemented for most fuchsia_inspect properties and the
IOwnedsmart pointers. Generic implementations are also provided for interior mutability wrappers whose inner type also implementInspect, such as RefCell and various Mutex types. This method should generally be implemented for a mutable reference (or a regular reference if the type has interior mutability). - Render
- Renders inspect state. This trait should be implemented with a relevant constraint on the base type.
- Unit
- Provides a custom inspect
fuchsia_inspectsubtree for a type which is created, updated and removed in a single step. (It does NOT support per-field updates.) - With
Inspect - Extension trait for types that #[derive(Inspect)] (or implements
Inspect for &mut Tsome other way), providing a convenient way of attaching to inspect during construction. See theInspecttrait for more details.
Type Aliases§
- IDebug
- An
Inspectsmart pointer for a typeB, which renders the debug output ofBas a string property. - IValue
- An
Inspectsmart pointer for a typeB, which renders an inspect subtree as defined byB: Unit.
Derive Macros§
- Inspect
- The
Unitderive macro can be applied to named structs in order to generate an implementation of theUnittrait. The name of the field corresponds to the inspect node or property name, and the type of the field must also implementUnit. Implementations ofUnitare supplied for most primitives andString. - Unit
- The
Unitderive macro can be applied to named structs in order to generate an implementation of theUnittrait. The name of the field corresponds to the inspect node or property name, and the type of the field must also implementUnit. Implementations ofUnitare supplied for most primitives andString.