fn symbol_map(header: &Header, events: &[asciicast::Event]) -> BTreeMap<Symbol, Vec<usize>> {
    let mut frame: Frame = Frame::new(header.width, header.height);
    let mut parser: vte::Parser = vte::Parser::new();
    let mut symbol_map: BTreeMap<Symbol, Vec<usize>> = BTreeMap::new();
    for (event_num, event) in events.iter().enumerate() {
        log::trace!("Event number {}: x={}, y={}", event_num, frame.x, frame.y);
        for byte in event.event_data().as_bytes() {
            parser.advance(&mut frame, *byte)
        }

        frame.insert_symbols(&mut symbol_map, event_num);
    }
    symbol_map
}
/// Create a symbol map from an asciicast.
///
/// This function does all the heavy lifting, reconstructing the terminal frame
/// based on the byte data.
///
/// This uses alacritty's [vte] crate to reconstruct the frames.
///
/// The return value is an ordered multimap.
///
/// The key is a symbol, and each value is a vector of frame numbers that the
/// symbol appears in.
///
/// The data is in the multimap to make allow us to deduplicate symbols for each
/// frame that they appear in later on.
///
/// [vte]: https://github.com/alacritty/vte
Create a symbol map from an asciicast.
This function does all the heavy lifting, reconstructing the terminal frame
based on the byte data.

This uses alacritty's [vte] crate to reconstruct the frames.

The return value is an ordered multimap.

The key is a symbol, and each value is a vector of frame numbers that the
symbol appears in.

The data is in the multimap to make allow us to deduplicate symbols for each
frame that they appear in later on.


Create a symbol map from an asciicast . This function does all the heavy lifting reconstructing the terminal frame based on the byte data . This uses alacritty ' s [ vte ] crate to reconstruct the frames . The return value is an ordered multimap . The key is a symbol and each value is a vector of frame numbers that the symbol appears in . The data is in the multimap to make allow us to deduplicate symbols for each frame that they appear in later on .
fn symbol_map(header: &Header, events: &[asciicast::Event]) -> BTreeMap<Symbol, Vec<usize>> {
    let mut frame: Frame = Frame::new(header.width, header.height);
    let mut parser: vte::Parser = vte::Parser::new();
    let mut symbol_map: BTreeMap<Symbol, Vec<usize>> = BTreeMap::new();
    for (event_num, event) in events.iter().enumerate() {
        log::trace!("Event number {}: x={}, y={}", event_num, frame.x, frame.y);
        for byte in event.event_data().as_bytes() {
            parser.advance(&mut frame, *byte)
        }
        frame.insert_symbols(&mut symbol_map, event_num);
    }
    symbol_map
}
fn symbol_map ( header : & Header , events : & [ asciicast :: Event ] ) -> BTreeMap < Symbol , Vec < usize > > { let mut frame : Frame = Frame :: new ( header . width , header . height ) ; let mut parser : vte :: Parser = vte :: Parser :: new ( ) ; let mut symbol_map : BTreeMap < Symbol , Vec < usize > > = BTreeMap :: new ( ) ; for ( event_num , event ) in events . iter ( ) . enumerate ( ) { log :: trace ! ( " " event_num frame x frame y ) ; for byte in event . event_data ( ) . as_bytes ( ) { parser . advance ( & mut frame , * byte ) } frame . insert_symbols ( & mut symbol_map , event_num ) ; } symbol_map }
Create a symbol map from an asciicast.
Create a symbol map from an asciicast .
header
&Header
events
&[asciicast::Event]
header
&Header
events
&[asciicast::Event]