pub trait RuntimeController: Send + Sync {
// Required methods
fn controller_id(&self) -> &ControllerId;
fn invoke(&self, task: &NodeTask) -> Result<NodeResult>;
// Provided methods
fn export_artifact_payload(
&self,
_artifact_id: &ArtifactId,
) -> Result<Option<Vec<u8>>> { ... }
fn hydrate_artifact_payload(
&self,
_request: &ArtifactMaterializationRequest,
_payload: &[u8],
) -> Result<HandleRef> { ... }
fn release_hydrated_artifact_payload(
&self,
_handle: &HandleRef,
) -> Result<()> { ... }
fn invoke_with_data_provider(
&self,
task: &NodeTask,
_data_provider: &dyn RuntimeDataProvider,
) -> Result<NodeResult> { ... }
fn create_tuner_session(
&self,
task: &RuntimeHpoCampaignTask,
_context: &RuntimeHpoExecutionContext,
) -> Result<Box<dyn RuntimeTunerSession>> { ... }
fn invoke_aggregation(
&self,
task: &AggregationControllerTask,
) -> Result<AggregationControllerResult> { ... }
}Required Methods§
fn controller_id(&self) -> &ControllerId
fn invoke(&self, task: &NodeTask) -> Result<NodeResult>
Provided Methods§
Sourcefn export_artifact_payload(
&self,
_artifact_id: &ArtifactId,
) -> Result<Option<Vec<u8>>>
fn export_artifact_payload( &self, _artifact_id: &ArtifactId, ) -> Result<Option<Vec<u8>>>
Export a raw, portable artifact payload after REFIT. The scheduler immediately transfers this into the durable bundle; implementations must not rely on the returned handle surviving a process boundary.
Sourcefn hydrate_artifact_payload(
&self,
_request: &ArtifactMaterializationRequest,
_payload: &[u8],
) -> Result<HandleRef>
fn hydrate_artifact_payload( &self, _request: &ArtifactMaterializationRequest, _payload: &[u8], ) -> Result<HandleRef>
Materialize a durable raw artifact payload in this controller’s fresh process-local runtime. The payload is owned by the bundle; the returned handle is deliberately ephemeral and is only valid for the current replay invocation. Controllers that do not publish raw portable artifacts keep the default fail-closed implementation.
Sourcefn release_hydrated_artifact_payload(&self, _handle: &HandleRef) -> Result<()>
fn release_hydrated_artifact_payload(&self, _handle: &HandleRef) -> Result<()>
Release an invocation-local handle previously returned by
Self::hydrate_artifact_payload. Replay calls this exactly once when
execution finishes or aborts; implementations must accept a handle
that the controller already consumed during successful invocation.
Sourcefn invoke_with_data_provider(
&self,
task: &NodeTask,
_data_provider: &dyn RuntimeDataProvider,
) -> Result<NodeResult>
fn invoke_with_data_provider( &self, task: &NodeTask, _data_provider: &dyn RuntimeDataProvider, ) -> Result<NodeResult>
Provider-aware execution is opt-in. Existing controllers retain the opaque-handle path; native Methods controllers can only receive the narrow provider capability above when the scheduler has one.
Sourcefn create_tuner_session(
&self,
task: &RuntimeHpoCampaignTask,
_context: &RuntimeHpoExecutionContext,
) -> Result<Box<dyn RuntimeTunerSession>>
fn create_tuner_session( &self, task: &RuntimeHpoCampaignTask, _context: &RuntimeHpoExecutionContext, ) -> Result<Box<dyn RuntimeTunerSession>>
Create an execution-local tuner session for one scheduler-owned HPO
campaign. The controller stays Send + Sync because it is only a
factory; the returned session has no Send/Sync bound and may therefore
own a thread-affine native context and optimizer. The scheduler keeps
this session on its calling thread and passes only portable proposal and
evaluation values across the controller boundary.
fn invoke_aggregation( &self, task: &AggregationControllerTask, ) -> Result<AggregationControllerResult>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".