()
| 33 | |
| 34 | impl HttpClient { |
| 35 | pub fn new() -> Result<Self> { |
| 36 | let client = Client::builder().user_agent("Setu/0.1.0").build()?; |
| 37 | |
| 38 | Ok(Self { |
| 39 | client, |
| 40 | runtime: shared_tokio_runtime(), |
| 41 | }) |
| 42 | } |
| 43 | |
| 44 | /// Spawn an HTTP request on the Tokio runtime and return a receiver for the result. |
| 45 | /// This allows GPUI's async executor to await the result without being in a Tokio context. |
no test coverage detected