Skip to main content

Closure

Struct Closure 

Source
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>

Source

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.

Source

pub const fn reconstructed(&self) -> &Membership<R>

The membership rebuilt out of the rendered units.

Source

pub const fn rendered(&self) -> &RenderedProjection<R>

What the renderer produced.

Source

pub const fn plan(&self) -> PlanId

The plan this closure was proved against.

Source

pub const fn identity(&self) -> ClosureId

This closure’s own identity.

Source

pub const fn provenance(&self) -> &Provenance

The record of how that identity was derived.

Trait Implementations§

Source§

impl<R: Clone + Role> Clone for Closure<R>

Source§

fn clone(&self) -> Closure<R>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug + Role> Debug for Closure<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: Eq + Role> Eq for Closure<R>

Source§

impl<R: PartialEq + Role> PartialEq for Closure<R>

Source§

fn eq(&self, other: &Closure<R>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<R: PartialEq + Role> StructuralPartialEq for Closure<R>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.