Trait MinerApiServer
pub trait MinerApiServer:
Sized
+ Send
+ Sync
+ 'static {
// Required methods
fn set_extra(&self, record: Bytes) -> Result<bool, ErrorObject<'static>>;
fn set_gas_price(
&self,
gas_price: Uint<128, 2>,
) -> Result<bool, ErrorObject<'static>>;
fn set_gas_limit(
&self,
gas_limit: Uint<128, 2>,
) -> Result<bool, ErrorObject<'static>>;
// Provided method
fn into_rpc(self) -> RpcModule<Self> { ... }
}
Available on crate feature
rpc
only.Expand description
Server trait implementation for the MinerApi
RPC API.
Required Methods§
fn set_extra(&self, record: Bytes) -> Result<bool, ErrorObject<'static>>
fn set_extra(&self, record: Bytes) -> Result<bool, ErrorObject<'static>>
Sets the extra data string that is included when this miner mines a block.
Returns an error if the extra data is too long.
fn set_gas_price(
&self,
gas_price: Uint<128, 2>,
) -> Result<bool, ErrorObject<'static>>
fn set_gas_price( &self, gas_price: Uint<128, 2>, ) -> Result<bool, ErrorObject<'static>>
Sets the minimum accepted gas price for the miner.
fn set_gas_limit(
&self,
gas_limit: Uint<128, 2>,
) -> Result<bool, ErrorObject<'static>>
fn set_gas_limit( &self, gas_limit: Uint<128, 2>, ) -> Result<bool, ErrorObject<'static>>
Sets the gaslimit to target towards during mining.
Provided Methods§
fn into_rpc(self) -> RpcModule<Self>
fn into_rpc(self) -> RpcModule<Self>
Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule
.
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.