pub struct Closure<R: Role> { /* private fields */ }Expand description
The proof that what was rendered is what was planned, and the emission that proof partitioned.
Holding one means the membership was rebuilt out of the rendered units and equals the plan’s declared membership seat for seat, key for key, origin for origin, and digest for digest — and that the rendering was then split across the deliveries its seats declared, each joined delivery’s digest committed to inside this closure’s own identity.
No token reaches a compiler except through a value proved here. The proved emission is this closure’s material and is not handed out: the public road to tokens is the expansion that binds this proof to the plan it was proved against and the explanation written over the two.
Implementations§
Source§impl<R: Role> Closure<R>
impl<R: Role> Closure<R>
Sourcepub fn proved<K: Kind<Role = R>>(
plan: &Plan<K>,
rendered: RenderedProjection<R>,
) -> Result<Self, ClosureError<R>>
pub fn proved<K: Kind<Role = R>>( plan: &Plan<K>, rendered: RenderedProjection<R>, ) -> Result<Self, ClosureError<R>>
Prove the closure between one plan’s membership and one rendering.
§Construction
The identity is derived at Role::Closure, anchored on the plan’s own identity, over the complete claim: the planned membership in roster order, the roster’s own length, the identity and digest of the unit that stood under each seat, and every joined delivery’s digest.
So the identity names the whole agreement rather than a sample of it, and the bytes a caller emits into any build are bytes this identity names.
§The two halves are one value
The proof takes the PLAN, not a plan identity beside a membership. Separate arguments are separable: nothing in the types would stop a caller handing one plan’s identity beside another’s membership, and the closure would be born naming the first while proving the second.
§Errors
Returns ClosureError naming every seat the two disagree at, the delivery whose joined tree outgrew its magnitude, or the address two published units stand at.
Every disagreement of one pass is reported together: a caller repairing a rendering one seat per attempt is a caller the check failed.
Sourcepub const fn reconstructed(&self) -> &Membership<R>
pub const fn reconstructed(&self) -> &Membership<R>
The membership rebuilt out of the rendered units.
Sourcepub const fn rendered(&self) -> &RenderedProjection<R>
pub const fn rendered(&self) -> &RenderedProjection<R>
What the renderer produced.
Sourcepub const fn provenance(&self) -> &Provenance
pub const fn provenance(&self) -> &Provenance
The record of how that identity was derived.