pub struct WidgetDef { /* private fields */ }Expand description
What a Widget declares: how many columns of the grid it spans, and who sees it.
Implementations§
Source§impl WidgetDef
impl WidgetDef
Sourcepub fn new() -> Self
pub fn new() -> Self
A def with every default: one column, for every user who may open the page.
Sourcepub fn name(self, name: &'static str) -> Self
pub fn name(self, name: &'static str) -> Self
The widget’s name, its data-widget hook and its key on the page; defaults to its type’s
name in kebab case, without Widget and generic arguments: RecentOrdersWidget →
recent-orders, Count<Book> → count. Each widget of a page needs a distinct name, so a
generic widget mounted twice names each mount.
Sourcepub fn span(self, columns: u8) -> Self
pub fn span(self, columns: u8) -> Self
Spans columns columns of the grid, at most as many as it has, and at least one. On a
narrow screen the grid stacks every widget in one column.
Sourcepub fn full_width(self) -> Self
pub fn full_width(self) -> Self
Spans every column of the grid.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WidgetDef
impl !UnwindSafe for WidgetDef
impl Forget for WidgetDef
impl Freeze for WidgetDef
impl Move for WidgetDef
impl Send for WidgetDef
impl Sync for WidgetDef
impl Unpin for WidgetDef
impl UnsafeUnpin for WidgetDef
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