(
&self,
request: tonic::Request<pb::DatastoreRequest>,
)
| 499 | } |
| 500 | |
| 501 | async fn datastore( |
| 502 | &self, |
| 503 | request: tonic::Request<pb::DatastoreRequest>, |
| 504 | ) -> Result<tonic::Response<pb::DatastoreResponse>, tonic::Status> { |
| 505 | let req = request.into_inner(); |
| 506 | let req: requests::DatastoreRequest = req.try_into()?; |
| 507 | debug!("Client asked for datastore"); |
| 508 | trace!("datastore request: {:?}", req); |
| 509 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 510 | .await |
| 511 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 512 | let result = rpc.call(Request::Datastore(req)) |
| 513 | .await |
| 514 | .map_err(|e| Status::new( |
| 515 | Code::Unknown, |
| 516 | format!("Error calling method Datastore: {:?}", e)))?; |
| 517 | match result { |
| 518 | Response::Datastore(r) => { |
| 519 | trace!("datastore response: {:?}", r); |
| 520 | Ok(tonic::Response::new(r.into())) |
| 521 | }, |
| 522 | r => Err(Status::new( |
| 523 | Code::Internal, |
| 524 | format!( |
| 525 | "Unexpected result {:?} to method call Datastore", |
| 526 | r |
| 527 | ) |
| 528 | )), |
| 529 | } |
| 530 | |
| 531 | } |
| 532 | |
| 533 | async fn datastore_usage( |
| 534 | &self, |
nothing calls this directly
no test coverage detected