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<'a>(&self, name: impl Into<Cow<'a, str>>) -> Node
 
pub fn create_child<'a>(&self, name: impl Into<Cow<'a, str>>) -> Node
Add a child to this node.
Sourcepub fn record_child<'a, F>(&self, name: impl Into<Cow<'a, str>>, initialize: F)
 
pub fn record_child<'a, F>(&self, name: impl Into<Cow<'a, str>>, initialize: F)
Creates and keeps track of a child with the given name.
Sourcepub fn atomic_update<F, R>(&self, update_fn: F) -> R
 
pub fn atomic_update<F, R>(&self, update_fn: F) -> 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<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    value: i64,
) -> IntProperty
 
pub fn create_int<'a>( &self, name: impl Into<Cow<'a, str>>, value: i64, ) -> IntProperty
Creates a new IntProperty with the given name and value.
Sourcepub fn record_int<'a>(&self, name: impl Into<Cow<'a, str>>, value: i64)
 
pub fn record_int<'a>(&self, name: impl Into<Cow<'a, str>>, value: i64)
Records a new IntProperty with the given name and value.
Sourcepub fn create_uint<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    value: u64,
) -> UintProperty
 
pub fn create_uint<'a>( &self, name: impl Into<Cow<'a, str>>, value: u64, ) -> UintProperty
Creates a new UintProperty with the given name and value.
Sourcepub fn record_uint<'a>(&self, name: impl Into<Cow<'a, str>>, value: u64)
 
pub fn record_uint<'a>(&self, name: impl Into<Cow<'a, str>>, value: u64)
Records a new UintProperty with the given name and value.
Sourcepub fn create_double<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    value: f64,
) -> DoubleProperty
 
pub fn create_double<'a>( &self, name: impl Into<Cow<'a, str>>, value: f64, ) -> DoubleProperty
Creates a new DoubleProperty with the given name and value.
Sourcepub fn record_double<'a>(&self, name: impl Into<Cow<'a, str>>, value: f64)
 
pub fn record_double<'a>(&self, name: impl Into<Cow<'a, str>>, value: f64)
Records a new DoubleProperty with the given name and value.
Sourcepub fn create_string_array<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    slots: usize,
) -> StringArrayProperty
 
pub fn create_string_array<'a>( &self, name: impl Into<Cow<'a, str>>, slots: usize, ) -> StringArrayProperty
Creates a new StringArrayProperty with the given name and slots.
Sourcepub fn create_int_array<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    slots: usize,
) -> IntArrayProperty
 
pub fn create_int_array<'a>( &self, name: impl Into<Cow<'a, str>>, slots: usize, ) -> IntArrayProperty
Creates a new IntArrayProperty with the given name and slots.
Sourcepub fn create_uint_array<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    slots: usize,
) -> UintArrayProperty
 
pub fn create_uint_array<'a>( &self, name: impl Into<Cow<'a, str>>, slots: usize, ) -> UintArrayProperty
Creates a new UintArrayProperty with the given name and slots.
Sourcepub fn create_double_array<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    slots: usize,
) -> DoubleArrayProperty
 
pub fn create_double_array<'a>( &self, name: impl Into<Cow<'a, str>>, slots: usize, ) -> DoubleArrayProperty
Creates a new DoubleArrayProperty with the given name and slots.
Sourcepub fn create_int_linear_histogram<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    params: LinearHistogramParams<i64>,
) -> IntLinearHistogramProperty
 
pub fn create_int_linear_histogram<'a>( &self, name: impl Into<Cow<'a, str>>, params: LinearHistogramParams<i64>, ) -> IntLinearHistogramProperty
Creates a new IntLinearHistogramProperty with the given name and params.
Sourcepub fn create_uint_linear_histogram<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    params: LinearHistogramParams<u64>,
) -> UintLinearHistogramProperty
 
pub fn create_uint_linear_histogram<'a>( &self, name: impl Into<Cow<'a, str>>, params: LinearHistogramParams<u64>, ) -> UintLinearHistogramProperty
Creates a new UintLinearHistogramProperty with the given name and params.
Sourcepub fn create_double_linear_histogram<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    params: LinearHistogramParams<f64>,
) -> DoubleLinearHistogramProperty
 
