Helper function to check if params is None or would serialize to null.
(opt: &Option<T>)
| 96 | |
| 97 | /// Helper function to check if params is None or would serialize to null. |
| 98 | fn is_none_or_null<T: Serialize>(opt: &Option<T>) -> bool { |
| 99 | match opt { |
| 100 | None => true, |
| 101 | Some(val) => match serde_json::to_value(&val) { |
| 102 | Ok(Value::Null) => true, |
| 103 | _ => false, |
| 104 | }, |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | #[derive(Clone, Debug, PartialEq)] |
| 109 | pub struct JsonRpcResponse<R = ()> { |
nothing calls this directly
no outgoing calls
no test coverage detected