Skip to main content

Output

Struct Output 

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

Source

pub const fn over(plan: &'plan Plan<K>) -> Self

The empty output one plan’s renderer writes into.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'plan, K> Freeze for Output<'plan, K>
where &'plan Plan<K>: Freeze, Vec<RenderedUnit<<K as Kind>::Role>>: Freeze,

§

impl<'plan, K> RefUnwindSafe for Output<'plan, K>
where &'plan Plan<K>: RefUnwindSafe, Vec<RenderedUnit<<K as Kind>::Role>>: RefUnwindSafe,

§

impl<'plan, K> Send for Output<'plan, K>
where &'plan Plan<K>: Send, Vec<RenderedUnit<<K as Kind>::Role>>: Send,

§

impl<'plan, K> Sync for Output<'plan, K>
where &'plan Plan<K>: Sync, Vec<RenderedUnit<<K as Kind>::Role>>: Sync,

§

impl<'plan, K> Unpin for Output<'plan, K>
where &'plan Plan<K>: Unpin, Vec<RenderedUnit<<K as Kind>::Role>>: Unpin,

§

impl<'plan, K> UnsafeUnpin for Output<'plan, K>
where &'plan Plan<K>: UnsafeUnpin, Vec<RenderedUnit<<K as Kind>::Role>>: UnsafeUnpin,

§

impl<'plan, K> UnwindSafe for Output<'plan, K>
where &'plan Plan<K>: UnwindSafe, Vec<RenderedUnit<<K as Kind>::Role>>: UnwindSafe,

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> 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, 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.