Skip to main content

Module display

Module display 

Source
Expand description

Professional responsive diff display with grid layout.

This module provides a sophisticated diff visualization system that adapts to terminal width, offering newspaper-style column layouts for optimal screen space utilization. Features include intelligent import grouping, ANSI-aware text measurement, and zero-allocation rendering paths.

§Architecture

The display system is organized into specialized modules:

  • types - Core data structures for rendered output
  • formatting - Text padding and width calculation
  • grouping - Import deduplication and intelligent grouping
  • grid - Responsive column layout calculations
  • render - File diff block rendering

§Performance

  • Pre-allocated vectors with estimated capacities
  • Single-pass width calculations
  • ANSI-aware measurements using console crate
  • Minimal string allocations
  • Zero-cost abstractions for layout logic

§Examples

use cargo_quality::differ::{DiffResult, display::show_full};

let result = DiffResult::new();
show_full(&result, false);

Re-exports§

pub use self::grid::calculate_columns;
pub use self::grid::render_grid;
pub use self::render::render_file_block;

Modules§

formatting
grid
grouping
render
types

Functions§

show_full
Displays full responsive diff output with adaptive grid layout.
show_interactive
Displays interactive diff with user prompts for selective application.
show_summary
Displays diff in summary mode with brief statistics.