pub struct LayoutBuilder { /* private fields */ }Expand description
Base builder for creating UI components and layouts
Implementations§
Source§impl LayoutBuilder
impl LayoutBuilder
Sourcepub fn new(component_type: impl Into<String>) -> Self
pub fn new(component_type: impl Into<String>) -> Self
Create a new layout builder with a component type
Sourcepub fn attr(self, key: impl Into<String>, value: impl Into<PluginValue>) -> Self
pub fn attr(self, key: impl Into<String>, value: impl Into<PluginValue>) -> Self
Set an attribute on this layout
Sourcepub fn attrs(self, attrs: &[(&str, PluginValue)]) -> Self
pub fn attrs(self, attrs: &[(&str, PluginValue)]) -> Self
Set multiple attributes at once
Sourcepub fn child(self, id: impl Into<String>, child: impl Builder) -> Self
pub fn child(self, id: impl Into<String>, child: impl Builder) -> Self
Add a child component with an ID
Sourcepub fn children(
self,
children: impl IntoIterator<Item = (String, PluginValue)>,
) -> Self
pub fn children( self, children: impl IntoIterator<Item = (String, PluginValue)>, ) -> Self
Add multiple children at once
Sourcepub fn with_children(self, children: IndexMap<String, PluginValue>) -> Self
pub fn with_children(self, children: IndexMap<String, PluginValue>) -> Self
Set children from an existing map
Trait Implementations§
Source§impl Builder for LayoutBuilder
impl Builder for LayoutBuilder
Source§fn build(self) -> PluginValue
fn build(self) -> PluginValue
Convert this builder to a PluginValue
Auto Trait Implementations§
impl Freeze for LayoutBuilder
impl RefUnwindSafe for LayoutBuilder
impl Send for LayoutBuilder
impl Sync for LayoutBuilder
impl Unpin for LayoutBuilder
impl UnsafeUnpin for LayoutBuilder
impl UnwindSafe for LayoutBuilder
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