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);
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.