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§

§

CKB(Box<CKBAppConfig>)

The parsed ckb.toml.

§

Miner(Box<MinerAppConfig>)

The parsed ckb-miner.toml.

Implementations§

source§

impl AppConfig

source

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.

source

pub fn logger(&self) -> &LogConfig

Gets logger options.

source

pub fn metrics(&self) -> &MetricsConfig

Gets metrics options.

source

pub fn memory_tracker(&self) -> &MemoryTrackerConfig

Gets memory tracker options.

source

pub fn chain_spec(&self) -> Result<ChainSpec, ExitCode>

Gets chain spec.

source

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.

source

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.

source

pub fn set_bin_name(&mut self, bin_name: String)

Set the binary name with full path.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsAny for T
where T: Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Cast to trait Any
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more