Skip to main content

Expansion

Struct Expansion 

Source
pub struct Expansion<K: Kind> { /* private fields */ }
Expand description

Everything one request produced, bound under one identity, with tokens reachable from here and from nowhere else.

One cannot be held without a plan, a closure proved over that plan, and an explanation answered over the two, all having been produced and having agreed. Expansion::plan and Expansion::closure are the same values the deliveries are read from, so what it says it did and what it did cannot drift.

Implementations§

Source§

impl<K: Kind> Expansion<K>

Source

pub fn bound( plan: Plan<K>, closure: Closure<K::Role>, explanation: View<K>, ) -> Result<Self, BindError>

Bind one expansion: the plan, the closure proved against it, and the explanation answered over the two.

The road every kind’s request terminates at. A caller that walked the steps arrives with three unforgeable values and leaves with the one account emission is reachable from; a caller that skipped a step has nothing to hand in.

§Construction

The identity is derived at Role::ClosedExpansion, anchored on the CLOSURE — an expansion exists only where a closure does — over a content transcript of exactly two members: the plan’s identity, then the explanation’s.

Nothing else enters, and each absence is the no-double-entry law. The deliveries are inside the anchor, because a closure’s identity commits to their digests; the kind and the account are inside member one, because a plan’s identity commits to its intent. A second spelling of either here would write one fact twice and let the two spellings drift.

§Errors

Returns BindError naming the pair that disagreed and both of its identities. Nothing is elected out of any pair: an expansion naming one plan while carrying another’s proof, or another’s explanation, would answer every question correctly about the wrong expansion.

Source

pub const fn identity(&self) -> ClosedExpansionId

This expansion’s own identity: the name of the whole account.

Source

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

The record of how that identity was derived.

Source

pub const fn plan(&self) -> &Plan<K>

The complete plan: account, context, content, membership, watch set, trace, trail, and nonclaims.

Source

pub const fn closure(&self) -> &Closure<K::Role>

The proof that what was rendered is what was planned.

Source

pub const fn explain(&self) -> &View<K>

Every question this kind owes, answered over that plan and that proof.

Source

pub const fn emission(&self) -> &PartitionedEmission

The deliveries this expansion carries, split by destination.

The closure’s own proved value, borrowed rather than copied: this expansion keeps no second emission, so what is delivered is what was proved and there is no pair of values to drift apart.

Source

pub const fn emit(&self) -> &PartitionCargo

What the declaration site expands into — the only tokens the consumer’s normal build compiles.

Source

pub const fn test_carrier(&self) -> &PartitionCargo

The deferred cargo the consumer’s test target invokes.

Source

pub const fn bench_carrier(&self) -> &PartitionCargo

The deferred cargo the consumer’s bench target invokes.

Source

pub fn published(&self) -> impl Iterator<Item = &RenderedUnit<K::Role>>

Every unit this expansion publishes as a standalone artifact, in seat order, each carrying the address its own planned output names.

Read off the proved rendering rather than copied into a record beside it: a published artifact IS its rendered unit at an address, and a second value restating that unit’s tree, digest, and seat would be a second answer to one question.

Trait Implementations§

Source§

impl<K: Clone + Kind> Clone for Expansion<K>
where K::Role: Clone,

Source§

fn clone(&self) -> Expansion<K>

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<K: Debug + Kind> Debug for Expansion<K>
where K::Role: Debug,

Source§

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

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

impl<K: Kind> Emittable for Expansion<K>

Source§

fn cargos(&self) -> impl Iterator<Item = &PartitionCargo>

One cargo: an expansion carries exactly one declaration-site delivery, the one its own closure proved.

Source§

impl<K: Eq + Kind> Eq for Expansion<K>
where K::Role: Eq,

Source§

impl<K: PartialEq + Kind> PartialEq for Expansion<K>
where K::Role: PartialEq,

Source§

fn eq(&self, other: &Expansion<K>) -> bool

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

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

Inequality operator !=. Read more
Source§

impl<K: PartialEq + Kind> StructuralPartialEq for Expansion<K>
where K::Role: PartialEq,

Auto Trait Implementations§

§

impl<K> Freeze for Expansion<K>
where Plan<K>: Freeze, Closure<<K as Kind>::Role>: Freeze, View<K>: Freeze,

§

impl<K> RefUnwindSafe for Expansion<K>

§

impl<K> Send for Expansion<K>
where Plan<K>: Send, Closure<<K as Kind>::Role>: Send, View<K>: Send,

§

impl<K> Sync for Expansion<K>
where Plan<K>: Sync, Closure<<K as Kind>::Role>: Sync, View<K>: Sync,

§

impl<K> Unpin for Expansion<K>
where Plan<K>: Unpin, Closure<<K as Kind>::Role>: Unpin, View<K>: Unpin,

§

impl<K> UnsafeUnpin for Expansion<K>

§

impl<K> UnwindSafe for Expansion<K>

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.