pub fn process_json<Q: Query<A>, A: AuthToken>(
json: String,
query: impl Borrow<Q>,
) -> Result<Q::Output>Expand description
Process a string of JSON as if it had been directly received from the api for a query. Note that this is generic across AuthToken, and you may need to provide the AuthToken type using ‘turbofish’.
§Usage
let json = r#"{ "test" : true }"#.to_string();
let query = ytmapi_rs::query::SearchQuery::new("Beatles");
let result = ytmapi_rs::process_json::<_, ytmapi_rs::auth::BrowserToken>(json, query);
assert!(result.is_err());