Struct requestty_ui::widgets::Text
source · [−]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
sourceimpl<S: PartialEq> PartialEq<Text<S>> for Text<S>
impl<S: PartialEq> PartialEq<Text<S>> for Text<S>
sourceimpl<S: AsRef<str>> Widget for Text<S>
impl<S: AsRef<str>> Widget for Text<S>
sourcefn 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.
sourcefn 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.
sourcefn cursor_pos(&mut self, layout: Layout) -> (u16, u16)
fn cursor_pos(&mut self, layout: Layout) -> (u16, u16)
Returns the location of the first character
sourcefn 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> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more