Skip to main content

ModelDebug

Trait ModelDebug 

Source
pub trait ModelDebug: 'static {
    // Required methods
    fn kind(&self) -> &'static str;
    fn len(&self) -> usize;
    fn debug_dump(&self, out: &mut dyn Write);
}
Expand description

Type-erased debug view of a data model. Implementors live in teksilo-data itself (ListModel, TreeModel, etc.); the inspector uses these methods to render the Data Models tab without needing to know T.

Required Methods§

Source

fn kind(&self) -> &'static str

Discriminator string — "ListModel", "TreeModel", "SelectionModel", … Shown verbatim in the inspector.

Source

fn len(&self) -> usize

Number of items / nodes in the model. Cheap.

Source

fn debug_dump(&self, out: &mut dyn Write)

Write a human-readable dump of the model’s items into out. Each item should land on its own line. Best-effort; long outputs may be truncated by callers.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§