pub struct SimulatorDriver { /* private fields */ }Expand description
The Driver implementation for CI E2E tests and demo mode: an in-process
FopdtProcess served through exactly two tags – a PV tag (reading it advances the
simulated clock by one tick) and an MV tag (reading it reports the last-written value
without advancing anything; writing it records a new controller output). Any other tag
is DriverError::InvalidTagValue; Driver::browse is always
DriverError::Unsupported, per that method’s own documented convention for drivers
with no real tag tree.
Uses a plain std::sync::Mutex, not tokio::sync::Mutex like crate::OpcDaDriver:
every operation here is synchronous, in-memory math with no .await point anywhere in
the critical section, so there is nothing that could hold the guard across a suspension
point – the concern tokio::sync::Mutex exists for – in the first place.
Implementations§
Source§impl SimulatorDriver
impl SimulatorDriver
Sourcepub fn new(
pv_tag: impl Into<TagId>,
mv_tag: impl Into<TagId>,
config: FopdtConfig,
initial_pv: f32,
initial_mv: f32,
seed: u64,
) -> SimulatorDriver
pub fn new( pv_tag: impl Into<TagId>, mv_tag: impl Into<TagId>, config: FopdtConfig, initial_pv: f32, initial_mv: f32, seed: u64, ) -> SimulatorDriver
pv_tag/mv_tag are the only two tags this driver recognizes – pick names that
match whatever tag configuration the rest of a test or demo run uses, so the same
tag names work whether the caller is pointed at this driver or a real
crate::OpcDaDriver.
Trait Implementations§
Source§impl Debug for SimulatorDriver
impl Debug for SimulatorDriver
Source§impl Driver for SimulatorDriver
impl Driver for SimulatorDriver
Source§fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
tags: &'life1 [TagId],
) -> Pin<Box<dyn Future<Output = DriverResult<Vec<TagValue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
tags: &'life1 [TagId],
) -> Pin<Box<dyn Future<Output = DriverResult<Vec<TagValue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 TagId,
value: TagWrite,
) -> Pin<Box<dyn Future<Output = DriverResult<WriteOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 TagId,
value: TagWrite,
) -> Pin<Box<dyn Future<Output = DriverResult<WriteOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DriverResult<DriverCapabilities>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DriverResult<DriverCapabilities>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn browse<'life0, 'async_trait>(
&'life0 self,
_request: BrowsePageRequest,
) -> Pin<Box<dyn Future<Output = DriverResult<BrowsePage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn browse<'life0, 'async_trait>(
&'life0 self,
_request: BrowsePageRequest,
) -> Pin<Box<dyn Future<Output = DriverResult<BrowsePage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn close_browse_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = DriverResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn close_browse_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = DriverResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn search<'life0, 'async_trait>(
&'life0 self,
_request: SearchRequest,
) -> Pin<Box<dyn Future<Output = DriverResult<Vec<SearchEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search<'life0, 'async_trait>(
&'life0 self,
_request: SearchRequest,
) -> Pin<Box<dyn Future<Output = DriverResult<Vec<SearchEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn search_index_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search_index_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn refresh_search_index<'life0, 'async_trait>(
&'life0 self,
_force: bool,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn refresh_search_index<'life0, 'async_trait>(
&'life0 self,
_force: bool,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn control_search_index<'life0, 'async_trait>(
&'life0 self,
_action: SearchIndexControlAction,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn control_search_index<'life0, 'async_trait>(
&'life0 self,
_action: SearchIndexControlAction,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn set_search_index_auto_refresh<'life0, 'async_trait>(
&'life0 self,
_enabled: bool,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_search_index_auto_refresh<'life0, 'async_trait>(
&'life0 self,
_enabled: bool,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn delete_search_index<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_search_index<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn search_index<'life0, 'async_trait>(
&'life0 self,
_request: SearchIndexRequest,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search_index<'life0, 'async_trait>(
&'life0 self,
_request: SearchIndexRequest,
) -> Pin<Box<dyn Future<Output = DriverResult<SearchIndexResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for SimulatorDriver
impl RefUnwindSafe for SimulatorDriver
impl Send for SimulatorDriver
impl Sync for SimulatorDriver
impl Unpin for SimulatorDriver
impl UnsafeUnpin for SimulatorDriver
impl UnwindSafe for SimulatorDriver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].