pub trait DashboardSection: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn order(&self) -> i32;
fn render(&self, ctx: &DashboardCtx) -> DashboardFragment;
// Provided methods
fn plugin_id(&self) -> Option<u64> { ... }
fn default_enabled(&self) -> bool { ... }
}Expand description
Required Methods§
Sourcefn id(&self) -> &str
fn id(&self) -> &str
Stable identifier, used in dashboard.sections and (CR.4) for plugin
replace-by-id. Lowercase kebab, e.g. "getting-started".
Section ids are deliberately NOT namespaced by plugin, unlike help
topics: replacing a builtin section is a stated capability, so a
plugin registering getting-started is doing something supported.
Sourcefn render(&self, ctx: &DashboardCtx) -> DashboardFragment
fn render(&self, ctx: &DashboardCtx) -> DashboardFragment
Render this section’s contribution.
Provided Methods§
Sourcefn plugin_id(&self) -> Option<u64>
fn plugin_id(&self) -> Option<u64>
CR.2: the host-issued plugin id that contributed this section,
None for builtins. Provenance IS the teardown token —
[DashboardRegistry::unregister_plugin] removes by it.
Defaulted, so no native section changes.
Sourcefn default_enabled(&self) -> bool
fn default_enabled(&self) -> bool
Whether this section shows when the user has not customised
dashboard.sections.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".