pub enum DriverError {
Connect(Box<dyn Error + Send + Sync>),
Operation(Box<dyn Error + Send + Sync>),
InvalidTagValue {
tag: TagId,
message: String,
},
Unsupported {
operation: &'static str,
},
IndexOperationRejected {
message: String,
},
IncompatibleGateway {
operation: &'static str,
},
BrowseStateInvalid,
}Expand description
All the ways a crate::Driver call can fail.
Deliberately not a single opaque/anyhow-style error: callers need to tell “the driver
itself is unreachable” apart from “one read/write/browse call failed” apart from “this
driver doesn’t support that at all” to react correctly — in particular the
unattended-operation guardrails planned for cli-safety need to distinguish a connection
failure (abort immediately, nothing was attempted) from an operation failure (may be worth
one retry) rather than treating every failure identically.
The underlying cause is boxed (Box<dyn std::error::Error + Send + Sync>) rather than
naming a concrete type, since different crate::Driver implementations wrap
completely unrelated error types (a future driver-opcda’s opcda_bridge::Error, a
simulator’s own internal error, golden-trace parse errors for driver-replay) and this
trait/error model must not force all of them to share one. #[source] still preserves the
full chain for std::error::Error::source()/anyhow/logging to walk.
Variants§
Connect(Box<dyn Error + Send + Sync>)
The driver could not be reached at all — nothing was read or written. For
driver-opcda, this is expected to wrap opcda_bridge::Error::Connect.
Operation(Box<dyn Error + Send + Sync>)
A read/write/browse call reached the driver but failed there — an RPC error,
an unresolvable tag, a malformed response. For driver-opcda, this is expected to
wrap opcda_bridge::Error::Rpc. Distinct from a rejected-but-otherwise-successful
write (see crate::types::WriteOutcome), which is not an error at all.
InvalidTagValue
One specific tag’s value could not be used as requested — e.g. its raw string value isn’t valid for whatever the caller needed it to mean. Carries the tag so a caller reporting a failed run can name exactly which tag was the problem.
Unsupported
This driver does not implement the requested operation at all (e.g. browse on the
simulator or replay drivers, which have no real tag tree to browse) — distinct from
a transient DriverError::Operation failure, since retrying can never help.
IndexOperationRejected
The gateway rejected an indexed-search operation because the server’s current enrollment or index state does not permit it.
IncompatibleGateway
The connected gateway predates a required protocol operation.
BrowseStateInvalid
A server-side browse session or continuation token is no longer usable.
Trait Implementations§
Source§impl Debug for DriverError
impl Debug for DriverError
Source§impl Display for DriverError
impl Display for DriverError
Source§impl Error for DriverError
impl Error for DriverError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for DriverError
impl !UnwindSafe for DriverError
impl Freeze for DriverError
impl Send for DriverError
impl Sync for DriverError
impl Unpin for DriverError
impl UnsafeUnpin for DriverError
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].