Struct fuchsia_inspect::types::Node
source · pub struct Node { /* private fields */ }
Expand description
Inspect Node data type.
NOTE: do not rely on PartialEq implementation for true comparison. Instead leverage the reader.
NOTE: Operations on a Default value are no-ops.
Implementations§
source§impl Node
impl Node
sourcepub fn clone_weak(&self) -> Node
pub fn clone_weak(&self) -> Node
Create a weak reference to the original node. All operations on a weak reference have identical semantics to the original node for as long as the original node is live. After that, all operations are no-ops.
sourcepub fn create_child(&self, name: impl Into<StringReference>) -> Node
pub fn create_child(&self, name: impl Into<StringReference>) -> Node
Add a child to this node.
sourcepub fn record_child<F>(&self, name: impl Into<StringReference>, initialize: F)where
F: FnOnce(&Node),
pub fn record_child<F>(&self, name: impl Into<StringReference>, initialize: F)where F: FnOnce(&Node),
Creates and keeps track of a child with the given name
.
sourcepub fn atomic_update<F, R>(&self, update_fn: F) -> Rwhere
F: FnOnce(&Node) -> R,
pub fn atomic_update<F, R>(&self, update_fn: F) -> Rwhere F: FnOnce(&Node) -> R,
Takes a function to execute as under a single lock of the Inspect VMO. This function
receives a reference to the Node
where this is called.
sourcepub fn record(&self, property: impl InspectType + 'static)
pub fn record(&self, property: impl InspectType + 'static)
Keeps track of the given property for the lifetime of the node.
sourcepub fn clear_recorded(&self)
pub fn clear_recorded(&self)
Drop all recorded data from the node.
sourcepub fn create_int(
&self,
name: impl Into<StringReference>,
value: i64
) -> IntProperty
pub fn create_int( &self, name: impl Into<StringReference>, value: i64 ) -> IntProperty
Creates a new IntProperty
with the given name
and value
.
sourcepub fn record_int(&self, name: impl Into<StringReference>, value: i64)
pub fn record_int(&self, name: impl Into<StringReference>, value: i64)
Records a new IntProperty
with the given name
and value
.
sourcepub fn create_uint(
&self,
name: impl Into<StringReference>,
value: u64
) -> UintProperty
pub fn create_uint( &self, name: impl Into<StringReference>, value: u64 ) -> UintProperty
Creates a new UintProperty
with the given name
and value
.
sourcepub fn record_uint(&self, name: impl Into<StringReference>, value: u64)
pub fn record_uint(&self, name: impl Into<StringReference>, value: u64)
Records a new UintProperty
with the given name
and value
.
sourcepub fn create_double(
&self,
name: impl Into<StringReference>,
value: f64
) -> DoubleProperty
pub fn create_double( &self, name: impl Into<StringReference>, value: f64 ) -> DoubleProperty
Creates a new DoubleProperty
with the given name
and value
.
sourcepub fn record_double(&self, name: impl Into<StringReference>, value: f64)
pub fn record_double(&self, name: impl Into<StringReference>, value: f64)
Records a new DoubleProperty
with the given name
and value
.
sourcepub fn create_string_array(
&self,
name: impl Into<StringReference>,
slots: usize
) -> StringArrayProperty
pub fn create_string_array( &self, name: impl Into<StringReference>, slots: usize ) -> StringArrayProperty
Creates a new StringArrayProperty
with the given name
and slots
.
sourcepub fn create_int_array(
&self,
name: impl Into<StringReference>,
slots: usize
) -> IntArrayProperty
pub fn create_int_array( &self, name: impl Into<StringReference>, slots: usize ) -> IntArrayProperty
Creates a new IntArrayProperty
with the given name
and slots
.
sourcepub fn create_uint_array(
&self,
name: impl Into<StringReference>,
slots: usize
) -> UintArrayProperty
pub fn create_uint_array( &self, name: impl Into<StringReference>, slots: usize ) -> UintArrayProperty
Creates a new UintArrayProperty
with the given name
and slots
.
sourcepub fn create_double_array(
&self,
name: impl Into<StringReference>,
slots: usize
) -> DoubleArrayProperty
pub fn create_double_array( &self, name: impl Into<StringReference>, slots: usize ) -> DoubleArrayProperty
Creates a new DoubleArrayProperty
with the given name
and slots
.
sourcepub fn create_int_linear_histogram(
&self,
name: impl Into<StringReference>,
params: LinearHistogramParams<i64>
) -> IntLinearHistogramProperty
pub fn create_int_linear_histogram( &self, name: impl Into<StringReference>, params: LinearHistogramParams<i64> ) -> IntLinearHistogramProperty
Creates a new IntLinearHistogramProperty
with the given name
and params
.
sourcepub fn create_uint_linear_histogram(
&self,
name: impl Into<StringReference>,
params: LinearHistogramParams<u64>
) -> UintLinearHistogramProperty
pub fn create_uint_linear_histogram( &self, name: impl Into<StringReference>, params: LinearHistogramParams<u64> ) -> UintLinearHistogramProperty
Creates a new UintLinearHistogramProperty
with the given name
and params
.
sourcepub fn create_double_linear_histogram(
&self,
name: impl Into<StringReference>,
params: LinearHistogramParams<f64>
) -> DoubleLinearHistogramProperty
pub fn create_double_linear_histogram( &self, name: impl Into<StringReference>, params: LinearHistogramParams<f64> ) -> DoubleLinearHistogramProperty
Creates a new DoubleLinearHistogramProperty
with the given name
and params
.
sourcepub fn create_int_exponential_histogram(
&self,
name: impl Into<StringReference>,
params: ExponentialHistogramParams<i64>
) -> IntExponentialHistogramProperty
pub fn create_int_exponential_histogram( &self, name: impl Into<StringReference>, params: ExponentialHistogramParams<i64> ) -> IntExponentialHistogramProperty
Creates a new IntExponentialHistogramProperty
with the given name
and params
.
sourcepub fn create_uint_exponential_histogram(
&self,
name: impl Into<StringReference>,
params: ExponentialHistogramParams<u64>
) -> UintExponentialHistogramProperty
pub fn create_uint_exponential_histogram( &self, name: impl Into<StringReference>, params: ExponentialHistogramParams<u64> ) -> UintExponentialHistogramProperty
Creates a new UintExponentialHistogramProperty
with the given name
and params
.
sourcepub fn create_double_exponential_histogram(
&self,
name: impl Into<StringReference>,
params: ExponentialHistogramParams<f64>
) -> DoubleExponentialHistogramProperty
pub fn create_double_exponential_histogram( &self, name: impl Into<StringReference>, params: ExponentialHistogramParams<f64> ) -> DoubleExponentialHistogramProperty
Creates a new DoubleExponentialHistogramProperty
with the given name
and params
.
sourcepub fn create_lazy_child<F>(
&self,
name: impl Into<StringReference>,
callback: F
) -> LazyNodewhere
F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,
pub fn create_lazy_child<F>( &self, name: impl Into<StringReference>, callback: F ) -> LazyNodewhere F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,
Creates a new lazy child with the given name
and callback
.
sourcepub fn record_lazy_child<F>(
&self,
name: impl Into<StringReference>,
callback: F
)where
F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,
pub fn record_lazy_child<F>( &self, name: impl Into<StringReference>, callback: F )where F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,
Records a new lazy child with the given name
and callback
.
sourcepub fn create_lazy_values<F>(
&self,
name: impl Into<StringReference>,
callback: F
) -> LazyNodewhere
F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,
pub fn create_lazy_values<F>( &self, name: impl Into<StringReference>, callback: F ) -> LazyNodewhere F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,
Creates a new inline lazy node with the given name
and callback
.
sourcepub fn record_lazy_values<F>(
&self,
name: impl Into<StringReference>,
callback: F
)where
F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,
pub fn record_lazy_values<F>( &self, name: impl Into<StringReference>, callback: F )where F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,
Records a new inline lazy node with the given name
and callback
.
sourcepub fn create_string(
&self,
name: impl Into<StringReference>,
value: impl AsRef<str>
) -> StringProperty
pub fn create_string( &self, name: impl Into<StringReference>, value: impl AsRef<str> ) -> StringProperty
Add a string property to this node.
sourcepub fn record_string(
&self,
name: impl Into<StringReference>,
value: impl AsRef<str>
)
pub fn record_string( &self, name: impl Into<StringReference>, value: impl AsRef<str> )
Creates and saves a string property for the lifetime of the node.
sourcepub fn create_bytes(
&self,
name: impl Into<StringReference>,
value: impl AsRef<[u8]>
) -> BytesProperty
pub fn create_bytes( &self, name: impl Into<StringReference>, value: impl AsRef<[u8]> ) -> BytesProperty
Add a byte vector property to this node.
sourcepub fn record_bytes(
&self,
name: impl Into<StringReference>,
value: impl AsRef<[u8]>
)
pub fn record_bytes( &self, name: impl Into<StringReference>, value: impl AsRef<[u8]> )
Creates and saves a bytes property for the lifetime of the node.
sourcepub fn create_bool(
&self,
name: impl Into<StringReference>,
value: bool
) -> BoolProperty
pub fn create_bool( &self, name: impl Into<StringReference>, value: bool ) -> BoolProperty
Add a bool property to this node.
sourcepub fn record_bool(&self, name: impl Into<StringReference>, value: bool)
pub fn record_bool(&self, name: impl Into<StringReference>, value: bool)
Creates and saves a bool property for the lifetime of the node.