use super::ExecutionError;
use alloc::sync::Arc;
pub trait HardwareGraph: Send + Sync + 'static {
unsafe fn replay(&self) -> Result<(), ExecutionError>;
}
#[derive(Clone)]
pub struct BackendGraph(Arc<dyn HardwareGraph>);
impl BackendGraph {
pub fn new(graph: impl HardwareGraph) -> Self { Self(Arc::new(graph)) }
pub unsafe fn replay(&self) -> Result<(), ExecutionError> {
unsafe { self.0.replay() }
}
}