pub fn create_double_linear_histogram<'a>( &self, name: impl Into<Cow<'a, str>>, params: LinearHistogramParams<f64>, ) -> DoubleLinearHistogramProperty
Creates a new DoubleLinearHistogramProperty with the given name and params.
Sourcepub fn create_int_exponential_histogram<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    params: ExponentialHistogramParams<i64>,
) -> IntExponentialHistogramProperty
 
pub fn create_int_exponential_histogram<'a>( &self, name: impl Into<Cow<'a, str>>, params: ExponentialHistogramParams<i64>, ) -> IntExponentialHistogramProperty
Creates a new IntExponentialHistogramProperty with the given name and params.
Sourcepub fn create_uint_exponential_histogram<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    params: ExponentialHistogramParams<u64>,
) -> UintExponentialHistogramProperty
 
pub fn create_uint_exponential_histogram<'a>( &self, name: impl Into<Cow<'a, str>>, params: ExponentialHistogramParams<u64>, ) -> UintExponentialHistogramProperty
Creates a new UintExponentialHistogramProperty with the given name and params.
Sourcepub fn create_double_exponential_histogram<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    params: ExponentialHistogramParams<f64>,
) -> DoubleExponentialHistogramProperty
 
pub fn create_double_exponential_histogram<'a>( &self, name: impl Into<Cow<'a, str>>, params: ExponentialHistogramParams<f64>, ) -> DoubleExponentialHistogramProperty
Creates a new DoubleExponentialHistogramProperty with the given name and params.
Sourcepub fn create_lazy_child<'a, F>(
    &self,
    name: impl Into<Cow<'a, str>>,
    callback: F,
) -> LazyNode
 
pub fn create_lazy_child<'a, F>( &self, name: impl Into<Cow<'a, str>>, callback: F, ) -> LazyNode
Creates a new lazy child with the given name and callback.
callback will be invoked each time the component’s Inspect is read.
callback is expected to create a new Inspector and return it;
its contents will be rooted at the intended location (the self node).
Sourcepub fn record_lazy_child<'a, F>(
    &self,
    name: impl Into<Cow<'a, str>>,
    callback: F,
)
 
pub fn record_lazy_child<'a, F>( &self, name: impl Into<Cow<'a, str>>, callback: F, )
Records a new lazy child with the given name and callback.
callback will be invoked each time the component’s Inspect is read.
callback is expected to create a new Inspector and return it;
its contents will be rooted at the intended location (the self node).
Sourcepub fn create_lazy_child_with_thread_local<'a, F>(
    &self,
    name: impl Into<Cow<'a, str>>,
    callback: F,
) -> LazyNode
 
pub fn create_lazy_child_with_thread_local<'a, F>( &self, name: impl Into<Cow<'a, str>>, callback: F, ) -> LazyNode
Creates a new lazy child with the given name and callback.
callback will be invoked each time the component’s Inspect is read.
callback is expected to create a new Inspector and return it;
its contents will be rooted at the intended location (the self node).
The inspector referenced by this function should not be sent between threads, or it may panic.
Sourcepub fn record_lazy_child_with_thread_local<'a, F>(
    &self,
    name: impl Into<Cow<'a, str>>,
    callback: F,
)
 
pub fn record_lazy_child_with_thread_local<'a, F>( &self, name: impl Into<Cow<'a, str>>, callback: F, )
Records a new lazy child with the given name and callback.
callback will be invoked each time the component’s Inspect is read.
callback is expected to create a new Inspector and return it;
its contents will be rooted at the intended location (the self node).
The inspector referenced by this function should not be sent between threads, or it may panic.
Sourcepub fn create_lazy_values<'a, F>(
    &self,
    name: impl Into<Cow<'a, str>>,
    callback: F,
) -> LazyNode
 
pub fn create_lazy_values<'a, F>( &self, name: impl Into<Cow<'a, str>>, callback: F, ) -> LazyNode
Creates a new inline lazy node with the given name and callback.
callback will be invoked each time the component’s Inspect is read.
callback is expected to create a new Inspector and return it;
its contents will be rooted at the intended location (the self node).
Sourcepub fn record_lazy_values<'a, F>(
    &self,
    name: impl Into<Cow<'a, str>>,
    callback: F,
)
 
