pub trait InspectWritable: Sized {
    type NodeType: InspectWritableNode<Self>;

    // Required methods
    fn create(&self, node: Node) -> Self::NodeType;
    fn record(&self, node: &Node);
}
Expand description

A datatype that may be written to an inspect type. This trait can be automatically derived for structs composed of inspect-compatible fields, i.e. signed integers, unsigned integers, or types implementing the Debug trait.

Required Associated Types§

source

type NodeType: InspectWritableNode<Self>

The wrapper type returned from create calls.

Required Methods§

source

fn create(&self, node: Node) -> Self::NodeType

Writes the contents of the struct into inspect fields on the supplied node. Field names match the fields in the struct. This function uses the create* methods in the inspect API and returns an InspectWriteableNode that may be used to update the fields in the future.

source

fn record(&self, node: &Node)

Writes the contents of the struct into inspect fields on the supplied node. Field names match the fields in the struct. This function uses the record* methods in the inspect API and should be used for fields that are never modified.

Object Safety§

This trait is not object safe.

Implementors§