Crate fuchsia_inspect_derive

Source
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§

  • AttachError denotes a broken data acquisition invariant, such as when a mutex is held during attachment.
  • 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.
  • 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.
  • The inspect data of an Option gets the same inspect representation as T, but can also be absent.

Traits§

  • 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 IOwned smart pointers. Generic implementations are also provided for interior mutability wrappers whose inner type also implement Inspect, 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).
  • Renders inspect state. This trait should be implemented with a relevant constraint on the base type.
  • Provides a custom inspect fuchsia_inspect subtree for a type which is created, updated and removed in a single step. (It does NOT support per-field updates.)
  • Extension trait for types that #[derive(Inspect)] (or implements Inspect for &mut T some other way), providing a convenient way of attaching to inspect during construction. See the Inspect trait for more details.

Type Aliases§

  • An Inspect smart pointer for a type B, which renders the debug output of B as a string property.
  • An Inspect smart pointer for a type B, which renders an inspect subtree as defined by B: Unit.

Derive Macros§

  • The Unit derive macro can be applied to named structs in order to generate an implementation of the Unit trait. The name of the field corresponds to the inspect node or property name, and the type of the field must also implement Unit. Implementations of Unit are supplied for most primitives and String.
  • The Unit derive macro can be applied to named structs in order to generate an implementation of the Unit trait. The name of the field corresponds to the inspect node or property name, and the type of the field must also implement Unit. Implementations of Unit are supplied for most primitives and String.