0.5.1-pre.002
This commit is contained in:
49
ks-lib/src/executor/router/dflow_aggregator_v4.rs
Normal file
49
ks-lib/src/executor/router/dflow_aggregator_v4.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
// file: ks-lib/src/executor/router/dflow_aggregator_v4.rs
|
||||
// version: 4
|
||||
|
||||
//! Reserved executor for `router_dflow_aggregator_v4`.
|
||||
|
||||
/// Reserved executor for the `router_dflow_aggregator_v4` program surface.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ExRouterDflowAggregatorV4Executor;
|
||||
|
||||
impl crate::ExApiInstructionExecutor for crate::ExRouterDflowAggregatorV4Executor {
|
||||
fn executor_name(&self) -> &'static str {
|
||||
return "kb-lib.executor.router.dflow_aggregator_v4";
|
||||
}
|
||||
|
||||
fn executor_version(&self) -> &'static str {
|
||||
return env!("CARGO_PKG_VERSION");
|
||||
}
|
||||
|
||||
fn program_ids(&self) -> &'static [&'static str] {
|
||||
return &[ks_program_ids::ROUTER_DFLOW_AGGREGATOR_V4_PROGRAM_ID];
|
||||
}
|
||||
|
||||
fn supports_request(
|
||||
&self,
|
||||
request: &crate::ExApiExecutionRequest,
|
||||
) -> crate::ExApiExecutionSupport {
|
||||
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
|
||||
return crate::ExApiExecutionSupport::Maybe;
|
||||
}
|
||||
return crate::ExApiExecutionSupport::No;
|
||||
}
|
||||
|
||||
fn build_plan(
|
||||
&self,
|
||||
_request: &crate::ExApiExecutionRequest,
|
||||
) -> ks_core::Result<crate::ExApiExecutionPlan> {
|
||||
let payload_json = match crate::executor_api_serialize_payload_json(
|
||||
&serde_json::json!({"status":"reserved_executor","surface":"router_dflow_aggregator_v4"}),
|
||||
) {
|
||||
std::result::Result::Ok(serialized) => serialized,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
return std::result::Result::Ok(crate::ExApiExecutionPlan {
|
||||
executor_name: "kb-lib.executor.router.dflow_aggregator_v4".to_string(),
|
||||
instruction_count: 0,
|
||||
payload_json,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user