pub struct Context { /* private fields */ }Expand description
The exact facts every plan is decided under, whatever its kind.
What a plan was planned OVER is not here: that is the account’s, and a context naming it too would be the second holder of one fact.
Implementations§
Source§impl Context
impl Context
Sourcepub fn encode_into(&self, into: &mut Vec<u8>)
pub fn encode_into(&self, into: &mut Vec<u8>)
Appends this context’s canonical bytes: the profile, then the generator identity at full width.
What a plan was planned OVER is not written here and is not missing: it is the account’s fact, written ahead of this by the account’s own road, so no byte of a plan transcript states the content twice.
Source§impl Context
impl Context
Sourcepub fn under(profile: Profile) -> Self
pub fn under(profile: Profile) -> Self
The context a request is decided under: the profile it selected, and the generator answering.
The generator is this crate’s own and is derived here rather than supplied, so a plan cannot be told a producer it was not produced by.
The derivation is the one GENERATOR_VERSION_PROFILE states: the declared name framed, then the shape position in four big-endian bytes, rooted at position zero.
Sourcepub const fn generator(&self) -> Identity<GeneratorVersion>
pub const fn generator(&self) -> Identity<GeneratorVersion>
The generator answering under it.
Sourcepub fn watch_set<K: Kind>(
&self,
account: &Account<K>,
) -> Result<InvalidationSet, PlanError>
pub fn watch_set<K: Kind>( &self, account: &Account<K>, ) -> Result<InvalidationSet, PlanError>
Every trigger one plan’s own facts require, as a set.
The shared half of any plan’s invalidation, derived from the seats this context declares and the commitments the account names rather than listed at a plan site.
A kind adds whatever its own anchors require on top, through InvalidationTrigger::Declared.
Exact repeats are dropped before construction: a repeat would be written twice by the transcript’s set encoding, so two plans watching the same things would carry two identities depending only on whether a call site remembered to skip it.
§Errors
Returns the planning refusal naming BoundAxis::Triggers where the derived set outgrows TRIGGER_LIMIT.