Skip to main content

hydr_structures/structures/controlled_pump/
trial.rs

1//! Ownership-based acceptance of the complete sampled pump response continuation.
2
3use super::{ControlledPumpBatch, ControlledPumpOutput};
4use crate::structures::{OperatingControlBatch, StructureError, StructureOperation};
5use numr::dtype::DType;
6use numr::runtime::Runtime;
7
8/// Immutable complete candidate. Discarding it preserves accepted control and response operation.
9#[derive(Clone, Debug)]
10pub struct ControlledPumpTrial<R: Runtime<DType = DType>> {
11    pub(crate) next: ControlledPumpBatch<R>,
12}
13impl<R: Runtime<DType = DType>> ControlledPumpTrial<R> {
14    /// Candidate controller memory and bounded decision receipts.
15    pub fn controls(&self) -> &OperatingControlBatch<R> {
16        self.next.controls()
17    }
18    /// Explicitly project candidate actual operation and response evidence.
19    pub fn outputs(&self) -> Result<Vec<ControlledPumpOutput>, StructureError>
20    where
21        R::Client: numr::ops::ConditionalOps<R>,
22    {
23        self.next.outputs()
24    }
25    /// Explicitly project candidate original-order operation packets.
26    pub fn operations(&self) -> Result<Vec<StructureOperation>, StructureError>
27    where
28        R::Client: numr::ops::ConditionalOps<R>,
29    {
30        self.next.operations()
31    }
32    /// Accept complete sampled response continuation by ownership, without numerical projection.
33    pub fn into_next(self) -> ControlledPumpBatch<R> {
34        self.next
35    }
36}