Skip to main content

Module utils

Module utils 

Source
Expand description

Utilities functions to work with components

Functions§

borrow_clone_line
Convert a &Line to a Line by using Cow::Borrowed.
borrow_clone_span
Convert a &Span to a Span by using Cow::Borrowed.
borrow_clone_text
Convert a &Text to a Text by using Cow::Borrowed.
calc_utf8_cursor_position
Calculate the actual amount of terminal space taken up, taking into account UTF things like multi-width, undrawn and combinatory characters.
get_block
Construct a Block widget from the given properties.
wrap_lines
Wrap the given lines to fit within width.
wrap_spans
Given a vector of Spans, it creates a list of Spans which mustn’t exceed the provided width parameter. Each Line in the returned Vec is a line in the text.