pub fn record_lazy_values<'a, F>( &self, name: impl Into<Cow<'a, str>>, callback: F, )
Records a new inline lazy node with the given name and callback.
callback will be invoked each time the component’s Inspect is read.
callback is expected to create a new Inspector and return it;
its contents will be rooted at the intended location (the self node).
Sourcepub fn create_lazy_values_with_thread_local<'a, F>(
    &self,
    name: impl Into<Cow<'a, str>>,
    callback: F,
) -> LazyNode
 
pub fn create_lazy_values_with_thread_local<'a, F>( &self, name: impl Into<Cow<'a, str>>, callback: F, ) -> LazyNode
Creates a new inline lazy node with the given name and callback.
callback will be invoked each time the component’s Inspect is read.
callback is expected to create a new Inspector and return it;
its contents will be rooted at the intended location (the self node).
The inspector referenced by this function should not be sent between threads, or it may panic.
Sourcepub fn record_lazy_values_with_thread_local<'a, F>(
    &self,
    name: impl Into<Cow<'a, str>>,
    callback: F,
)
 
pub fn record_lazy_values_with_thread_local<'a, F>( &self, name: impl Into<Cow<'a, str>>, callback: F, )
Records a new inline lazy node with the given name and callback.
callback will be invoked each time the component’s Inspect is read.
callback is expected to create a new Inspector and return it;
its contents will be rooted at the intended location (the self node).
The inspector referenced by this function should not be sent between threads, or it may panic.
Sourcepub fn create_string<'a, 'b>(
    &self,
    name: impl Into<Cow<'a, str>>,
    value: impl Into<Cow<'b, str>>,
) -> StringProperty
 
pub fn create_string<'a, 'b>( &self, name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'b, str>>, ) -> StringProperty
Add a string property to this node.
Sourcepub fn record_string<'a, 'b>(
    &self,
    name: impl Into<Cow<'a, str>>,
    value: impl Into<Cow<'b, str>>,
)
 
pub fn record_string<'a, 'b>( &self, name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'b, str>>, )
Creates and saves a string property for the lifetime of the node.
Sourcepub fn create_bytes<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    value: impl AsRef<[u8]>,
) -> BytesProperty
 
pub fn create_bytes<'a>( &self, name: impl Into<Cow<'a, str>>, value: impl AsRef<[u8]>, ) -> BytesProperty
Add a byte vector property to this node.
Sourcepub fn record_bytes<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    value: impl AsRef<[u8]>,
)
 
pub fn record_bytes<'a>( &self, name: impl Into<Cow<'a, str>>, value: impl AsRef<[u8]>, )
Creates and saves a bytes property for the lifetime of the node.
Sourcepub fn create_bool<'a>(
    &self,
    name: impl Into<Cow<'a, str>>,
    value: bool,
) -> BoolProperty
 
pub fn create_bool<'a>( &self, name: impl Into<Cow<'a, str>>, value: bool, ) -> BoolProperty
Add a bool property to this node.
Sourcepub fn record_bool<'a>(&self, name: impl Into<Cow<'a, str>>, value: bool)
 
pub fn record_bool<'a>(&self, name: impl Into<Cow<'a, str>>, value: bool)
Creates and saves a bool property for the lifetime of the node.
Sourcepub fn adopt<T: InspectTypeReparentable>(&self, child: &T) -> Result<(), Error>
 
pub fn adopt<T: InspectTypeReparentable>(&self, child: &T) -> Result<(), Error>
Takes a child from its parent and adopts it into its own tree.
Sourcepub fn forget(&self)
 
pub fn forget(&self)
Removes this node from the Inspect tree. Typically, just dropping the Node must be preferred. However, this is a convenience method meant for power user implementations that need more control over the lifetime of a Node. For example, by being able to remove the node from a weak clone of it.
Trait Implementations§
impl Eq for Node
impl InspectType for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl !RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
    D: ResourceDialect,
 
impl<T, D> Encode<Ambiguous1, D> for Twhere
    D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
    D: ResourceDialect,
 
impl<T, D> Encode<Ambiguous2, D> for Twhere
    D: ResourceDialect,
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more