pub fn println(msg: impl Into<String>) -> CmdExpand description
Print a line above the program’s TUI output.
This output is unmanaged by the program and will persist across renders.
Unlike std::println!, the message is printed on its own line (similar to log::info!).
Note: If the alternate screen is active, no output will be printed. This is because alternate screen mode uses a separate buffer that doesn’t support this kind of unmanaged output.
§Example
ⓘ
use bubbletea::{Model, Message, Cmd, println};
impl Model for MyModel {
fn update(&mut self, msg: Message) -> Option<Cmd> {
if msg.is::<DownloadComplete>() {
return Some(println("Download finished!"));
}
None
}
}