Skip to main content

diff_refs_with

Function diff_refs_with 

Source
pub fn diff_refs_with(
    old: &[&Package],
    new: &[&Package],
    context: &[&Package],
    encodings: &[&str],
) -> DiffReport
Expand description

diff_refs_in, judged for encodings: the names a [backend.<name>] encodings list writes (flatbuffers, proto3, podbuf). A snapshot does not carry the encodings a workspace builds, so the caller names them.

Each of the three names has rules of its own: a struct field appended that does not fit inside the old head of a struct another head of the old side holds inline is Category::PodbufInlineAppend, and an enum value, an enum-set flag or a union arm appended that changes the integer of the enum or the enum set or the union’s tag is Category::PodbufWidthChange; each is breaking when podbuf is in encodings and compatible otherwise. An enum value or an enum-set flag appended to a declaration that is not open is Category::StrictEnumAppend, breaking under every list. An enum value or an enum-set flag appended that changes the FlatBuffers integer is Category::FlatbuffersWidthChange, breaking when flatbuffers is in encodings and compatible otherwise. An enum-set flag appended that changes the proto3 scalar is Category::Proto3WidthChange, breaking when proto3 is in encodings and compatible otherwise. Every other category is judged the same under every list. The CLI and the MCP tool refuse a name that is not one of the three before calling this; the engine does not check it. The podbuf rule lays the old side out over old and the context packages old does not name, and the new side over new and context; a package in both new and context is read at its first occurrence.