pub struct SerializedPlan {
pub protocol_version: u32,
pub plan_id: PlanId,
pub plan: ExecutionPlan,
pub input: Option<InputSource>,
pub filters: Vec<SerializedFilter>,
pub mode: ExecutionMode,
pub seed: Option<i64>,
pub metadata: Value,
}Expand description
A serialized plan ready for remote execution.
Fields§
§protocol_version: u32What the sender speaks. See PROTOCOL_VERSION.
plan_id: PlanIdIdentifies this execution end to end — results, events and cancellations all refer back to it.
plan: ExecutionPlanThe compiled plan the worker will execute.
input: Option<InputSource>Input data — inline for small values, DataRef for large ones.
filters: Vec<SerializedFilter>Filter definitions for the worker to reconstruct.
mode: ExecutionModeFit or Forward.
seed: Option<i64>The run’s experiment seed, folded into every cache key on the worker exactly as it is locally. Absent (the pre-seed wire format) means unseeded — which shares cache lines across a sweep’s seeds, the bug this field exists to close.
metadata: ValueFree-form annotations that travel with the plan (experiment name, submitter, …). The worker carries them; it never interprets them.
Implementations§
Source§impl SerializedPlan
impl SerializedPlan
Sourcepub fn new(plan_id: impl Into<PlanId>, plan: ExecutionPlan) -> Self
pub fn new(plan_id: impl Into<PlanId>, plan: ExecutionPlan) -> Self
A plan tagged with the version this build speaks.
Callers build plans through this rather than the literal, so the version cannot be forgotten at one of the six construction sites.
Sourcepub fn with_input(self, input: InputSource) -> Self
pub fn with_input(self, input: InputSource) -> Self
Attach the plan’s input data — inline or by reference.
Sourcepub fn with_filters(self, filters: Vec<SerializedFilter>) -> Self
pub fn with_filters(self, filters: Vec<SerializedFilter>) -> Self
Attach the filter payloads the worker must reconstruct before the plan can run.
Sourcepub fn with_mode(self, mode: ExecutionMode) -> Self
pub fn with_mode(self, mode: ExecutionMode) -> Self
Choose fit or forward execution (the default is
ExecutionMode::Forward).
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Replace the free-form metadata (defaults to {}).
Sourcepub fn check_version(&self) -> Result<(), String>
pub fn check_version(&self) -> Result<(), String>
Can this build execute the plan as its sender meant it?
Refusing is the point. Executing a plan you only partly understand produces a number, and nothing downstream can tell it apart from a correct one.
Trait Implementations§
Source§impl Clone for SerializedPlan
impl Clone for SerializedPlan
Source§fn clone(&self) -> SerializedPlan
fn clone(&self) -> SerializedPlan
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 SerializedPlan
impl Debug for SerializedPlan
Source§impl<'de> Deserialize<'de> for SerializedPlan
impl<'de> Deserialize<'de> for SerializedPlan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SerializedPlan
impl RefUnwindSafe for SerializedPlan
impl Send for SerializedPlan
impl Sync for SerializedPlan
impl Unpin for SerializedPlan
impl UnsafeUnpin for SerializedPlan
impl UnwindSafe for SerializedPlan
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more