fuchsia_inspect_derive

Trait Unit

Source
pub trait Unit {
    type Data: Default;

    // Required methods
    fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data;
    fn inspect_update(&self, data: &mut Self::Data);
}
Expand description

Provides a custom inspect fuchsia_inspect subtree for a type which is created, updated and removed in a single step. (It does NOT support per-field updates.)

Required Associated Types§

Source

type Data: Default

This associated type owns a subtree (either a property or a node) of a parent inspect node. May be nested. When dropped, the subtree is detached from the parent. Default is required such that a detached state can be constructed. The base inspect node and property types implement default.

Required Methods§

Source

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Insert an inspect subtree at parent[name] with values from self and return the inspect data.

Source

fn inspect_update(&self, data: &mut Self::Data)

Update the inspect subtree owned by the inspect data with values from self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Unit for bool

Source§

type Data = BoolProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for f32

Source§

type Data = DoubleProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for f64

Source§

type Data = DoubleProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for i8

Source§

type Data = IntProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for i16

Source§

type Data = IntProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for i32

Source§

type Data = IntProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for i64

Source§

type Data = IntProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for isize

Source§

type Data = IntProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for u8

Source§

type Data = UintProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for u16

Source§

type Data = UintProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for u32

Source§

type Data = UintProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for u64

Source§

type Data = UintProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for usize

Source§

type Data = UintProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for String

Source§

type Data = StringProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl Unit for Vec<u8>

Source§

type Data = BytesProperty

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Source§

impl<T: Unit> Unit for Option<T>

Source§

type Data = OptionData<T>

Source§

fn inspect_create(&self, parent: &Node, name: impl AsRef<str>) -> Self::Data

Source§

fn inspect_update(&self, data: &mut Self::Data)

Implementors§