Function ansi_str::get_blocks
source · pub fn get_blocks(text: &str) -> AnsiBlockIter<'_> ⓘ
Expand description
This function returns a Iterator which produces a AnsiBlock
.
AnsiBlock
represents a string with a consisten style.
Example
use owo_colors::*;
use ansi_str::get_blocks;
let message = format!("{} {}", "Hello".red(), "World".blue());
for block in get_blocks(&message) {
println!("{:?}", block.text());
}