pub trait RpcCallValue {
// Required methods
fn is_restricted(&self) -> bool;
fn is_empty(&self) -> bool;
}Expand description
By-value version of RpcCall.
This trait is a mirror of RpcCall,
except it takes self by value instead
of being a const property.
This exists for enums where requests must be dynamically
matched like JsonRpcRequest.
All types that implement RpcCall automatically implement RpcCallValue.
Required Methods§
Sourcefn is_restricted(&self) -> bool
fn is_restricted(&self) -> bool
Same as RpcCall::IS_RESTRICTED.
use cuprate_rpc_types::{RpcCallValue, json::*};
assert!(!GetBlockCountRequest::default().is_restricted());
assert!(GetConnectionsRequest::default().is_restricted());Sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Same as RpcCall::IS_EMPTY.
use cuprate_rpc_types::{RpcCallValue, json::*};
assert!(GetBlockCountRequest::default().is_empty());
assert!(!OnGetBlockHashRequest::default().is_empty());