pub fn execute_query(query: Result<String, &str>) -> ValueExpand description
Executes a given query and processes the response.
This function takes a Result containing a String query or an error message.
It unwraps the query string, fetches the response from the URL specified by the query,
and then parses this response into a Value.
§Arguments
query- AResultwrapping aStringquery or an error message.
§Returns
- A
Valueobtained from parsing the response. If the response fetching or parsing fails, it returns a defaultValue.
§Panics
This function will panic if query is an Err variant.
§Example
use fenir::database::execute_query;
let query = Ok(String::from("http://example.com/api"));
let value = execute_query(query);