pub struct Block { /* private fields */ }Expand description
边框 + 内边距包装容器
Implementations§
Source§impl Block
impl Block
pub fn new(child: impl Component + 'static) -> Self
pub fn border(self, border: Border) -> Self
pub fn padding(self, value: u16) -> Self
pub fn title(self, title: impl Into<Text>) -> Self
Sourcepub fn title_bottom(self, title: impl Into<Text>) -> Self
pub fn title_bottom(self, title: impl Into<Text>) -> Self
Sets a title at the bottom border.
Sourcepub fn title_alignment(self, align: TextAlign) -> Self
pub fn title_alignment(self, align: TextAlign) -> Self
Sets the title alignment (Left/Center/Right).
pub fn style(self, style: Style) -> Self
Trait Implementations§
Source§impl Component for Block
impl Component for Block
Source§fn for_each_child(&self, f: &mut dyn FnMut(&Node))
fn for_each_child(&self, f: &mut dyn FnMut(&Node))
遍历子节点(为焦点系统等提供统一的树遍历接口)
Source§fn for_each_child_mut(&mut self, f: &mut dyn FnMut(&mut Node))
fn for_each_child_mut(&mut self, f: &mut dyn FnMut(&mut Node))
遍历子节点(可变版本)
Source§fn measure(&self, constraint: Constraint, _cx: &mut MeasureCx) -> Size
fn measure(&self, constraint: Constraint, _cx: &mut MeasureCx) -> Size
测量组件在给定约束下的自适应尺寸 Read more
Auto Trait Implementations§
impl !Freeze for Block
impl !RefUnwindSafe for Block
impl !Send for Block
impl !Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl !UnwindSafe for Block
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