MCPcopy Create free account
hub / github.com/ElementsProject/lightning / is_none_or_null

Function is_none_or_null

plugins/lsps-plugin/src/proto/jsonrpc.rs:98–106  ·  view source on GitHub ↗

Helper function to check if params is None or would serialize to null.

(opt: &Option<T>)

Source from the content-addressed store, hash-verified

96
97/// Helper function to check if params is None or would serialize to null.
98fn 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)]
109pub struct JsonRpcResponse<R = ()> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected