pub struct ResolvedLayout { /* private fields */ }Expand description
Resolved layout mapping each panel to its computed screen rectangle.
Implementations§
Source§impl ResolvedLayout
impl ResolvedLayout
Sourcepub fn by_kind(&self, kind: &str) -> &[PanelId]
pub fn by_kind(&self, kind: &str) -> &[PanelId]
All panel ids with the given kind. Empty slice if kind is absent.
Sourcepub fn iter(&self) -> impl Iterator<Item = (PanelId, &Rect)>
pub fn iter(&self) -> impl Iterator<Item = (PanelId, &Rect)>
Iterate over all (PanelId, Rect) pairs.
Sourcepub fn panel_ids(&self) -> impl Iterator<Item = PanelId> + '_
pub fn panel_ids(&self) -> impl Iterator<Item = PanelId> + '_
Iterate over all resolved panel ids.
Sourcepub fn kinds(&self) -> impl Iterator<Item = &str>
pub fn kinds(&self) -> impl Iterator<Item = &str>
Iterate over all distinct panel kinds present in the resolved layout.
Sourcepub fn panels(&self) -> impl Iterator<Item = PanelEntry<'_, &Rect>> + '_
pub fn panels(&self) -> impl Iterator<Item = PanelEntry<'_, &Rect>> + '_
Iterate all panels in kind-grouped order, yielding identity and rect together.
All panels of one kind appear contiguously, then the next kind, etc. No allocation — this is a lazy iterator over the internal index.
Sourcepub fn take_rects(&mut self) -> Vec<Option<Rect>>
pub fn take_rects(&mut self) -> Vec<Option<Rect>>
Take ownership of the rects buffer for reuse.
Sourcepub fn lerp(&self, other: &ResolvedLayout, t: f32) -> ResolvedLayout
pub fn lerp(&self, other: &ResolvedLayout, t: f32) -> ResolvedLayout
Linearly interpolate between two resolved layouts.
Panels in self but not other interpolate against themselves (no-op).
Panels only in other are excluded.
Sourcepub fn lerp_into(
&self,
other: &ResolvedLayout,
t: f32,
buf: &mut Vec<Option<Rect>>,
) -> ResolvedLayout
pub fn lerp_into( &self, other: &ResolvedLayout, t: f32, buf: &mut Vec<Option<Rect>>, ) -> ResolvedLayout
Interpolate into a reusable buffer, avoiding per-call allocation.
The caller can reclaim the buffer from the returned layout via
take_rects.
Trait Implementations§
Source§impl Clone for ResolvedLayout
impl Clone for ResolvedLayout
Source§fn clone(&self) -> ResolvedLayout
fn clone(&self) -> ResolvedLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more