50 lines
1.7 KiB
Rust
50 lines
1.7 KiB
Rust
// file: ks-lib/src/executor/router/dflow_aggregator_v4.rs
|
|
// version: 5
|
|
|
|
//! 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 "ks-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: "ks-lib-executor.router.dflow_aggregator_v4".to_string(),
|
|
instruction_count: 0,
|
|
payload_json,
|
|
});
|
|
}
|
|
}
|