Trait cuprate_rpc_types::RpcCall
source · pub trait RpcCall {
const IS_RESTRICTED: bool;
const IS_EMPTY: bool;
}
Expand description
Metadata about an RPC call.
This trait describes some metadata about RPC requests.
It is implemented on all request types within:
See also RpcCallValue
for a dynamic by-value version of this trait.
Required Associated Constants§
sourceconst IS_RESTRICTED: bool
const IS_RESTRICTED: bool
Is true
if this RPC method should
only be allowed on local servers.
If this is false
, it should be
okay to execute the method even on restricted
RPC servers.
use cuprate_rpc_types::{RpcCall, json::*};
// Allowed method, even on restricted RPC servers (18089).
assert!(!GetBlockCountRequest::IS_RESTRICTED);
// Restricted methods, only allowed
// for unrestricted RPC servers (18081).
assert!(GetConnectionsRequest::IS_RESTRICTED);
Object Safety§
This trait is not object safe.