pub type JsonResult = Result<Value, Value>;Expand description
A shorthand for a json result.
This is useful when you want to return a json response.
It is a type alias for a Result with a Value as the ok and error type.
§Example
ⓘ
use serde_json::json;
use ngyn::prelude::*;
#[handler]
async fn get_values() -> JsonResult {
let data = json!({ "key": "value" });
Ok(data)
}Aliased Type§
pub enum JsonResult {
Ok(Value),
Err(Value),
}