cli_opt/
lib.rs

1use clap::ValueEnum;
2use std::fmt;
3
4/// Block authoring sealing scheme to be used by the dev service.
5#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
6pub enum SealingMode {
7	/// Author a block immediately upon receiving a transaction into the transaction pool
8	Instant,
9	/// Author a block upon receiving an RPC command
10	Manual,
11	/// Author blocks at a regular interval specified in seconds
12	Interval,
13}
14
15impl fmt::Display for SealingMode {
16	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17		match self {
18			SealingMode::Instant => write!(f, "Instant"),
19			SealingMode::Manual => write!(f, "Manual"),
20			SealingMode::Interval => write!(f, "Interval"),
21		}
22	}
23}