pub struct Text { /* private fields */ }Implementations§
Source§impl Text
impl Text
pub fn new( content_fn: impl Fn() -> String + 'static, layout_style: LayoutStyle, style_fn: impl Fn() -> TextStyle + 'static, ) -> Result<Self, LayoutError>
Sourcepub fn auto(
content_fn: impl Fn() -> String + 'static,
layout_style: LayoutStyle,
style_fn: impl Fn() -> TextStyle + 'static,
) -> Result<Self, LayoutError>
pub fn auto( content_fn: impl Fn() -> String + 'static, layout_style: LayoutStyle, style_fn: impl Fn() -> TextStyle + 'static, ) -> Result<Self, LayoutError>
Like Text::new, but the leaf’s height is measured from the content at its
resolved width, so the box grows to fit however many lines the text wraps
into and pushes following siblings down instead of overflowing onto them.
pub fn single_line( content_fn: impl Fn() -> String + 'static, style_fn: impl Fn() -> TextStyle + 'static, ) -> Result<Self, LayoutError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Text
impl !RefUnwindSafe for Text
impl !Send for Text
impl !Sync for Text
impl !UnwindSafe for Text
impl Unpin for Text
impl UnsafeUnpin for Text
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutItem for Twhere
T: LeafWidget + Component,
impl<T> LayoutItem for Twhere
T: LeafWidget + Component,
fn layout_node(&self) -> NodeId
Source§fn pointer_opaque(&self) -> bool
fn pointer_opaque(&self) -> bool
Whether this widget stands in front of whatever its siblings drew underneath it, for a pointer event
its parent is hit-testing. Read more