Skip to main content

PanelBuilder

Trait PanelBuilder 

Source
pub trait PanelBuilder {
    // Required method
    fn build(&mut self, state: &PanelState, info: &PanelInfo) -> PanelId;
}
Expand description

Both halves of the persistence seam. PaneTree::to_state reads panel properties through PanelSource; PaneTree::from_state turns persisted leaves back into panels through PanelBuilder. Exporting only the first left from_state public but uncallable, since no caller outside this crate could name the trait its parameter requires. Turns a persisted leaf into a live panel id.

The production implementation (at the gpui-component layer, above this crate) consults PanelRegistry and falls back to an invalid-panel placeholder that retains the original PanelState, so a panel type this build does not know about survives a load/save round trip instead of being erased.

Required Methods§

Source

fn build(&mut self, state: &PanelState, info: &PanelInfo) -> PanelId

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§