8000 doc: document four functions in theme.rs. · console-rs/dialoguer@7827056 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7827056

Browse files
committed
doc: document four functions in theme.rs.
1 parent 623acf8 commit 7827056

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/theme.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,14 @@ impl<'a> TermThemeRenderer<'a> {
652652
self.term
653653
}
654654

655+
/// Enlarge the theme by one line: allow displaying one more line of input.
655656
pub fn add_line(&mut self) {
656657
self.height += 1;
657658
}
658659

660+
/// Write a formatted string to this terminal. The string can be span multiple lines.
661+
///
662+
/// `F` is a closure prescribing the text to write into the current instance.
659663
fn write_formatted_str<
660664
F: FnOnce(&mut TermThemeRenderer, &mut dyn fmt::Write) -> fmt::Result,
661665
>(
@@ -668,6 +672,7 @@ impl<'a> TermThemeRenderer<'a> {
668672
self.term.write_str(&buf)
669673
}
670674

675+
/// Like [`write_formatted_string`](#method::write_formatted_string), but add a linebreak afterwards.
671676
fn write_formatted_line<
672677
F: FnOnce(&mut TermThemeRenderer, &mut dyn fmt::Write) -> fmt::Result,
673678
>(
@@ -680,6 +685,9 @@ impl<'a> TermThemeRenderer<'a> {
680685
self.term.write_line(&buf)
681686
}
682687

688+
/// Write a formatted prompt string to this terminal.
689+
///
690+
/// `F` is a closure prescribing the text to write into the current instance.
683691
fn write_formatted_prompt<
684692
F: FnOnce(&mut TermThemeRenderer, &mut dyn fmt::Write) -> fmt::Result,
685693
>(

0 commit comments

Comments
 (0)
0