Retrieves information about the Tappd instance
(&self)
| 168 | |
| 169 | /// Retrieves information about the Tappd instance |
| 170 | pub async fn info(&self) -> Result<TappdInfoResponse> { |
| 171 | #[derive(Deserialize)] |
| 172 | struct RawInfoResponse { |
| 173 | app_id: String, |
| 174 | instance_id: String, |
| 175 | app_cert: String, |
| 176 | tcb_info: String, |
| 177 | app_name: String, |
| 178 | } |
| 179 | |
| 180 | let raw_response: RawInfoResponse = self |
| 181 | .send_rpc_request("/prpc/Tappd.Info", &json!({})) |
| 182 | .await?; |
| 183 | |
| 184 | let tcb_info: TappdTcbInfo = serde_json::from_str(&raw_response.tcb_info)?; |
| 185 | |
| 186 | Ok(TappdInfoResponse { |
| 187 | app_id: raw_response.app_id, |
| 188 | instance_id: raw_response.instance_id, |
| 189 | app_cert: raw_response.app_cert, |
| 190 | tcb_info, |
| 191 | app_name: raw_response.app_name, |
| 192 | }) |
| 193 | } |
| 194 | } |