pub struct Request<'door, K: Kind> { /* private fields */ }Expand description
One request: the material it stands over, what that material means, who is asking, and the seats the caller states.
A builder, and the value the whole road is walked from. Stating a builder fact again replaces its earlier statement; a publication address replaces only the earlier address for that same seat. The material is held rather than committed to at the door, because a commitment beside the bytes it was taken from is one fact in two seats; the commitment is derived once, where the plan that carries it is built.
§Nonclaims
It answers nothing about the material it holds. Reading a declaration grammar out of captured tokens is the consumer’s, and a request is what it hands over afterwards.
Implementations§
Source§impl<'door, K: Kind> Request<'door, K>
impl<'door, K: Kind> Request<'door, K>
Sourcepub fn over(
capture: CapturedInput,
content: K::Content,
door: &'door Door,
) -> Self
pub fn over( capture: CapturedInput, content: K::Content, door: &'door Door, ) -> Self
The request one captured declaration and one kind’s content amount to.
Everything else has a stated default: nothing is depended on, the profile is RUST_DECLARATION_PROFILE, nothing is assumed, no seat publishes to an address, and the kind’s own questions are unanswered.
A kind that declares questions or publishes to an address states those seats before rendering, or the road refuses at the step that needs them.
Sourcepub fn selecting(self, first: K::Role, rest: Vec<K::Role>) -> Self
pub fn selecting(self, first: K::Role, rest: Vec<K::Role>) -> Self
Selects the structurally nonempty subset this request plans from the kind’s complete role roster.
The first role is separate so an empty selection cannot be stated. Selection order does not carry meaning and is canonicalized by the kind’s role roster before planning. Foreign, doubled, and overlarge selections remain typed planning refusals under the existing membership owner. Stating a selection again replaces the earlier statement.
Sourcepub fn depending_on(
self,
dependencies: Vec<Identity<CapturedDeclaration>>,
) -> Self
pub fn depending_on( self, dependencies: Vec<Identity<CapturedDeclaration>>, ) -> Self
States the captures this content declares it stands on.
The set is canonicalized where the account is built, so two callers declaring one set in two orders reach one plan.
Sourcepub fn profile(self, profile: Profile) -> Self
pub fn profile(self, profile: Profile) -> Self
States the profile this request is decided under.
Sourcepub fn assuming(self, assumptions: Vec<OwnerFact>) -> Self
pub fn assuming(self, assumptions: Vec<OwnerFact>) -> Self
States the owner facts this projection rests on.
They are the assumptions the explanation answers with and the decisions the trace records, which is one statement read twice rather than two a caller could disagree with itself about.
Sourcepub fn publishing_at(self, role: K::Role, address: OwnerIdentity) -> Self
pub fn publishing_at(self, role: K::Role, address: OwnerIdentity) -> Self
States the address the unit under one seat is written to.
Stating a seat’s address twice keeps the last statement: an address is one fact about one seat, and two of them would leave the plan electing. The seat must be one a publication act consumes — planning refuses an address on a seat that never publishes, so a stated address is never an inert claim riding the identities.
Sourcepub fn answering(self, answers: Vec<<K::Question as Question>::Answer>) -> Self
pub fn answering(self, answers: Vec<<K::Question as Question>::Answer>) -> Self
States the answers to the questions the kind itself declares.
The universal questions every kind owes are answered by this road; these are the kind’s own.
Sourcepub fn render(
self,
renderer: impl FnOnce(&Plan<K>, &mut Output<'_, K>) -> Result<(), RenderError>,
) -> Result<Expansion<K>, Diagnostic>
pub fn render( self, renderer: impl FnOnce(&Plan<K>, &mut Output<'_, K>) -> Result<(), RenderError>, ) -> Result<Expansion<K>, Diagnostic>
Walk the road: plan, render, close, explain, bind.
The renderer is called once, against the plan, and writes one unit per seat the plan declares. Each step hands the next a value the next one cannot forge, so the order is not a convention a caller could take in another sequence.
§Errors
Returns one Diagnostic, composed under this request’s door, wherever any step refuses: the plan the kind’s roster and the caller’s seats amount to, the renderer’s own refusal, the units it wrote, the proof that they close over the plan, the coverage of the questions the kind owes, or the binding of the three.
Every one of them happens before a token is reachable, because tokens are reachable only from the expansion this road returns.