pub struct RetainedPlan { /* private fields */ }Expand description
What a store persists for a plan: the definition and its binding identity.
This is deliberately not a serialized plan. The lowered form is an index over the definition, it is rebuilt on load, and keeping a second compiled copy — on disk or anywhere else — would create a second authority that can drift from the definition it claims to describe.
Implementations§
Source§impl RetainedPlan
impl RetainedPlan
Sourcepub fn of(
compiled: &CompiledWorkflow,
key: PlanKey,
) -> Result<RetainedPlan, PlanMismatch>
pub fn of( compiled: &CompiledWorkflow, key: PlanKey, ) -> Result<RetainedPlan, PlanMismatch>
Pair a lowered plan with the key it was lowered for.
The pair is checked against itself here, which is what makes it impossible to file a plan under a key that describes a different definition: a plan served under a key must be that key’s plan.
pub fn definition(&self) -> &WorkflowDefinition
pub fn key(&self) -> &PlanKey
Sourcepub fn binding_digest(&self, identity: &PlanIdentity) -> String
pub fn binding_digest(&self, identity: &PlanIdentity) -> String
The identity a run stays bound to, whether the lowered form exists now
or has to be rebuilt, digested under identity’s lines.
Sourcepub fn to_wire_bytes(&self) -> Result<Vec<u8>, PlanMismatch>
pub fn to_wire_bytes(&self) -> Result<Vec<u8>, PlanMismatch>
The canonical bytes a store persists.
Sourcepub fn retained_bytes(&self) -> Result<usize, PlanMismatch>
pub fn retained_bytes(&self) -> Result<usize, PlanMismatch>
Bytes this plan charges a cache that retains it.
Sourcepub fn from_wire_bytes(bytes: &[u8]) -> Result<RetainedPlan, PlanMismatch>
pub fn from_wire_bytes(bytes: &[u8]) -> Result<RetainedPlan, PlanMismatch>
Read back what a store persisted, checking the pair before accepting it so a drifted store cannot fabricate a binding identity.
Sourcepub fn rebuild(
&self,
supported_schema: &SchemaId,
) -> Result<CompiledWorkflow, WorkflowValidationFailure>
pub fn rebuild( &self, supported_schema: &SchemaId, ) -> Result<CompiledWorkflow, WorkflowValidationFailure>
Rebuild the authority: lower the retained definition again.
Lowering is this build’s compiler, so the caller admits the key first:
a key bound to compiler semantics this build does not implement is
handed off rather than rebuilt here. supported_schema is the same
host-bound schema identity the original lowering was admitted under.
Trait Implementations§
Source§impl Clone for RetainedPlan
impl Clone for RetainedPlan
Source§fn clone(&self) -> RetainedPlan
fn clone(&self) -> RetainedPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetainedPlan
impl Debug for RetainedPlan
impl Eq for RetainedPlan
Source§impl PartialEq for RetainedPlan
impl PartialEq for RetainedPlan
impl StructuralPartialEq for RetainedPlan
Auto Trait Implementations§
impl Forget for RetainedPlan
impl Freeze for RetainedPlan
impl Move for RetainedPlan
impl RefUnwindSafe for RetainedPlan
impl Send for RetainedPlan
impl Sync for RetainedPlan
impl Unpin for RetainedPlan
impl UnsafeUnpin for RetainedPlan
impl UnwindSafe for RetainedPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.