pub struct OpcDaDriver { /* private fields */ }Expand description
The primary Driver for v1: reads, writes, and browses OPC DA tags through an
opcda-bridge gateway’s gRPC API.
Holds its opcda_bridge::Client behind a tokio::sync::Mutex because the client’s own
methods take &mut self (it buffers per-call gRPC codec state) while Driver’s
methods take &self (required so a driver can be shared behind Arc<dyn Driver>) —
serializing calls through the one connection is a reasonable tradeoff, since a single
tuning session only ever has one read/write/browse in flight at a time, and the
underlying HTTP/2 channel stays cheaply multiplexed regardless of how many logical
callers there are.
Implementations§
Source§impl OpcDaDriver
impl OpcDaDriver
Sourcepub async fn connect(
host: &str,
server: impl Into<String>,
) -> DriverResult<Self>
pub async fn connect( host: &str, server: impl Into<String>, ) -> DriverResult<Self>
Connects to an opcda-bridge gateway at host (e.g. "localhost:7600") and binds
to server — the OPC DA server’s ProgID (e.g. "Matrikon.OPC.Simulation.1") that
every subsequent read/write/browse call is scoped to.
Sourcepub async fn capabilities(&self) -> DriverResult<DriverCapabilities>
pub async fn capabilities(&self) -> DriverResult<DriverCapabilities>
Reports the bridge and OPC server’s browse/search capabilities.
Sourcepub async fn browse_page(
&self,
request: BrowsePageRequest,
) -> DriverResult<BrowsePage>
pub async fn browse_page( &self, request: BrowsePageRequest, ) -> DriverResult<BrowsePage>
Requests one bounded browse page without following its continuation token.
Sourcepub async fn search_stream(
&self,
request: SearchRequest,
) -> DriverResult<DriverSearchStream>
pub async fn search_stream( &self, request: SearchRequest, ) -> DriverResult<DriverSearchStream>
Starts a progressive namespace search. Dropping the returned stream cancels the search.
Sourcepub async fn search_events(
&self,
request: SearchRequest,
) -> DriverResult<Vec<SearchEvent>>
pub async fn search_events( &self, request: SearchRequest, ) -> DriverResult<Vec<SearchEvent>>
Collects a complete search stream for callers that do not need progressive delivery.
Sourcepub async fn search_index_status(&self) -> DriverResult<SearchIndexStatus>
pub async fn search_index_status(&self) -> DriverResult<SearchIndexStatus>
Returns the gateway-owned persistent namespace-index status for this OPC server.
Sourcepub async fn set_search_index_auto_refresh(
&self,
enabled: bool,
) -> DriverResult<SearchIndexStatus>
pub async fn set_search_index_auto_refresh( &self, enabled: bool, ) -> DriverResult<SearchIndexStatus>
Enables or disables future automatic refreshes for this OPC server’s index.
Sourcepub async fn delete_search_index(&self) -> DriverResult<SearchIndexStatus>
pub async fn delete_search_index(&self) -> DriverResult<SearchIndexStatus>
Deletes this OPC server’s persistent namespace index and enrollment.
Sourcepub async fn refresh_search_index(
&self,
force: bool,
) -> DriverResult<SearchIndexStatus>
pub async fn refresh_search_index( &self, force: bool, ) -> DriverResult<SearchIndexStatus>
Starts or coalesces a persistent namespace-index refresh for this OPC server.
Sourcepub async fn control_search_index(
&self,
action: SearchIndexControlAction,
) -> DriverResult<SearchIndexStatus>
pub async fn control_search_index( &self, action: SearchIndexControlAction, ) -> DriverResult<SearchIndexStatus>
Pauses, resumes, or cancels a persistent namespace-index build.
Sourcepub async fn search_index_query(
&self,
request: SearchIndexRequest,
) -> DriverResult<SearchIndexResponse>
pub async fn search_index_query( &self, request: SearchIndexRequest, ) -> DriverResult<SearchIndexResponse>
Queries the gateway-owned persistent namespace index without falling back to live namespace traversal.
Trait Implementations§
Source§impl Debug for OpcDaDriver
impl Debug for OpcDaDriver
Source§impl Driver for OpcDaDriver
impl Driver for OpcDaDriver
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 OpcDaDriver
impl !RefUnwindSafe for OpcDaDriver
impl !UnwindSafe for OpcDaDriver
impl Send for OpcDaDriver
impl Sync for OpcDaDriver
impl Unpin for OpcDaDriver
impl UnsafeUnpin for OpcDaDriver
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].