pub enum Error {
Connect(Error),
Rpc(Status),
}Expand description
Errors that can occur while talking to an opcda-bridge gateway.
Both variants use #[error(transparent)]: Display and source()
forward straight through to the wrapped tonic error with no added
prefix or extra chain link. This matters because opcda-bridge-client’s
CLI commands convert this type into an anyhow::Error with a bare ?
(the same way they converted a raw tonic::Status/
tonic::transport::Error before this crate existed); transparency keeps
that conversion rendering byte-for-byte the same error text the CLI
printed before this crate existed, which is part of this crate’s
contract with its CLI consumer and is pinned down by
test_error_rpc_anyhow_debug_matches_bare_status and
client::tests::test_connect_failure_anyhow_debug_matches_bare_transport_error.
A dedicated thiserror enum (rather than reusing anyhow::Error here
the way opcda-bridge-client’s own commands do) still lets a downstream
consumer that does not want an anyhow dependency match on
Error::Connect / Error::Rpc directly.
Variants§
Connect(Error)
Failed to establish the gRPC channel to the gateway (e.g. connection refused, DNS failure, invalid address).
Rpc(Status)
The gateway returned a gRPC error for a ListServers/Browse/
Read/Write call, or for a Browse response-stream item.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request