Struct fuchsia_inspect::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

source

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.

source

pub fn create_child(&self, name: impl Into<StringReference>) -> Node

Add a child to this node.

source

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.

source

pub fn atomic_update<F, R>(&self, update_fn: F) -> R
where 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.

source

pub fn record(&self, property: impl InspectType + 'static)

Keeps track of the given property for the lifetime of the node.

source

pub fn clear_recorded(&self)

Drop all recorded data from the node.

source

pub fn create_int( &self, name: impl Into<StringReference>, value: i64 ) -> IntProperty

Creates a new IntProperty with the given name and value.

source

pub fn record_int(&self, name: impl Into<StringReference>, value: i64)

Records a new IntProperty with the given name and value.

source

pub fn create_uint( &self, name: impl Into<StringReference>, value: u64 ) -> UintProperty

Creates a new UintProperty with the given name and value.

source

pub fn record_uint(&self, name: impl Into<StringReference>, value: u64)

Records a new UintProperty with the given name and value.

source

pub fn create_double( &self, name: impl Into<StringReference>, value: f64 ) -> DoubleProperty

Creates a new DoubleProperty with the given name and value.

source

pub fn record_double(&self, name: impl Into<StringReference>, value: f64)

Records a new DoubleProperty with the given name and value.

source

pub fn create_string_array( &self, name: impl Into<StringReference>, slots: usize ) -> StringArrayProperty

Creates a new StringArrayProperty with the given name and slots.

source

pub fn create_int_array( &self, name: impl Into<StringReference>, slots: usize ) -> IntArrayProperty

Creates a new IntArrayProperty with the given name and slots.

source

pub fn create_uint_array( &self, name: impl Into<StringReference>, slots: usize ) -> UintArrayProperty

Creates a new UintArrayProperty with the given name and slots.

source

pub fn create_double_array( &self, name: impl Into<StringReference>, slots: usize ) -> DoubleArrayProperty

Creates a new DoubleArrayProperty with the given name and slots.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn create_lazy_child<F>( &self, name: impl Into<StringReference>, callback: F ) -> LazyNode
where F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,

Creates a new lazy child with the given name and callback. callback will be invoked each time the component’s Inspect is read.

source

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. callback will be invoked each time the component’s Inspect is read.

source

pub fn create_lazy_values<F>( &self, name: impl Into<StringReference>, callback: F ) -> LazyNode
where F: Fn() -> BoxFuture<'static, Result<Inspector, Error>> + Sync + Send + 'static,

Creates a new inline lazy node with the given name and callback. callback will be invoked each time the component’s Inspect is read.

source

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. callback will be invoked each time the component’s Inspect is read.

source

pub fn create_string( &self, name: impl Into<StringReference>, value: impl AsRef<str> ) -> StringProperty

Add a string property to this node.

source

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.

source

pub fn create_bytes( &self, name: impl Into<StringReference>, value: impl AsRef<[u8]> ) -> BytesProperty

Add a byte vector property to this node.

source

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.

source

pub fn create_bool( &self, name: impl Into<StringReference>, value: bool ) -> BoolProperty

Add a bool property to this node.

source

pub fn record_bool(&self, name: impl Into<StringReference>, value: bool)

Creates and saves a bool property for the lifetime of the node.

source

pub fn adopt<T: InspectTypeReparentable>(&self, child: &T) -> Result<(), Error>

Takes a child from its parent and adopts it into its own tree.

Trait Implementations§

source§

impl Debug for Node

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Node

source§

fn default() -> Node

Returns the “default value” for a type. Read more
source§

impl PartialEq for Node

source§

fn eq(&self, other: &Node) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Node

source§

impl InspectType for Node

source§

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Cast the given object into a dyn std::any::Any.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> InspectTypeReparentable for T
where T: InspectTypeInternal,