fuchsia_inspect

Struct 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. callback is expected to create a new Inspector and return it; its contents will be rooted at the intended location (the self node).

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. callback is expected to create a new Inspector and return it; its contents will be rooted at the intended location (the self node).

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. callback is expected to create a new Inspector and return it; its contents will be rooted at the intended location (the self node).

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. callback is expected to create a new Inspector and return it; its contents will be rooted at the intended location (the self node).

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.

Source

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§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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 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> 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, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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> 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>,

Source§

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>,

Source§

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,