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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.