pub enum TransportError {
Unavailable(String),
Refused {
code: i64,
message: String,
data: Option<String>,
},
}Expand description
Why a request did not complete.
Variants§
The transport could not deliver the request, or the peer did not answer it.
A String for the same reason the server’s
ExchangeError is: the
transport names its own failures and the application layer has no
business enumerating them.
Refused
The peer answered, and the answer was a JSON-RPC error.
Separate from Unavailable because the peer is
fine and the request was not: a caller can act on the code. SEP-2575’s
-32022 carries the revisions the server does speak, and -32021 the
capabilities it needs, and a client that flattened them to a string
could neither renegotiate nor retry.
Implementations§
Source§impl TransportError
impl TransportError
Sourcepub fn supported_versions(&self) -> Option<Vec<String>>
pub fn supported_versions(&self) -> Option<Vec<String>>
The revisions a -32022 refusal says the server supports.
Trait Implementations§
Source§impl Clone for TransportError
impl Clone for TransportError
Source§impl Debug for TransportError
impl Debug for TransportError
Source§impl Display for TransportError
impl Display for TransportError
impl Eq for TransportError
Source§impl Error for TransportError
impl Error for TransportError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<TransportError> for ConnectError
impl From<TransportError> for ConnectError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Converts to this type from the input type.
Source§impl From<TransportError> for HandshakeError
impl From<TransportError> for HandshakeError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Converts to this type from the input type.
Source§impl From<TransportError> for ClientError
impl From<TransportError> for ClientError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TransportError
impl PartialEq for TransportError
impl StructuralPartialEq for TransportError
Auto Trait Implementations§
impl Freeze for TransportError
impl RefUnwindSafe for TransportError
impl Send for TransportError
impl Sync for TransportError
impl Unpin for TransportError
impl UnsafeUnpin for TransportError
impl UnwindSafe for TransportError
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
Mutably borrows from an owned value. Read more