pub struct Text<S> {
pub text: S,
/* private fields */
}
Expand description
Fields§
§text: S
The text to render.
If this is changed, the updated text is not guaranteed to be rendered. If the text is
changed, force_recompute
should be called.
Implementations§
Trait Implementations§
Source§impl<S: AsRef<str>> Widget for Text<S>
impl<S: AsRef<str>> Widget for Text<S>
Source§fn render<B: Backend>(
&mut self,
layout: &mut Layout,
backend: &mut B,
) -> Result<()>
fn render<B: Backend>( &mut self, layout: &mut Layout, backend: &mut B, ) -> Result<()>
Renders the Text moving to the next line after its done. This can trigger a recomputation.
In case the text cannot be fully rendered, layout.render_region
is used to determine the
lines which are rendered.
Source§fn height(&mut self, layout: &mut Layout) -> u16
fn height(&mut self, layout: &mut Layout) -> u16
Calculates the height the text will take. This can trigger a recomputation.
Source§fn cursor_pos(&mut self, layout: Layout) -> (u16, u16)
fn cursor_pos(&mut self, layout: Layout) -> (u16, u16)
Returns the location of the first character
Source§fn handle_key(&mut self, _: KeyEvent) -> bool
fn handle_key(&mut self, _: KeyEvent) -> bool
This widget does not handle any events
impl<S: Eq> Eq for Text<S>
Auto Trait Implementations§
impl<S> Freeze for Text<S>where
S: Freeze,
impl<S> RefUnwindSafe for Text<S>where
S: RefUnwindSafe,
impl<S> Send for Text<S>where
S: Send,
impl<S> Sync for Text<S>where
S: Sync,
impl<S> Unpin for Text<S>where
S: Unpin,
impl<S> UnwindSafe for Text<S>where
S: UnwindSafe,
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