File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ impl BlockSourceError {
132132 }
133133
134134 /// 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.
135138 pub fn into_inner ( self ) -> Box < dyn std:: error:: Error + Send + Sync > {
136139 self . error
137140 }
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ impl fmt::Display for RpcError {
3535impl Error for RpcError { }
3636
3737/// 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.
3841pub struct RpcClient {
3942 basic_auth : String ,
4043 endpoint : HttpEndpoint ,
@@ -57,6 +60,9 @@ impl RpcClient {
5760 }
5861
5962 /// 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`].
6066 pub async fn call_method < T > ( & self , method : & str , params : & [ serde_json:: Value ] ) -> std:: io:: Result < T >
6167 where JsonResponse : TryFrom < Vec < u8 > , Error = std:: io:: Error > + TryInto < T , Error = std:: io:: Error > {
6268 let host = format ! ( "{}:{}" , self . endpoint. host( ) , self . endpoint. port( ) ) ;
You can’t perform that action at this time.
0 commit comments