inspect_writable

Trait InspectWritable

Source
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.

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.

Implementors§