Skip to main content

cu_profiler_core/backend/
banks_client.rs

1//! `BanksClient` backend — **interface stub** (not yet implemented).
2//!
3//! Wraps a `BanksClient` against a test validator. Like [`super::ProgramTestBackend`]
4//! it is a stub: [`ExecutionBackend::run`] returns
5//! [`crate::Error::BackendUnimplemented`]. For real compute-unit metering today,
6//! use the `cu-profiler-mollusk` integration crate; this stub documents the
7//! intended shape and is on the [roadmap](https://github.com/MerlijnW70/cu-profiler/blob/main/ROADMAP.md).
8
9use crate::Result;
10use crate::backend::{ExecutionBackend, SimulationOutput};
11use crate::error::Error;
12use crate::metadata::BackendKind;
13use crate::scenario::Scenario;
14
15/// Backend that drives a `BanksClient`.
16#[derive(Debug, Clone, Default)]
17pub struct BanksClientBackend {
18    /// Optional RPC/validator endpoint the client should connect to.
19    pub endpoint: Option<String>,
20}
21
22impl BanksClientBackend {
23    /// Construct a backend, optionally targeting an endpoint.
24    #[must_use]
25    pub fn new(endpoint: Option<String>) -> Self {
26        Self { endpoint }
27    }
28}
29
30impl ExecutionBackend for BanksClientBackend {
31    fn kind(&self) -> BackendKind {
32        BackendKind::BanksClient
33    }
34
35    fn run(&self, _scenario: &Scenario) -> Result<SimulationOutput> {
36        Err(Error::BackendUnimplemented(
37            "banks-client: this core type is an interface stub and is not yet \
38             implemented — use the `cu-profiler-mollusk` integration crate for \
39             real compute-unit metering today"
40                .to_string(),
41        ))
42    }
43}