Skip to main content

Module patch

Module patch 

Source
Expand description

Patch<S> typestate pipeline plus its public data types.

The unified-diff parser is in compat::diff; the per-pin evaluator is in compat::evaluate. This module is the entry point and the type-state glue.

Re-exports§

pub use patch_state::Analyzed;
pub use patch_state::Raw;
pub use evaluation_state::Pinned;
pub use evaluation_state::Scoped;
pub use evaluation_state::Sourced;

Modules§

evaluation_state
patch_state

Structs§

EvaluationContext
Inputs for one pin’s evaluation, lifted to a type-state pipeline so half-built contexts cannot reach the evaluator. The progression is Pinned (identity) → Scoped (added module/record scope) → Sourced (added file bytes for context-drift checks). Only Scoped and Sourced contexts can be evaluated; the EvaluationInput trait lets the evaluator accept either. Per-state data is stored in the marker (extras), so there are no Option fields and no runtime expects.
EvaluationFiles
One pin’s filesystem state at evaluation time. Holds the content of every path the patch touches, or None for paths absent at that pin. Built by the caller (the CLI uses gix); the analyzer itself never touches git.
Hunk
Patch
PatchedFile

Enums§

HunkLine
SourceKind

Constants§

PATCH_SIZE_LIMIT

Traits§

EvaluationInput
Anything the evaluator can read: a context that has at least a scope. Implemented for EvaluationContext<Scoped> and EvaluationContext<Sourced>.