Trait fuchsia_inspect_derive::Unit
source · pub trait Unit {
type Data: Default;
// Required methods
fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data;
fn inspect_update(&self, data: &mut Self::Data);
}
Expand description
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.)
Required Associated Types§
sourcetype Data: Default
type Data: Default
This associated type owns a subtree (either a property or a node) of a parent inspect node. May be nested. When dropped, the subtree is detached from the parent. Default is required such that a detached state can be constructed. The base inspect node and property types implement default.
Required Methods§
sourcefn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data
fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data
Insert an inspect subtree at parent[name]
with values from self
and return
the inspect data.
sourcefn inspect_update(&self, data: &mut Self::Data)
fn inspect_update(&self, data: &mut Self::Data)
Update the inspect subtree owned by the inspect data with values from self.
Object Safety§
This trait is not object safe.