File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ impl BlockSourceError {
132
132
}
133
133
134
134
/// Converts the error into the underlying error.
135
+ ///
136
+ /// May contain an [`std::io::Error`] from the [`BlockSource`]. See implementations for further
137
+ /// details, if any.
135
138
pub fn into_inner ( self ) -> Box < dyn std:: error:: Error + Send + Sync > {
136
139
self . error
137
140
}
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ impl fmt::Display for RpcError {
35
35
impl Error for RpcError { }
36
36
37
37
/// A simple RPC client for calling methods using HTTP `POST`.
38
+ ///
39
+ /// Implements [`BlockSource`] and may return an `Err` containing [`RpcError`]. See
40
+ /// [`RpcClient::call_method`] for details.
38
41
pub struct RpcClient {
39
42
basic_auth : String ,
40
43
endpoint : HttpEndpoint ,
@@ -57,6 +60,9 @@ impl RpcClient {
57
60
}
58
61
59
62
/// Calls a method with the response encoded in JSON format and interpreted as type `T`.
63
+ ///
64
+ /// When an `Err` is returned, [`std::io::Error::into_inner`] may contain an [`RpcError`] if
65
+ /// [`std::io::Error::kind`] is [`std::io::ErrorKind::Other`].
60
66
pub async fn call_method < T > ( & self , method : & str , params : & [ serde_json:: Value ] ) -> std:: io:: Result < T >
61
67
where JsonResponse : TryFrom < Vec < u8 > , Error = std:: io:: Error > + TryInto < T , Error = std:: io:: Error > {
62
68
let host = format ! ( "{}:{}" , self . endpoint. host( ) , self . endpoint. port( ) ) ;
You can’t perform that action at this time.
0 commit comments