pub struct RenderedUnit<R: Role> { /* private fields */ }Expand description
One unit a renderer actually materialized.
Its seat and every fact that seat’s planned member states are carried, so a proof can rebuild a membership out of a rendering and compare it against the declared one; the tree, the identity, and the digest are the rendering’s own.
§Nonclaims
The Rust source text is not a member of the unit.
It is GeneratedTree::inspected — a projection of the tree, for a person.
Implementations§
Source§impl<R: Role> RenderedUnit<R>
impl<R: Role> RenderedUnit<R>
Sourcepub fn materialized(
planned: &PlannedMember<R>,
tree: GeneratedTree,
) -> Result<Self, RenderError>
pub fn materialized( planned: &PlannedMember<R>, tree: GeneratedTree, ) -> Result<Self, RenderError>
Materialize one planned member out of the tree a renderer produced.
A rendered unit IS a planned member plus the bytes that answer it, so every fact the member already states is read off it rather than restated at the call — nothing here can pair one seat’s key with another seat’s origin. The digest and this unit’s own identity are both taken here, over the tree’s canonical bytes, under that key at that seat’s roster position.
§Errors
Returns RenderError::BytesUnbounded where the rendered bytes pass RENDERED_BYTE_LIMIT.
Sourcepub const fn identity(&self) -> Identity<RenderedUnit>
pub const fn identity(&self) -> Identity<RenderedUnit>
This rendered unit’s own identity.
Sourcepub const fn semantic_key(&self) -> Identity<GeneratedUnit>
pub const fn semantic_key(&self) -> Identity<GeneratedUnit>
The semantic key this unit answers to.
Sourcepub fn destination(&self) -> Destination
pub fn destination(&self) -> Destination
Which delivery this unit lands in.
Read off the seat and never stored: a delivery a unit could disagree with its own role about would be a second answer to a question the roster already answers.
Sourcepub const fn origin(&self) -> &OriginTrail
pub const fn origin(&self) -> &OriginTrail
Where this unit came from.
Sourcepub const fn address(&self) -> Option<OwnerIdentity>
pub const fn address(&self) -> Option<OwnerIdentity>
The address a publication writes this unit to, where its seat is one that writes to an address.
Sourcepub const fn tree(&self) -> &GeneratedTree
pub const fn tree(&self) -> &GeneratedTree
The token tree this unit is.
Sourcepub const fn digest(&self) -> Identity<OutputBytes>
pub const fn digest(&self) -> Identity<OutputBytes>
The digest over this unit’s canonical bytes.
Sourcepub fn bytes(&self) -> Vec<u8> ⓘ
pub fn bytes(&self) -> Vec<u8> ⓘ
This unit’s canonical bytes — the exact material the digest was taken over.
Derived from the tree on every reading rather than kept beside it, so there is no second copy of one unit’s bytes to disagree with the tree.
Sourcepub fn reconstructed(&self) -> PlannedMember<R>
pub fn reconstructed(&self) -> PlannedMember<R>
The membership row this unit reconstructs — the renderer’s own answer to what it materialized, in exactly the shape a plan states it.
Sourcepub fn digest_under(&self, contract: DigestContract) -> Identity<OutputBytes>
pub fn digest_under(&self, contract: DigestContract) -> Identity<OutputBytes>
The digest recomputed from the bytes this unit carries, under one stated contract.
A proof compares this against RenderedUnit::digest: a digest that does not survive being recomputed under the plan’s own contract is a digest of something else.
Trait Implementations§
Source§impl<R: Clone + Role> Clone for RenderedUnit<R>
impl<R: Clone + Role> Clone for RenderedUnit<R>
Source§fn clone(&self) -> RenderedUnit<R>
fn clone(&self) -> RenderedUnit<R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more