If I make a request with reqwest
, I get a reqwest::error::Result<Response>
:
let client = reqwest::blocking::Client::new();
let result = client.post("http://example.com").send();
I want to pass this result to a function, which will then determine the course of action. It will take into account not only the received response but also whether a response was received at all, that's why I want to pass the Result
, not just the Response
.
I tried this:
fn error_action(api_call_result: reqwest::error::Result<Response>) -> ErrorType {
}
But:
error[E0603]: module `error` is private
--> src\b2.rs:62:44
|
62 | fn error_action(api_call_result: reqwest::error::Result<Response>) -> ErrorType {
| ^^^^^ private module