hydr_structures/structures/actuator/
trial.rs1use super::{
4 GateActuatorBatch, GateActuatorOutput, GateActuatorState, GateActuatorStepDiagnostics,
5};
6use crate::structures::StructureError;
7use numr::dtype::DType;
8use numr::runtime::Runtime;
9
10#[derive(Clone, Debug)]
12pub struct GateActuatorTrial<R: Runtime<DType = DType>> {
13 pub(crate) next: GateActuatorBatch<R>,
14}
15impl<R: Runtime<DType = DType>> GateActuatorTrial<R> {
16 pub fn outputs(&self) -> Result<Vec<GateActuatorOutput>, StructureError> {
18 self.next.outputs()
19 }
20 pub fn states(&self) -> Result<Vec<GateActuatorState>, StructureError> {
22 self.next.states()
23 }
24 pub fn diagnostics(&self) -> Result<GateActuatorStepDiagnostics, StructureError> {
26 self.next.last_step()?.ok_or_else(|| {
27 StructureError::numerical("actuator trial lacks its immediate step receipt")
28 })
29 }
30 pub fn into_next(self) -> GateActuatorBatch<R> {
32 self.next
33 }
34}