1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
use super::*; /// Stateless Strategy contract evaluating whether a hardware posture applies and resolving its complete chrome layout plan. pub(crate) trait ChromeLayoutStrategy { /// Returns `true` when this strategy owns the hardware posture represented by `metrics`. /// /// # Arguments /// /// - `&Self` - Strategy instance. /// - `&ShellViewportMetrics` - Live viewport and safe-area snapshot. /// /// # Returns /// /// - `bool` - `true` if this strategy should resolve the layout. fn matches(&self, metrics: &ShellViewportMetrics) -> bool; /// Computes the deterministic `ResolvedChromeLayout` for `metrics`. /// /// # Arguments /// /// - `&Self` - Strategy instance. /// - `&ShellViewportMetrics` - Live viewport and safe-area snapshot. /// /// # Returns /// /// - `ResolvedChromeLayout` - Complete chrome geometry, dock placement, and route-stage clip bounds. fn resolve(&self, metrics: &ShellViewportMetrics) -> ResolvedChromeLayout; }