pub struct LayoutBuilder<S: GlobalState> {
pub id: Option<WidgetId>,
pub flex_grow: f32,
pub flex_shrink: f32,
/* private fields */
}Expand description
A closure-backed widget that receives its parent’s last known constraints.
The constraint value comes from the previous layout pass when an explicit
id is supplied. Otherwise it falls back to a loose constraint derived from
the current viewport. Prefer normal responsive widgets first; use
LayoutBuilder when the child tree itself must change with available size.
Fields§
§id: Option<WidgetId>Optional stable identity for constraint look-up across frames.
flex_grow: f32Flex grow factor applied to the wrapper when id is set.
flex_shrink: f32Flex shrink factor applied to the wrapper when id is set.
Implementations§
Source§impl<S: GlobalState> LayoutBuilder<S>
impl<S: GlobalState> LayoutBuilder<S>
Trait Implementations§
Source§impl<S: Clone + GlobalState> Clone for LayoutBuilder<S>
impl<S: Clone + GlobalState> Clone for LayoutBuilder<S>
Source§fn clone(&self) -> LayoutBuilder<S>
fn clone(&self) -> LayoutBuilder<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: GlobalState> From<LayoutBuilder<S>> for Widget
impl<S: GlobalState> From<LayoutBuilder<S>> for Widget
Source§fn from(component: LayoutBuilder<S>) -> Self
fn from(component: LayoutBuilder<S>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<S> Freeze for LayoutBuilder<S>
impl<S> !RefUnwindSafe for LayoutBuilder<S>
impl<S> Send for LayoutBuilder<S>
impl<S> Sync for LayoutBuilder<S>
impl<S> Unpin for LayoutBuilder<S>
impl<S> UnsafeUnpin for LayoutBuilder<S>
impl<S> !UnwindSafe for LayoutBuilder<S>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.