Enum RpcModuleSelection
pub enum RpcModuleSelection {
All,
Standard,
Selection(HashSet<RethRpcModule>),
}Expand description
Describes the modules that should be installed.
§Example
Create a RpcModuleSelection from a selection.
use reth_rpc_server_types::{RethRpcModule, RpcModuleSelection};
let config: RpcModuleSelection = vec![RethRpcModule::Eth].into();Source§
Source
The standard modules to instantiate by default eth, net, web3
Source
All modules that are available by default on IPC.
By default all modules are available on IPC.
Source
Creates a new unique RpcModuleSelection::Selection from the given items.
§Note
This will dedupe the selection and remove duplicates while preserving the order.
§Example
Create a selection from the RethRpcModule string identifiers
use reth_rpc_server_types::{RethRpcModule, RpcModuleSelection};
let selection = vec!["eth", "admin"];
let config = RpcModuleSelection::try_from_selection(selection).unwrap();
assert_eq!(config, RpcModuleSelection::from([RethRpcModule::Eth, RethRpcModule::Admin]));Create a unique selection from the RethRpcModule string identifiers
use reth_rpc_server_types::{RethRpcModule, RpcModuleSelection};
let selection = vec!["eth", "admin", "eth", "admin"];
let config = RpcModuleSelection::try_from_selection(selection).unwrap();
assert_eq!(config, RpcModuleSelection::from([RethRpcModule::Eth, RethRpcModule::Admin]));Source
Returns the number of modules in the selection
Source
Returns true if no selection is configured
Source
Returns true if all modules are selected
Source
Returns an iterator over all configured RethRpcModule
Source
Returns true if both selections are identical.
Source
Returns true if the selection contains the given module.
Source
Adds a module to the selection.
If the selection is All, this is a no-op.
Otherwise, converts to a Selection and adds the module.
Source
Returns a new selection with the given module added.
If the selection is All, returns All.
Otherwise, converts to a Selection and adds the module.
Source
Extends the selection with modules from an iterator.
If the selection is All, this is a no-op.
Otherwise, converts to a Selection and adds the modules.
Source
Returns a new selection with modules from an iterator added.
If the selection is All, returns All.
Otherwise, converts to a Selection and adds the modules.
§
§
Causes self to use its Binary implementation when Debug-formatted.
§
Causes self to use its Display implementation when
Debug-formatted.
§
Causes self to use its LowerExp implementation when
Debug-formatted.
§
Causes self to use its LowerHex implementation when
Debug-formatted.
§
Causes self to use its Octal implementation when Debug-formatted.
§
Causes self to use its Pointer implementation when
Debug-formatted.
§
Causes self to use its UpperExp implementation when
Debug-formatted.
§
Causes self to use its UpperHex implementation when
Debug-formatted.
§
§
§
Calls .tap() only in debug builds, and is erased in release builds.
§
Calls .tap_mut() only in debug builds, and is erased in release
builds.
§
Calls .tap_borrow() only in debug builds, and is erased in release
builds.
§
Calls .tap_borrow_mut() only in debug builds, and is erased in release
builds.
§
Calls .tap_ref() only in debug builds, and is erased in release
builds.
§
Calls .tap_ref_mut() only in debug builds, and is erased in release
builds.
§
Calls .tap_deref() only in debug builds, and is erased in release
builds.
§
Calls .tap_deref_mut() only in debug builds, and is erased in release
builds.
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes
Size for each variant:
All: 0 bytesStandard: 0 bytesSelection: 48 bytes