Skip to main content

rustik_diff/
lib.rs

1//! Unified diff parsing and terminal-buffer viewing.
2//!
3//! The viewer is intentionally I/O-free: it parses or accepts patch data,
4//! owns read-only viewer state, and writes frames into a
5//! [`rustik_tui::Buffer`]. Backend access is abstracted behind the
6//! [`rustik_repo::Repo`] trait so the viewer stays testable. The `rustik-diff`
7//! binary owns stdin/stdout, terminals, events, and background workers.
8#![deny(unsafe_code)]
9#![warn(missing_docs)]
10#![warn(clippy::unwrap_used)]
11
12mod commit;
13mod context;
14mod document;
15mod highlight;
16mod viewer;
17mod word;
18
19pub mod decode;
20pub mod encode;
21
22pub use commit::{Commit, Header, ParseCommitError};
23pub use context::ContextChange;
24pub use decode::Decode;
25pub use document::{
26    DecodeError, DiffDocument, DiffLine, DiffLineKind, FileDiff, FileHeader, FileId, FileKind,
27    FileMode, FileStats, Hunk, HunkHeader, HunkId, Oid, OidError, RowId, Stats,
28};
29pub use encode::Encode;
30pub use highlight::{
31    BuiltinHighlighter, DiffHighlighter, DiffSide, HighlightKey, HighlightKeyInput,
32    HighlightRequest, HighlightResult, HighlightSource,
33};
34pub use viewer::{
35    ContextRequest, ContextUpdate, DiffAction, DiffFocus, DiffOptions, DiffPalette, DiffState,
36    DiffViewer, FileTreeMode, FileTreeTarget, ViewChange,
37};