pub enum AppConfig {
CKB(Box<CKBAppConfig>),
Miner(Box<MinerAppConfig>),
}Expand description
The parsed config file.
CKB process reads ckb.toml or ckb-miner.toml, depending what subcommand to be executed.
Variants§
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn load_for_subcommand<P: AsRef<Path>>(
root_dir: P,
subcommand_name: &str,
) -> Result<AppConfig, ExitCode>
pub fn load_for_subcommand<P: AsRef<Path>>( root_dir: P, subcommand_name: &str, ) -> Result<AppConfig, ExitCode>
Reads the config file for the subcommand.
This will reads the ckb-miner.toml in the CKB directory for ckb miner, and ckb.toml
for all other subcommands.
Sourcepub fn metrics(&self) -> &MetricsConfig
pub fn metrics(&self) -> &MetricsConfig
Gets metrics options.
Sourcepub fn memory_tracker(&self) -> &MemoryTrackerConfig
pub fn memory_tracker(&self) -> &MemoryTrackerConfig
Gets memory tracker options.
Sourcepub fn chain_spec(&self) -> Result<ChainSpec, ExitCode>
pub fn chain_spec(&self) -> Result<ChainSpec, ExitCode>
Gets chain spec.
Sourcepub fn into_ckb(self) -> Result<Box<CKBAppConfig>, ExitCode>
pub fn into_ckb(self) -> Result<Box<CKBAppConfig>, ExitCode>
Unpacks the parsed ckb.toml config file.
Panics when this is a parsed ckb-miner.toml.
Sourcepub fn into_miner(self) -> Result<Box<MinerAppConfig>, ExitCode>
pub fn into_miner(self) -> Result<Box<MinerAppConfig>, ExitCode>
Unpacks the parsed ckb-miner.toml config file.
Panics when this is a parsed ckb.toml.
Sourcepub fn set_bin_name(&mut self, bin_name: String)
pub fn set_bin_name(&mut self, bin_name: String)
Set the binary name with full path.
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnwindSafe for AppConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more