pub fn get_blocks(text: &str) -> AnsiBlockIter<'_> ⓘ
This function returns a Iterator which produces a AnsiBlock.
AnsiBlock
AnsiBlock represents a string with a consisten style.
use ansi_str::get_blocks; let text = "\u{1b}[31;40mHello\u{1b}[0m \u{1b}[31mWorld!\u{1b}[39m"; for block in get_blocks(&text) { println!("{:?}", block.text()); }