#[non_exhaustive]pub struct LayoutContext<'dom> {
pub dom: &'dom Dom,
pub input: &'dom InputState,
pub layout: &'dom mut LayoutDom,
}Expand description
Information available to a widget during the layout phase.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dom: &'dom Dom§input: &'dom InputState§layout: &'dom mut LayoutDomImplementations§
Source§impl<'dom> LayoutContext<'dom>
impl<'dom> LayoutContext<'dom>
Sourcepub fn calculate_layout(
&mut self,
widget: WidgetId,
constraints: Constraints,
) -> Vec2
pub fn calculate_layout( &mut self, widget: WidgetId, constraints: Constraints, ) -> Vec2
Calculate the layout for the given widget with the given constraints.
This method currently must only be called once per widget per layout phase.
Auto Trait Implementations§
impl<'dom> Freeze for LayoutContext<'dom>
impl<'dom> !RefUnwindSafe for LayoutContext<'dom>
impl<'dom> !Send for LayoutContext<'dom>
impl<'dom> !Sync for LayoutContext<'dom>
impl<'dom> Unpin for LayoutContext<'dom>
impl<'dom> !UnwindSafe for LayoutContext<'dom>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more