Skip to main content

DisplayRules

Trait DisplayRules 

Source
pub trait DisplayRules {
    // Required methods
    fn evaluate(&self, ctx: &DisplayContext<'_>) -> DisplayAction;
    fn panel_id(&self) -> &'static str;
}
Expand description

Trait for declarative display rules evaluation

SPEC-024 Appendix F.2.3: Every panel MUST implement this trait to enable YAML-controlled visibility.

Required Methods§

Source

fn evaluate(&self, ctx: &DisplayContext<'_>) -> DisplayAction

Evaluate display rules and return action

Called before rendering to determine if panel should be shown, hidden, or displayed in a modified state.

Source

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

Get panel identifier for YAML configuration

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§