Skip to main content

RetainedPlan

Struct RetainedPlan 

Source
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

Source

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.

Source

pub fn definition(&self) -> &WorkflowDefinition

Source

pub fn key(&self) -> &PlanKey

Source

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.

Source

pub fn to_wire_bytes(&self) -> Result<Vec<u8>, PlanMismatch>

The canonical bytes a store persists.

Source

pub fn retained_bytes(&self) -> Result<usize, PlanMismatch>

Bytes this plan charges a cache that retains it.

Source

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.

Source

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

Source§

fn clone(&self) -> RetainedPlan

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 Debug for RetainedPlan

Source§

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

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

impl Eq for RetainedPlan

Source§

impl PartialEq for RetainedPlan

Source§

fn eq(&self, other: &RetainedPlan) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RetainedPlan

Auto Trait Implementations§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
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.