Expand description
Provides utilities on top of regular inspect properties to enable convenient features such as:
-
Directly mutating a value and dumping it to inspect
use fuchsia_inspect::component; use fuchsia_inspect::contrib::inspectable::InspectableU64; let inspectable = InspectableU64::new(0, component::inspector::root(), "foo"); *inspectable.get_mut() += 1; // The value of the u64 is 1 now and it was updated automatically in the inspect vmo.
-
Dump lengths automatically
use fuchsia_inspect::component; use fuchsia_inspect::contrib::inspectable::InspectableLen; let inspectable = InspectableLen::new(vec![0], component::inspector::root(), "foo"); // The value of the vector is [0] and the value in the inspect vmo under the foo property // is 1. *inspectable.get_mut().push(3); // The value of the vector is [0, 3] and the value in the inspect vmo under the foo property // is 2.
-
Dump debug representations automatically, etc.
use fuchsia_inspect::component; use fuchsia_inspect::contrib::inspectable::InspectableDebugString; let inspectable = InspectableDebugString::new(vec![0], component::inspector::root(), "foo"); // The value of the vector is vec![0] and the value in the inspect vmo under the foo property // is the debug string of the vector "[0]". *inspectable.get_mut().push(3); // The value of the vector is vec![0, 3] and the value in the inspect vmo under the foo // property is the debug string of the vector "[0, 3]".
Structs§
- Generic wrapper for exporting variables via Inspect. Mutations to the wrapped
value
occur through anInspectableGuard
, which notifies thewatcher
whenDrop
ped, transparently keeping the Inspect state up-to-date. - Exports via an Inspect
StringProperty
theDebug
representation of the wrappedvalue
. - Calls self.watcher.watch(self.value) when dropped.
- Exports via an Inspect
UintProperty
thelen
of the wrapped container. - Exports via an Inspect
UintProperty
au64
. Useful because the wrappedu64
value can be read.
Traits§
- Trait implemented by types that can provide a length. Values used for
InspectableLen
must implement this. - Used for exporting an
[Inspectable
]Inspectable’s wrapped value .
Type Aliases§
- Exports via an Inspect
StringProperty
theDebug
representation of the wrapped valueV
. - Exports via an Inspect
UintProperty
thelen
of the wrapped valueV
. - Exports via an Inspect
UintProperty
au64
. Useful because the wrappedu64
value can be read.