pub struct Output<'plan, K: Kind> { /* private fields */ }Expand description
The value a renderer writes its units into.
It holds the plan, so a renderer names a seat and hands over tokens: everything else one unit carries is that seat’s planned member, read here. It holds no proof and makes none — a seat left unfilled and a seat filled twice are written into it as freely as an honest rendering, because those are disagreements between a rendering and a plan and the proof that compares the two is what settles them.
Implementations§
Source§impl<'plan, K: Kind> Output<'plan, K>
impl<'plan, K: Kind> Output<'plan, K>
Sourcepub const fn over(plan: &'plan Plan<K>) -> Self
pub const fn over(plan: &'plan Plan<K>) -> Self
The empty output one plan’s renderer writes into.
Sourcepub fn unit(
&mut self,
role: K::Role,
tree: GeneratedTree,
) -> Result<(), RenderError>
pub fn unit( &mut self, role: K::Role, tree: GeneratedTree, ) -> Result<(), RenderError>
Materialize the unit that fills one seat.
Naming the seat is the whole call: the key the unit answers to, where it came from, the profile expected to render it, and the address it publishes to are that seat’s planned member’s, read here.
§Errors
Returns RenderError::SeatUnplanned where this plan declares no member under the seat, and RenderError::BytesUnbounded where the tokens pass RENDERED_BYTE_LIMIT.
Sourcepub fn rendered(self) -> Result<RenderedProjection<K::Role>, RenderError>
pub fn rendered(self) -> Result<RenderedProjection<K::Role>, RenderError>
Everything the renderer wrote, as the rendering a proof closes over.
§Errors
Returns RenderError::NothingRendered where the renderer wrote no unit at all, and RenderError::UnitsUnbounded where it wrote past the membership magnitude.
It does not answer for a seat left unfilled or filled twice: those are disagreements between this rendering and the plan, and the proof that compares the two is what states them.